我正在使用VisualSVN Server来托管SVN仓库,对于某些自动化工作,我希望能够通过http [s]层获得特定版本。
我可以通过http [s]请求到服务器(httpd?)来获取HEAD版本 - 但是有没有能力指定修订版,可能是查询字符串?我似乎无法找到它......
除非我能帮忙,否则我不想办理结账,因为特定文件夹中有很多文件,我不想全部 - 只有一两个。
答案 0 :(得分:85)
迟到总比没有好; https://entire/Path/To/Folder/file/?p=REV
?p = Rev指定修订版
答案 1 :(得分:6)
Dunno如果您已经找到了这个问题的答案,但是在apache上的常规svn服务器上,您可以使用以下命令进行特定修订:
http://host/svn-name/!svn/bc/REVISION_NUMBER/path/to/file.ext
我从未使用过visualsvn,所以你的里程可能会有所不同。
答案 2 :(得分:4)
Subversion不会公开记录内部用于访问该信息的Uris。 (并且在记录的地方,明确声明在未来的版本中可以更改)
要在网络上访问此信息,您可以使用网络查看器(例如websvn, viewvc)。
如果您想从自己的程序访问它,您还可以使用类似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);
}
[更新2008-12-31:Subversion的下一个版本之一将开始记录您可用于检索旧版本的公共网址。]
答案 3 :(得分:2)
答案 4 :(得分:0)
help page for the VisualSVN Web Interface建议使用以下格式之一的地址:
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
关键的事情似乎是回购版本号以'r'开头。这里没有其他答案可以提及,使用这样的地址格式,我可以从VisualSVN服务器查看源文件的特定版本。