0
votes

What is the best way to do complex reporting on subversion logs like the following for each file? file, directory, last revision date, previous revision date(where revision date is at least 30 older than last), days diff(between revision dates)

Since Subversion allows on revision to change multiple files I assume svn log needs to be run against each file individually.

Ideas (that don't seem very good):

Shell scripting to produce a csv file to be imported to a DB. The following is a start but doesn't show the filename: find . -name "." -print | xargs -l svn log -l 2

Shell scripting to produce XML and then use XSLT to create CSV to import to a DB. It might use a similar command to above but would still have some of the same limitation.

Write a program to just parse the log on the whole directory tree, make one insert to DB per revision/file combination, and then query the DB.

3

3 Answers

1
votes

When I needed some information from an SVN log, I dumped it in XML and used a Ruby script to parse it. You can use XPath from Ruby which should make parsing easy. I think you should be able to get the log for the whole tree. If you're after one report, why bother with a database at all? Maybe you could just add some arguments to your script if you want to change the sort order for example.

1
votes

If a rich (not custom) report is enough for you, take a look at StatSVN.

0
votes

PanBI has a svn module which gives an OLAP interface to svn log: http://sourceforge.net/projects/panbi/

It generates a svn.sql with all your log. You can use the sql to dump in to any db you want