StatSVN – SVN Statistics Tool

Posted: February 9, 2014 in General, Java

Recently my manager asked me to generate a statistics report from our project sourcecode in SVN. He wanted to monitor the changes to the project in terms of Lines Of Code, Files, File Commit Frequency etc.

Today, I am gonna explain how I did this using ‘STATSVN’ – a statistics generating tool for SVN. It generates HTML reports from svn log files.

Step 1: Download the latest version of STATSVN from http://www.statsvn.org/downloads.html. It will be downloaded a zip file. For the example I want you to unzip this file to  C:/statsvn

Step 2: Checkout your project from SVN (For this example we are checking out the project to C:/SuhasJavaProject

Step 3: Install Tortiose SVN Client from http://tortoisesvn.net/downloads.html and during installation make sure that you choose ‘Command Line Client’ when prompted about what all features to install.

Step 4: Open command prompt and check if your SVN installation was perfect by typing ‘svn info’ and it will list down the SVN URL of your repository, repository root, current revision, last changed author etc.

Step 5: Now navigate to your checked out project folder ‘cd C:\SuhasJavaProject‘ and create a svn log file using the followign command ‘svn log –xml -v > svn.log‘  and now you can see a new svn.log file created under your project.

Step 6 : Now navigate to your statsvn folder ‘cd C:\statsvn’ and execute the following command and see the magic ‘java -jar statsvn.jar

c:\SuhasJavaProject\svn.log c:\SuhasJavaProject

Now you can see that under C:\statsvn so many new files are generated. Open C:\statsvn\index.html in a browser and you can view the stats. !!!

Hope you find this useful 🙂

 

 

Advertisements
Comments
  1. Arcadio says:

    Great!!! Thank you very much indeed. Much obliged 🙂

  2. Jay Teli says:

    Thank you

  3. waqar says:

    excellent suhas! yours sincerely, Waqar Zaidi (SCM)

  4. Kanagarathinam.A says:

    Hi,

    I have tried SVN 1.10.2, Got the following error. Is any other way to run in 1.10.2.

    Could you suggest me.

    Oct 04, 2018 6:23:04 PM net.sf.statsvn.util.JavaUtilTaskLogger info
    INFO: StatSVN – SVN statistics generation

    Oct 04, 2018 6:23:05 PM net.sf.statsvn.util.JavaUtilTaskLogger error
    SEVERE: Subversion binary is incorrect version. Found: 1.10.2, required: 1.3.0

    Thanks,

    • ShamanOfJava says:

      Did you download latest statsSVN from http://www.statsvn.org/downloads.html as mentioned in step 1 ?

      • Kanagarathinam.A says:

        Yes, I tried from this link –

        Any thing wrong in this cmd ::

        java -jar statsvn.jar C:\statsvn-0.7.0>java -jar statsvn.jar C:\dev\SamplePrj\svn.log C:\dev\SamplePrj

        Oct 08, 2018 3:27:43 PM net.sf.statsvn.util.JavaUtilTaskLogger info
        INFO: StatSVN – SVN statistics generation

        Oct 08, 2018 3:27:44 PM net.sf.statsvn.util.JavaUtilTaskLogger error
        SEVERE: Subversion binary is incorrect version. Found: 1.10.2, required: 1.3.0

        Please suggest me…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s