我正在使用VisualSVN Server来托管SVN库,并且为了一些自动化工作,我想通过http[s]层获取特定版本。
我可以通过向服务器(httpd?)发送http[s]请求来简单地获取HEAD版本,但是否有能力指定版本,例如查询字符串?我似乎找不到...
我不想进行checkout,除非我能够得到帮助,因为特定文件夹中有很多文件,而我只需要其中的一个或两个。
我正在使用VisualSVN Server来托管SVN库,并且为了一些自动化工作,我想通过http[s]层获取特定版本。
我可以通过向服务器(httpd?)发送http[s]请求来简单地获取HEAD版本,但是否有能力指定版本,例如查询字符串?我似乎找不到...
我不想进行checkout,除非我能够得到帮助,因为特定文件夹中有很多文件,而我只需要其中的一个或两个。
宁可迟到,也不要错过;https://entire/Path/To/Folder/file/?p=REV
?p=Rev指定了版本。
不知道您是否已经找到了这个问题的答案,但在Apache上的常规svn服务器上,您可以使用以下命令访问特定版本:
http://host/svn-name/!svn/bc/REVISION_NUMBER/path/to/file.ext
我从未使用过visualsvn,所以你的体验可能会有所不同。
!svn/bc/
部分。如果路径是http://svn.apache.org/repos/asf/httpd/site/trunk/content/index.mdtext
,你会如何获取特定版本的修订? - David BlevinsSubversion没有公开记录其内部访问该信息的URI。(而且在记录中明确说明,这可能会在未来版本中更改)
要在Web上访问此信息,您可以使用Web查看器(例如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 将开始记录可用于检索旧版本的公共URL。]
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