使用VisualSVN Server通过http获取特定修订版

问题描述 投票:31回答:5

我正在使用VisualSVN Server来托管SVN仓库,对于某些自动化工作,我希望能够通过http [s]层获得特定版本。

我可以通过http [s]请求到服务器(httpd?)来获取HEAD版本 - 但是有没有能力指定修订版,可能是查询字符串?我似乎无法找到它......

除非我能帮忙,否则我不想做结帐,因为特定文件夹中有很多文件,我不想要它们 - 只有一两个。

svn http version-control visualsvn visualsvn-server
5个回答
85
投票

迟到总比不到好; https://entire/Path/To/Folder/file/?p=REV

?p = Rev指定修订版


6
投票

Dunno如果你已经找到了这个问题的答案,但是在apache上的常规svn服务器上你可以得到一个特定的修订:

http://host/svn-name/!svn/bc/REVISION_NUMBER/path/to/file.ext
  • host&REVISION_NUMBER很明显
  • /path/to/file.ext是相对于repo root的

我从未使用过visualsvn所以你的里程可能会有所不同。


4
投票

Subversion不会公开记录它在内部用于访问该信息的Uris。 (并且在记录的地方,明确声明在未来的版本中可以更改)

要在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。]


2
投票

这个:

Use of WebDAV in Subversion

应该有所帮助


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'为前缀的repo修订号。这里没有其他答案提及,并使用这样格式化的地址,我能够从VisualSVN服务器查看源文件的特定修订版。

© www.soinside.com 2019 - 2024. All rights reserved.