3

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.

bahrep
  • 26,679
  • 12
  • 95
  • 136
user2187357
  • 71
  • 1
  • 1
  • 2

1 Answers1

5

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

alroc
  • 26,170
  • 5
  • 45
  • 88
  • Thanks, I should have read the manual more carefully (as usual!) – user2187357 Mar 20 '13 at 09:30
  • `-r X says to Subversion "go to the URL as it is today` why is it so? – n611x007 Apr 21 '15 at 13:55
  • @naxa what do you mean? Why did the Subversion developers choose to implement this functionality? Are you questioning the syntax/style? Why it's needed at all? Your question isn't at all clear. – alroc Apr 21 '15 at 15:29
  • I cannot see any use when anyone would want to go to head revision and see revision X from there. `Why it's needed at all?` and `Why did the Subversion developers choose to` are my questions. I cannot actually grasp what does it mean to `URL as it is today and tell me what you know about`. – n611x007 Apr 21 '15 at 15:35
  • `URL as it is today and tell me what you know about` - is this about the string value of the `Request-URI` of the HTTP Request? - In any case, `Why it's needed at all?` and the svn dev's design choice are my major questions. – n611x007 Apr 21 '15 at 15:45