views:

1488

answers:

5

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.

+3  A: 

I don't think so, but this question should be sent to the VisualSVN team, they're usually very prompt in their answers.

Lasse V. Karlsen
OK, I've re-posted to http://groups.google.com/group/visualsvn - cheers.
Marc Gravell
+2  A: 

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.]

Bert Huijben
Interesting - very, very interesting. I'll give that a whirl.
Marc Gravell
+2  A: 

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/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.

grenade
Interesting; I'll take a look
Marc Gravell
+2  A: 

This:

Use of WebDAV in Subversion

should help.

Julian Reschke
+1  A: 

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

?p=Rev specifies the revision

chhenni