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.

Nenhum comentário:

Postar um comentário