Question

I'm using VisualSVN Server to host an SVN repo, and for some automation work, I'd like to be able to get specific versions via the http[s] layer.

I can get the HEAD version simply via an http[s] request to the server (httpd?) - but is there any ability to specify the revision, perhaps as a query-string? I can't seem to find it...

I don't want to do a checkout unless I can help it, as there are a lot of files in the specific folder, and I don't want them all - just one or two.

Was it helpful?

Solution

Better late than never; https://entire/Path/To/Folder/file/?p=REV

?p=Rev specifies the revision

OTHER TIPS

Dunno if you've already found the answer to this question but in regular svn server on apache you can get to a particular revision with:

http://host/svn-name/!svn/bc/REVISION_NUMBER/path/to/file.ext
  • host & REVISION_NUMBER are obvious
  • /path/to/file.ext is relative to repo root

I've never used visualsvn so your mileage may vary.

Subversion does not publicly document the Uris it uses internally to access that information. (And where it is documented, it is explicitly stated that this can change in future versions)

To access this information on the web you could use a web viewer (E.g. websvn, viewvc).

If you want to access it from your own program you could also use a client binding like SharpSvn.

using (SvnClient client = new SvnClient())
using (FileStream fs = File.Create("c:\\temp\\file.txt"))
{
    // Perform svn cat http://svn.collab.net/svn/repos/trunk/COMMITTERS -r 23456 
    //                    > file.txt

    SvnCatArgs a = new SvnCatArgs();
    a.Revision = 23456;
    client.Cat(new Uri("http://svn.collab.net/svn/repos/trunk/COMMITTERS"), a, fs);
}

[Update 2008-12-31: One of the next few versions of Subversion will start documenting public urls you can use for retrieving old versions.]

This:

Use of WebDAV in Subversion

should help.

The help page for the VisualSVN Web Interface suggests using an address formatted like one of these:

link to r1484 commit in the serf's project repository:
https://demo-server.visualsvn.com/!/#serf/commit/r1484/

link to the current content of the trunk/context.c file in the serf's project repository:
https://demo-server.visualsvn.com/!/#serf/view/head/trunk/context.c

link to the content of trunk/context.c file at revision r2222 in the serf's project repository:
https://demo-server.visualsvn.com/!/#serf/view/r2222/trunk/context.c

The crucial thing seems to be the repo revision number prefixed by 'r'. None of the other answers here mention that, and using addresses formatted like this I was able to view a specific revision of a source file from our VisualSVN server.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top