Mostrando postagens com marcador tfs. Mostrar todas as postagens
Mostrando postagens com marcador tfs. Mostrar todas as postagens

domingo, 13 de maio de 2012

Using multiple subversion trees with Gource

This is a follow up on my previous post on Gource last week.

Gource supports Subversion out of the box. Just start Gource.exe from a Subversion controlled directory, and Gource will download the change logs automatically, convert them to the internal Gource format, and show the visualization.

In some situations, it can be useful to do these steps manually. For example, when you want to show the visualization based on multiple source trees.
This can be done by following these steps:
  • Download the change logs from your version control system.  
    • The command to do this can be obtained from Gource by executing, from the directory:
      gource.exe --log-command svn
      This gives this output:
      svn log -r 1:HEAD --xml --verbose --quiet
    • Run this command, and store the output in a file:
      svn log -r 1:HEAD --xml --verbose --quiet > c:\temp\log-source-1.txt
    • Repeat this for the other source trees that you want to visualize
  • Convert the Subversion change log files to the Gource format. This can be done in one step using a Powershell command:
    Get-ChildItem  log-source-*.txt | foreach { .\Gource\gource.exe --log-format svn --output-custom-log "$_-gource.txt" "$_" }
    (or using a similar command using e.g. bash).
    This creates the files "log-source-*.txt-gource.txt"
  • Merge the Gource log files into one big file, and order on the timestamp.  For this, I used FxGqlC:
    select * into [log-source-merged.txt] from [log-source-*.txt-gource.txt] order by matchregex(*, '^(\d+)|')
  • Now you can run Gource on the merged changelog file:
    .\Gource\gource.exe log-source-merged.txt
The procedure above can easily be changed for any version control system, like GIT or Mercurial. Even the ones which Gource doesn't support, like Microsoft Visual Studio Team Foundation Server. In that case, you can transform the TFS changeset history into the Gource internal format using a Powershell or FxGqlC script.

terça-feira, 31 de janeiro de 2012

Removing TFS workspaces from old users or old computers

When working with Microsoft Team Foundation Server, sometimes it can be necessary to cleanup old workspaces.  For example, when a computername is re-used, and the same local directory is used by the new user to map a TFS folder.

You need the tool tfs.exe, which is installed togetcher with Visual Studio.  You can start a Visual Studio Command Prompt. I tested the procedure below on Visual Studio 2008 and Visual Studio 2010.

In the commands below, replace serveraddress with your TFS http or https address, e.g. https://tfs.mycompany.com:8443.  You can find it in Visual Studio: menu "Team", menu-item "Connect to Team Foundation Server...", button "Servers..."

The existing workspaces for some "computername" can be queried with this TFS command:
tf.exe workspaces /computer:computername /owner:* /format:detailed /server:serveraddress
You get a list of all workspaces, with the existing mappings. It is the workspace name (behind "Workspace:") and the owner that you need in order to delete the workspace.

Now run this TFS command to remove the workspace "workspacename" for owner "owner":
tf.exe workspace /delete workspacename;owner /server:
serveraddress

Please be aware that the workspacename and the computername can be different. On my machine, the first workspacename was the same as the computername, the next workspaces were suffixed with _0, _1, ...