tags:

views:

103

answers:

3

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.

+1  A: 

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.

Alex - Aotea Studios
I need a monthly report.
James A. N. Stauffer
A: 

Alex,

Can you post the script here?

Eric
Sorry, I don't have the script anymore, I wrote it in one of my previous jobs. It was extracting specific information from commit comments so wouldn't be generally useful anyway.
Alex - Aotea Studios
+1  A: 

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

Vanni Totaro