[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Accessing the SVN log from java Code

From: Andy Levy <andy.levy_at_gmail.com>
Date: Tue, 17 Apr 2012 15:40:39 -0400

On Tue, Apr 17, 2012 at 15:30, Arijit Datta <arijit.datta_at_ymail.com> wrote:
> Hello Andy,
>
> I am not sure if I understand this:
>
> "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
> needed."
>
> Could you kindly explain.

The contents of every commit are immutable, but the revision
properties (user ID, timestamp, log message) can be changed if the
repository is configured to allow it (by not rejecting the action in
the pre-revprop-change hook script). If your repository is configured
in this way, you can write a post-revprop-change hook script which
would update the corresponding record in your database to capture the
change, without having to reload all the data in the database.

> ________________________________
> From: Andy Levy <andy.levy_at_gmail.com>
> To: Arijit Datta <arijit.datta_at_ymail.com>
> Cc: "users_at_subversion.apache.org" <users_at_subversion.apache.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 <arijit.datta_at_ymail.com> wrote:
>> Hello,
>>
>> 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:
>>
>> https://svnexample.net/rep/project1
>> https://svnexample.net/rep/project2
>> https://svnexample.net/rep/project3
>>
>> 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,
>> etc.
>>
>> 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
> needed.
>
> Although I don't use it to retrieve/parse log entries, I use SVNKit to
> interrogate my repository from within Java. http://svnkit.com/
>
>
Received on 2012-04-17 21:41:53 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.