[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: Scott Palmer <scott.palmer_at_2connected.org>
Date: 2006-03-17 03:12:45 CET

On 16-Mar-06, at 2:09 PM, kfogel@collab.net wrote:

> Scott Palmer <scott.palmer@2connected.org> writes:
>> No. Actually Mr. Heppenstall is correct.
>>
>> I did the experiment. (Actually a slightly modified experiment using
>> 'cat' instead of 'checkout')
>>
>> svn cat url-to-foo@5
>>
>> outputs the contents of 'foo' as it existed in revision 5, even
>> though the head revision is different.
>>
>> Sadly there seems to be a bug because if foo is renamed to bar in the
>> head revsion
>>
>> svn cat -rHEAD url-to-foo@5
>>
>> FAILS! the Error message is
>> svn: File not found: revision 10, path '/path/to/foo'
>>
>> Where 10 is the revision of HEAD.
>> This is NOT what I expected. I', using Subversion 1.3.0 on
>> Windows XP.
>> Peg revisions are broken it seems. At least for the 'svn cat'
>> command.
>
> If the url-to-foo was renamed to url-to-bar sometime before r10 (i.e.,
> before HEAD), then this is indeed an error.

I'm not sure I understand. How is it possible to for ANYTHING to
happen after HEAD since HEAD is by definition the latest?
Do you mean that the rename could not be part of the changes in rev
10 (HEAD)? Why not?

> Have you verified that
> this bug exists in latest trunk SVN?

No. I might try to compile that on my Mac later. (There is no way I
have time to set up to build on Windows.. too many uglies in the dev
environment there. I've done it once before and it wasn't fun
tracking down all the dependencies.)

>
> Of course, if url-to-foo had simply been deleted entirely before r10,
> then the error would be expected. But that's apparently not the case.
> It would help a great deal if you could post the reproduction script
> you're using.

Here it is, but I think it is working correctly. The problem is
perhaps in the documentation of peg revisions and what they are
capable of.

svnadmin create /tmp/repo
mkdir wc
echo Hello > wc/test.txt
svn import wc file:///tmp/repo/peg_test -m "initial import"
rm -r wc
svn co file:///tmp/repo/peg_test
echo Mom >> peg_test/test.txt
svn st peg_test
svn ci peg_test -m "changed contents"
svn mv peg_test/test.txt peg_test/test_renamed.txt
echo RENAMED >> peg_test/test_renamed.txt
svn ci peg_test -m "renamed and changed contents"
echo After Rename >> peg_test/test_renamed.txt
svn ci peg_test -m "changed contents after rename"
svn up peg_test
svn log -v peg_test
echo ---- test.txt@2 ----
svn cat file:///tmp/repo/peg_test/test.txt_at_2
echo ---- -rHEAD test.txt@2 ----
svn cat -rHEAD file:///tmp/repo/peg_test/test.txt_at_2

The output of which is:

Adding wc/test.txt

Committed revision 1.
A peg_test/test.txt
Checked out revision 1.
M peg_test/test.txt
Sending peg_test/test.txt
Transmitting file data .
Committed revision 2.
A peg_test/test_renamed.txt
D peg_test/test.txt
Deleting peg_test/test.txt
Adding peg_test/test_renamed.txt
Transmitting file data .
Committed revision 3.
Sending peg_test/test_renamed.txt
Transmitting file data .
Committed revision 4.
At revision 4.
------------------------------------------------------------------------
r4 | scottpalmer | 2006-03-16 21:10:38 -0500 (Thu, 16 Mar 2006) | 1 line
Changed paths:
    M /peg_test/test_renamed.txt

changed contents after rename
------------------------------------------------------------------------
r3 | scottpalmer | 2006-03-16 21:10:37 -0500 (Thu, 16 Mar 2006) | 1 line
Changed paths:
    D /peg_test/test.txt
    A /peg_test/test_renamed.txt (from /peg_test/test.txt:2)

renamed and changed contents
------------------------------------------------------------------------
r2 | scottpalmer | 2006-03-16 21:10:35 -0500 (Thu, 16 Mar 2006) | 1 line
Changed paths:
    M /peg_test/test.txt

changed contents
------------------------------------------------------------------------
r1 | scottpalmer | 2006-03-16 21:10:33 -0500 (Thu, 16 Mar 2006) | 1 line
Changed paths:
    A /peg_test
    A /peg_test/test.txt

initial import
------------------------------------------------------------------------
---- test.txt@2 ----
Hello
Mom
---- -rHEAD test.txt@2 ----
svn: File not found: revision 4, path '/peg_test/test.txt'

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Mar 17 03:13:46 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.