[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: Help explain peg revisions

From: Gale, David <David.Gale_at_Hypertherm.com>
Date: 2006-03-16 21:17:57 CET

Scott Palmer wrote:
> On 16-Mar-06, at 2:47 PM, Vincent Starre wrote:
>> Due to the "backtracking only" nature, I thought foo@167 meant "the
>> node which was called foo at revision 167", which could only be
>> last-changed at a revision equal-to-or-less-than 167. So
>> technically, "svn co -r167 foo" and "svn co foo@167" could give you
>> the same thing, assuming they havent been moved/renamed at all.
>> However, that said, the /purpose/ of peg-revisions is still
>> entirely seperate from -r, and their meanings should definatly
>> _NOT_ be mixed.
>
>
> Yes, I think you understand it well. Though peg revision puts a
> limit on the latest revision that it will get that can be overridden
> with -r, so it is more of a side effect. Even if you do NOT rename
> or move foo the peg revision syntax will limit the revision you get
> to the revision specified by the peg revision, not HEAD.

Actually, no. Just did some more tests:

$ echo 'Hello!' > foo
$ svn add foo
A foo
$ svn ci
Adding foo
Transmitting file data .
Committed revision 1.
$ vi foo
Hello!
Another line.
"foo" 2L, 21C written
$ svn ci
Sending foo
Transmitting file data .
Committed revision 2.
$ svn cat svn://loon/example.com/foo
Hello!
Another line.
$ svn cat svn://example.com/test/foo_at_1
Hello!
$ svn cat -r1 svn://example.com/test/foo
Hello!
$ svn cat -r2 svn://example.com/test/foo_at_1
Hello!
Another line.
$ svn cat -r1 svn://example.com/test/foo_at_2
Hello!
$ svn rm foo
D foo
$ svn ci
Deleting foo

Committed revision 3.
$ svn cat svn://example.com/test/foo
svn: File not found: revision 3, path '/foo'
$ svn cat svn://loon/test/foo_at_1
Hello!
$ svn cat -r1 svn://example.com/test/foo
svn: File not found: revision 3, path '/foo'
$ svn cat -r2 svn://loon/test/foo_at_1
Hello!
Another line.
$ svn cat -r3 svn://example.com/test/foo_at_1
svn: File not found: revision 3, path '/foo'

So, specifying a peg revision does (by default) the equivalent of
setting the -r to the same value, but it can be overwritten, even by a
later revision number. Moving the file behaves as Scott & Vincent point
out: using a peg revision to point to the file before the move and
asking for the contents after the move doesn't work.

I'm surprised, because I didn't realize that peg revisions implicitly
specified a -r argument; I thought they left it at HEAD, and let the
user override it as needed.

Ah, well...learn something every day, right?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Mar 16 21:20:45 2006

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.