[PATCH stable] test-log: Add test for "hg log -pf" (issue647)

Mads Kiilerich mads at kiilerich.com
Tue Jul 13 10:03:13 CDT 2010


  Nicolas Dumazet wrote, On 07/13/2010 02:29 PM:
> On Sat, 10 Jul 2010 12:31:33 +0200
> Mads Kiilerich<mads at kiilerich.com>  wrote:
>
>> # HG changeset patch
>> # User Joel Rosdahl<joel at rosdahl.net>
>> # Date 1278621855 -7200
>> # Node ID 8308e4ad39813f6d0dd1987ac9628003f5e2ccb4
>> # Parent  f4eddec324b755a45ea71570c7c8dc63bcbdfc1a
>> test-log: Add test for "hg log -pf" (issue647)
>>
>> Test for f786fc4b8764
>>
>> diff --git a/tests/test-log b/tests/test-log
>> --- a/tests/test-log
>> +++ b/tests/test-log
>> @@ -31,6 +31,9 @@
>>   echo % many renames
>>   hg log -vf e
>>
>> +echo % log -pf b
>> +hg log -pf b
>> +
>>   echo '% log copies with --copies'
>>   hg log -vC --template '{rev} {file_copies}\n'
>>   echo '% log copies switch without --copies, with old filecopy template'
>> diff --git a/tests/test-log.out b/tests/test-log.out
>> --- a/tests/test-log.out
>> +++ b/tests/test-log.out
>> @@ -76,6 +76,29 @@
>>   a
>>
>>
>> +% log -pf b
>> +changeset:   1:784de7cef101
>> +user:        test
>> +date:        Thu Jan 01 00:00:02 1970 +0000
>> +summary:     b
>> +
>> +diff -r 8580ff50825a -r 784de7cef101 b
>> +--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
>> ++++ b/b	Thu Jan 01 00:00:02 1970 +0000
>> +@@ -0,0 +1,1 @@
>> ++a
>> +
>> +changeset:   0:8580ff50825a
>> +user:        test
>> +date:        Thu Jan 01 00:00:01 1970 +0000
>> +summary:     a
>> +
>> +diff -r 000000000000 -r 8580ff50825a a
>> +--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
>> ++++ b/a	Thu Jan 01 00:00:01 1970 +0000
>> +@@ -0,0 +1,1 @@
>> ++a
>> +
> Mmm... that looks strange to me.
>
> The test builds:
>
> 0 | 1 |   2    | 3  |   4
> a  ------------>  b
>   \
>      b ->  dir/b ------->  e
>
>                   d
>
> (a copied to b in rev1; b renamed to dir/b in rev2; etc...)
>
>
> Why would "log -pf b" return [0,1] ? I would expect [0,3]

That's because of the famous issue 1327. The revlog for b only contains 
one version pointing back to rev 1. Rev 3 will reuse the existing entry 
(which has the right content and the right parent - but the wrong 
revlink). Fixing that is out of scope for this patch ;-)

But I guess we should try to find a better test case that doesn't expose 
other issues.

> Other strange finding: here, "log -vf b" gives: [0,1,0,1,2].
> (yes! 0 and 1 are returned twice! Ugh!) Again, I'd expect [0,3]

I don't see that. I get the [0,1] I unfortunately have to expect.

Can you try to verify this finding?

/Mads


More information about the Mercurial-devel mailing list