Compare revisions can use the wrong peg revision

3 views
Skip to first unread message

Dave Lawrence

unread,
Aug 22, 2008, 12:45:27 PM8/22/08
to us...@tortoisesvn.tigris.org
I've attached a script (as a .txt) to create a simple repos with 4 revs
to demonstrate this problem. It creates test.txt, modifies it in revs 2
and 3, and renames it to test_newname.txt in rev 4.

To put things in context, it then does a command line svn diff on rev 1
and 2 using peg revisions in different ways.

After running the script, do a show log on test_wc, and click compare
revisions on rev 1 and 2. It shows test.txt modified. So far so good.
Now double lick on test.txt, and the error occurs:
"File not found: revision 4, path '/test.txt'

It (I presume) is trying to diff revs 1 and 2 of test.txt@4, but
test.txt no longer exists at rev 4. I think that it should either use
test.txt@2 or text_newname.txt@4 (not sure if there is a preference here).

It could be worse, because if a trunk has been replaced by a branch,
this behavior could actually bring up a diff on completely the wrong file.

If show log is launched from the repo-browser, with the browser set to
show a specific revision, then it is that revision that is used as the
peg revision, so this is a fairly straightforward workaround, now I have
figured it out.

I have seen the issue in "real life" on an http repo. I checked nightly
build 1.5.2.13747 and the behavior is the same.

Thanks


batchfile.txt

Dave Lawrence

unread,
Aug 22, 2008, 1:00:04 PM8/22/08
to us...@tortoisesvn.tigris.org
Dave Lawrence wrote:
> I've attached a script (as a .txt) to create a simple repos with 4 revs
> to demonstrate this problem. It creates test.txt, modifies it in revs 2
> and 3, and renames it to test_newname.txt in rev 4.
>
> To put things in context, it then does a command line svn diff on rev 1
> and 2 using peg revisions in different ways.
>
> After running the script, do a show log on test_wc, and click compare
> revisions on rev 1 and 2. It shows test.txt modified. So far so good.
> Now double lick on test.txt, and the error occurs:
> "File not found: revision 4, path '/test.txt'
>
> It (I presume) is trying to diff revs 1 and 2 of test.txt@4, but
> test.txt no longer exists at rev 4. I think that it should either use
> test.txt@2 or text_newname.txt@4 (not sure if there is a preference here).
>
> It could be worse, because if a trunk has been replaced by a branch,
> this behavior could actually bring up a diff on completely the wrong file.

I retract that statement. For some reason, if a file of the same name
existed in the previous trunk, and you invoke the diff from show log of
the current trunk, then the diff correctly shows the differences between
the two revs of the correct file (even though it lived in the branch
back in the revs that are being diffed). But for files that live in the
current trunk, came from the old branch and didn't have an equivalent in
the old trunk, the failure is the same. If that description is unclear
(I suspect it is) then I can do another script to demonstrate.

>
> If show log is launched from the repo-browser, with the browser set to
> show a specific revision, then it is that revision that is used as the
> peg revision, so this is a fairly straightforward workaround, now I have
> figured it out.
>
> I have seen the issue in "real life" on an http repo. I checked nightly
> build 1.5.2.13747 and the behavior is the same.
>
> Thanks
>
>
>
>

> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-un...@tortoisesvn.tigris.org
> For additional commands, e-mail: users...@tortoisesvn.tigris.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-un...@tortoisesvn.tigris.org
For additional commands, e-mail: users...@tortoisesvn.tigris.org

Stefan Küng

unread,
Aug 23, 2008, 2:59:17 AM8/23/08
to us...@tortoisesvn.tigris.org
Dave Lawrence wrote:
> Dave Lawrence wrote:
>> I've attached a script (as a .txt) to create a simple repos with 4 revs
>> to demonstrate this problem. It creates test.txt, modifies it in revs 2
>> and 3, and renames it to test_newname.txt in rev 4.
>>
>> To put things in context, it then does a command line svn diff on rev 1
>> and 2 using peg revisions in different ways.
>>
>> After running the script, do a show log on test_wc, and click compare
>> revisions on rev 1 and 2. It shows test.txt modified. So far so good.
>> Now double lick on test.txt, and the error occurs:
>> "File not found: revision 4, path '/test.txt'
>>
>> It (I presume) is trying to diff revs 1 and 2 of test.txt@4, but
>> test.txt no longer exists at rev 4. I think that it should either use
>> test.txt@2 or text_newname.txt@4 (not sure if there is a preference here).
>>
>> It could be worse, because if a trunk has been replaced by a branch,
>> this behavior could actually bring up a diff on completely the wrong file.
>
> I retract that statement. For some reason, if a file of the same name
> existed in the previous trunk, and you invoke the diff from show log of
> the current trunk, then the diff correctly shows the differences between
> the two revs of the correct file (even though it lived in the branch
> back in the revs that are being diffed). But for files that live in the
> current trunk, came from the old branch and didn't have an equivalent in
> the old trunk, the failure is the same. If that description is unclear
> (I suspect it is) then I can do another script to demonstrate.

Yes, please do. It's very difficult from such descriptions to find the
exact steps to reproduce something.

Stefan

--
___
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest Interface to (Sub)Version Control
/_/ \_\ http://tortoisesvn.net

signature.asc

Dave Lawrence

unread,
Aug 26, 2008, 2:46:17 AM8/26/08
to us...@tortoisesvn.tigris.org
I think I probably confused things with that second posting. Anyway,
attached is a script which demonstrates what happens where a directory
has been replaced - I think this demo may be more helpful.

Do a show log on "bar" after running the script a compare revisions 2
and 3. This shows file1.txt and file2.txt modified. Clicking file2.txt
will give an error. Clicking file1.txt will do the equivlalent of
svn diff %REPO%/bar/file1.txt@2 %REPO%/foo/file1.txt@3

Whereas I think it should do
svn diff %REPO%/foo/file1.txt@2 %REPO%/foo/file1.txt@3

Which is equivalent to
svn diff bar/file1.txt -r2:3
which is the operation I think the user would expect from the GUI in
this case.

batchfile.txt

Stefan Küng

unread,
Aug 26, 2008, 12:01:03 PM8/26/08
to us...@tortoisesvn.tigris.org

Thanks a lot for your detailed script!

Fixed in r13763.

signature.asc
Reply all
Reply to author
Forward
0 new messages