我使用的VisualSVN服务器为主机SVN仓库,并对一些自动化的工作,我还想到能够得到特定版本通过http[s]层。

我可以得到头版本只是通过http[s]请求到服务器(httpd?) -但是没有任何能够指定的修订,或许作为查询串?我似乎找不到它...

我不想做一个结帐,除非我能帮它,因为有大量的文件在特定文件夹中,而且我不想要他们所有的只是一个或两个。

其他提示

不知道,如果你已经找到了这个问题的答案,但在定期svn服务器apache你可以得到一个特定的修订:

http://host/svn-name/!svn/bc/REVISION_NUMBER/path/to/file.ext
  • 主&REVISION_NUMBER是显而易见的
  • /path/to/文件。ext是相对软件库根

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

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的下一个版本之一将开始记录您可用于检索旧版本的公共网址。]

此:

使用WebDAV在Subversion中

应该有帮助。

VisualSVN Web界面的帮助页面建议使用格式如下之一的地址:

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服务器查看源文件的特定修订版。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top