SVN 中的 -r 和 url@rev 有什么区别? [英] What's the difference between -r and url@rev in SVN?
问题描述
谁能解释一下下面两个SVN命令中-r REV
和URL@REV
语法的使用区别:
Can someone explain the difference between the use of the -r REV
and URL@REV
syntax in the following two SVN commands:
svn co -r6002 https://svnserv2.acme.com/stx/project1/trunk/gui/Mammoth/WebContent/css
svn:无法在修订版 6002 中找到https://svnserv2.acme.com/stx/project1/trunk/gui/Mammoth/WebContent/css"的存储库位置
svn: Unable to find repository location for 'https ://svnserv2.acme.com/stx/project1/trunk/gui/Mammoth/WebContent/css' in revision 6002
svn co https://svnserv2.acme.com/stx/project1/trunk/gui/Mammoth/WebContent/css@6002
检出修订版 6002.
Checked out revision 6002.
因此,如果我使用 -r
签出一个 SVN 目录的版本,它会失败,但是如果我使用 url@REV
它可以工作 - 我会认为这两个是等价的,不幸的是 SVN 文档似乎没有解释差异.
So if I checkout a version of an SVN directory with -r
it fails, but if I use url@REV
it works - I would have thought the two were equivalent and unfortunately the SVN docs do not seem to explain the difference.
推荐答案
-r X
对 Subversion 说转到今天的 URL,告诉我你对修订版 X 的了解"(假设您尚未指定 @
修订版)
-r X
says to Subversion "go to the URL as it is today, and tell me what you know about revision X" (assuming you haven't specified an @
revision)
url@X
对 Subversion 说转到修订版 X 并找到此 URL"
url@X
says to Subversion "go to revision X and find this URL"
@
语法称为 挂钩修订.-r X
是操作修订版.
The @
syntax is called a Peg Revision. The -r X
is the Operative Revision.
这是一个非常微妙的区别,但非常重要.当您使用 @X
时,您会经常使用 -r X
.
It's a very subtle difference, but very important. You'll often use -r X
when you're using @X
.
因此,如果您在修订版 6003 中删除了 https://svnserv2.acme.com/stx/project1/trunk/gui/Mammoth/WebContent/css
,它现在无法查看该 URLHEAD
是修订版 6004(或更高版本),因为它不存在.
So if you deleted https://svnserv2.acme.com/stx/project1/trunk/gui/Mammoth/WebContent/css
in revision 6003, it can't look at that URL now that HEAD
is revision 6004 (or anything later) because it doesn't exist.
这篇关于SVN 中的 -r 和 url@rev 有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!