user2187357
user2187357

Reputation: 91

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

Can someone explain the difference between the use of the -r REV and URL@REV syntax in the following two SVN commands:

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.

Upvotes: 4

Views: 343

Answers (1)

alroc
alroc

Reputation: 28194

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

Upvotes: 6

Related Questions