Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

svn

svn-client

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.

like image 885
user2187357 Avatar asked Oct 29 '25 07:10

user2187357


1 Answers

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

like image 51
alroc Avatar answered Oct 31 '25 09:10

alroc



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!