Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I query my subversion repository?

Tags:

svn

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?

like image 612
George Mauer Avatar asked Feb 20 '09 15:02

George Mauer


People also ask

How do I view SVN files?

SVN has incremented the version of your file (NOT the repository… just the file) to the next logical revision, revision 2. If you want to review what's happened to your files then you can check this by selecting the top-level parent folder and clicking on the Visual SVN 'Show log' option.


2 Answers

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 :-)

like image 114
Christian Rodemeyer Avatar answered Oct 25 '22 03:10

Christian Rodemeyer


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.

like image 44
Wim Coenen Avatar answered Oct 25 '22 04:10

Wim Coenen