tags:

views:

1820

answers:

7

Currently I would simply like to find all files that have not been modified in the last X days but ultimately I would like to be able to make more complex queries against my subversion repository.

Is there a Subversion Query Language of some sort or an API that I could use?

+2  A: 

Currently no, there's no subversion query language or query based api that's in widespread use (ok, now watch someone contradict me, that's life on the net I suppose).

This means you're limited to splicing together the outputs from the normal svn commands like

svn info

and

svn log

I'm sure something like bash or powershell could make this at least feasible. If you're stuck with windows batch, I'd start crying now.

Jim T
Wow, really? A serious need for a useful tool for developers across any platform and it doesn't exist? What the heck are we doing with our afternoons and evenings?
George Mauer
Not really, most of the information that's needed day-to-day is easily available in the standard set of commands. It's more unusual to want to find a list of files that haven't been modified for a while. Although my mind is now busy creating SVNSQL, dammit.
Jim T
Linq2Svn - damn thats sounds good
George Mauer
+2  A: 

there is no repository query language or search api. for complex queries, you would need an repository indexer (like http://supose.soebes.de/wiki/supose) or a commit database (like http://www.viewvc.org/). http://markmail.org/thread/wszzgnrny6o2r7u7 has some more links.

ax
+1  A: 

As already mentioned, svn log/info can be combined with shell commands to find what you want. Alternatively, you could directly use SVN's own API in C/C++ to programmtically process repository enties. SVN has Python bindings. If Java is your language of choice, try http://svnkit.com/

basszero
+5  A: 

You can use svn log command to produce an XML file with a lot of information about all commits like this:

svn log URL --xml --verbose > commits.xml

There are some more options you can play with to limit the revision range, get more information on rev props, include merge info, etc.

The problem then becomes "how do I perform queries on the content of an XML document", which is easier than working with the existing SVN APIs. For example, in C# you can do LINQ queries on XML.

Wim Coenen
In particular, the --revision range can include a date range: [[ svn log --verbose --revision '{2009-01-01}':'{2009-02-20}' --xml ]] Now, determining which ones have NOT changed will require some post-processing.
phord
+4  A: 

You could use the SvnQuery project (http://svnquery.tigris.org) which has the intention to provide a query interface for doing such queries. It has a .NET API and a web frontend, providing the same query language. You can do complex queries with operators, nested expressions, wildcards, phrases and gap phrases. The operator you ask for, calculating the difference between now and the last commit date, is not implemented, but as it is an open source project you can either volunteer to do it or post a feature request for it :-)

Christian Rodemeyer
+1  A: 

You may want to checkout VoilàSVN or OpenGrok

MRalwasser
+1  A: 

Check Fisheye . Really cool .

http://211.144.86.166/software/fisheye/docs/EyeQL%20Reference%20Guide.html

Deepu Mathew