SVNPlot generates graphs similar to StatSVN. The difference is in how the graphs are generated. SVNPlot generates these graphs in two steps. First it converts the Subversion logs into a 'sqlite3' database. Then it uses sql queries to extract the data from the database and then uses excellent Matplotlib plotting library to plot the graphs.
I believe using SQL queries to query the necessary data results in great flexibility in data extraction. Also since the sqlite3 is quite fast, it is possible to generate these graphs on demand.
Requirements (Third party libraries)
You will need following additional libraries for using SVNPlot
- D3JS - For creating tag clouds. It is included in the svnplot installation
If you want to use Matplotlib based SVNPlot (svnplot.py), then you will need
- NumPy- Matplotlib uses NumPy and SVNPlot uses Matplotlib for plotting.
- Matplotlib- You need at least version 0.98.5.2
Installation instructions for SVNPlot
- Download and Install Python 2.7.x or Python 3.5.x version (32 bits)
- Install pysvn Extension appropriate for your Python Version
- Download from Bitbucket. For Windows download Installer exe For other platforms download .zip file (NOTE : Google code has disabled adding new installers. Hence you may have to get the latest code and create the installer.)
- run the downloaded installer.
For Other platforms:
- Unzip SVNPlot-0.7.8.zip to a folder e.g. svnplot_inst
- Goto 'svnplot_inst' folder and run setup.py
By default svnplot scripts are installed in Python <site-packages> directory.
NOTE : You have to install the 32 bits version and it must be version 2.7.x, since the 64 bits version is not recognized by the installers for some of the required libraries and version 3.2.x is not supported by some of the required libraries
- Using SVNPlot is a two step process; first you have to pull data from svn to a SQLite database, then you run the analysis those data.*
Add python <site-packages/svnplot> folder in PATH environment variable or give the full path for executing svnlog2sqlite.py, svnplot.py, svnplotjs.py
1. First generate the sqlite database for your project.
[options] <svnrepo url> <sqlitedbpath>
<svnrepo url> can be any repository format supported by Subverson. If you are using the local repositories on windows use the file:/d:/... format.
NOTE : This is URL of repository *root*. For example, updating the SVN graphs for SVNPlot project use http://svnplot.googlecode.com/svn/. Using other urls like http://svnplot.googlecode.com/svn/trunk/ will result in error. (Upto version 0.5.4. This issue is fixed version 0.5.5, now svnrepo_url can be any url inside the repository)
<sqlitedbpath> is sqlite database file path. Its a path on your local machine
-l, --linecount: Update the changed line count data also. By default line count data is NOT updated.
-g, --log_ : enable logging of intermediate data and errors.
Enable this option if you face any problems like line count not getting generated, no data in the generated sqlite database etc.
-v, --verbose: Verbose output
2. Now generate the graphs.
[options] <svnsqlitedbpath> <graphdir>
[options] <svnsqlitedbpath> <output directory>
Following addition options are useful
-n '<reponame>', --name=<reponame>: This is name of repository (e.g. project name). It will use in generating the graph titles
-s '<searchpath>, --search=<searchpath>: search path in the repository (e.g. _/trunk_)
-p '<template file path>', --template=<template file path>: Default svnplot uses its own standard report format. However, you can change report format using -p option.
-m, --maxdir <num>: limits the number of directories on the graph to the
<num>largest directories as with large numbers of dirs the graph gets blurry.
-v, --verbose: verbose output For svnplot-js.py,
3. Generating Graph with your own report template You can use your own report template for the generated graphs. One example of report template is available in 'svnplot-long.tmpl'. This template directly embed the generated graphs images in the report and doesnot use thumbnails. It is useful to get a printed report.
svnplot.py -v --dpi 70 -p svnplot-long.tmpl -n "MyRepo" <sqlitedb path> <output directory>
TIP - Use 70 pixesl per inch resolution for better results with svnplot-long.tmpl template.
svnplot-js.py -v -n "MyRepo" <sqlitedb path> <output directory>
IMPORTANT NOTE for migrating from 0.5.x to 0.6
SVNPlot ver 0.6 sqlite database schema is different than 0.5.x schema. Hence for migrating from 0.5.x to 0.6 you will need to regenerate the sqlite database.