More Subversion statistics goodness

10 May 2007 | Matt Perdeaux |

After the rip-roaring success of our initial forays with StatSVN, we thought how convenient it would be to have these useful statistics generated automatically.

So we came up with this batch file:

@ECHO OFF
set vcReposRoot={svn repository root}
set vcStatRoot={statistics site root}
set vcSVNURL={URL of subversion repos}

cd /d %vcReposRoot%
for /d %%a in (*) do (
  cd /d %vcStatRoot%
  mkdir %%a
  del /q %vcStatRoot%\%%a\*.*
  cd /d %vcStatRoot%\%%a

  svn co %vcSVNURL%/%%a/trunk
  svn log -v --xml %vcSVNURL%/%%a > %%a.log
  java -jar c:\statsvn\statsvn.jar %vcStatRoot%\%%a\%%a.log %vcStatRoot%\%%a\trunk
)

This little beauty loops through each repository, checks out the trunk into a fresh directory, generates a log file and then runs StatSVN against the generated trunk. The statistics files are written to a directory on our web server on a repository-by-repository basis, meaning we can browse to that directory, click a repository name (directory browsing turned on in Apache) and see all the latest stats.

We run the batch file at the end of the working week, and try not to waste too much of the weekend looking at the stats.


Add a comment

  Your name is required.
  Your email address is required.
        

  Please enter the answer in figures (type 12 NOT twelve).
 
  NB - We will not publish or disclose your email address to third parties. We require it so we can check you're not a nasty spambot, and so we can display your Gravatar if you have one. Apologies for the little arithmetic test, but we've been having terrible trouble with comment spam.

Latest blog entries

Blog archive

Categories


www.associativetrails.com