What's the difference between -r and url@rev in SVN?

孤街浪徒 提交于 2019-11-30 18:15:37

问题


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: 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

    Checked out revision 6002.

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.


回答1:


-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 says to Subversion "go to revision X and find this URL"

The @ syntax is called a Peg Revision. The -r X is the Operative Revision.

It's a very subtle difference, but very important. You'll often use -r X when you're using @X.

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.



来源:https://stackoverflow.com/questions/15504743/whats-the-difference-between-r-and-urlrev-in-svn

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!