Re: Accessing the SVN log from java Code
From: Arijit Datta <arijit.datta_at_ymail.com>
Date: Wed, 18 Apr 2012 03:22:48 +0800 (SGT)
Thanks for the quick reply. We are also not bothered with the checkouts. We are only bothered about the check-ins & we will also have similar DB setup. But we will do a nightly refresh of the data in DB by pulling the log data from the svn repository.
However, the point of this post is the Java Code. I am not sure how I can "look up" the svn repository from the code. Was hoping if a good Samaritan would help out with a code snippet.
Also, I am unsure who Ryan Schmidt is & how do I get in touch with him.
From: Andy Levy <email@example.com>
To: Arijit Datta <firstname.lastname@example.org>
Cc: "email@example.com" <firstname.lastname@example.org>
Sent: Wednesday, 18 April 2012 12:45 AM
Subject: Re: Accessing the SVN log from java Code
On Tue, Apr 17, 2012 at 14:53, Arijit Datta <email@example.com> wrote:
> We have a requirement whereby we need to access a svn server and find the
> no. of check-ins happening for each repository.
> For example the SVN is hosted at https://svnexample.net
> And there are 3 repositories on it:
> The requirement is to connect to this server and then find out the number of
> check-in / check-outs happening per project. We want to build a web
> application which does that and gives the user the data in form of graphs,
> How do we go about doing that? That is how do we access the svn server from
> inside the java code and get these details?
The repository doesn't keep track of checkouts, so you cannot glean
that data from the repository. Ryan Schmidt has a script that can be
used to parse Apache logs to collect this information.
I would recommend against pulling this data from the log in realtime,
but instead populate a database with the relevant data (you'll have to
write something to do this for an initial population of the database
using a one-time output of svn log, then have a post-commit hook which
updates the database going forward), and generate your reports from
queries against that database. The only instance where this would
become a problem is if you regularly change revision properties, but
you can have a post-revprop-change hook to perform those updates if
Although I don't use it to retrieve/parse log entries, I use SVNKit to
interrogate my repository from within Java. http://svnkit.com/
This is an archived mail posted to the Subversion Users mailing list.