Fix for CODETOOLS-7901466?

Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Fri Dec 18 13:27:17 UTC 2015


On 2015-12-18 01:24, Jonathan Gibbons wrote:
> David,
>
> Thanks for the contribution.
>
> Are there any Mercurial experts who can review the changes here, 
> and/or what would it take to test this on appropriate versions of 
> Mercurial?

I have hg 2.8 installed on my Ubuntu.

I ran the test.sh script from the bug report, and then webrev -N -r -2. 
I get the same behavior both before and after the patch.

I also tried manually running these commands after test.sh:
ihse at pantheon:/tmp/test-hg$ hg log --rev 4:tip --follow --template 'rev 
{rev} : {desc}\n' file2
rev 4 : edit3
ihse at pantheon:/tmp/test-hg$ hg log --rev 4:tip --removed --template 'rev 
{rev} : {desc}\n' file2
rev 4 : edit3

So it does not break older mercurial versions. I have no 3.4 version to 
test with, but if David has tested this I'd say the patch is fine.

/Magnus

>
> -- Jon
>
> On 12/17/2015 02:56 PM, David DeHaven wrote:
>> I've been gritting my teeth at this problem for a while, mostly just 
>> ignoring the excess comments in the output or using -C to disable 
>> comments entirely.
>>
>> Today I'd had enough so I poked at this a bit and I think, from what 
>> I understand the reasons for adding --follow were, that simply 
>> changing --follow to --removed fixes this.
>>
>> Post 3.4, the new behavior of --follow with -r simply changes the 
>> revision selection to reverse(::{rev}), so if we pass -r N:tip, this 
>> turns into reverse(::N:tip) which shows the entire history of the 
>> file. The second part of the description of --follow does not seem to 
>> apply when -r is specified, but --removed shows changesets where the 
>> file moved or was deleted which I believe was the point of adding 
>> --follow.
>>
>> Thoughts?
>>
>> Here's my proposed patch, that should work with pre-3.4 (though I've 
>> not tested it):
>>
>> --- cut here ---
>> diff --git a/webrev.ksh b/webrev.ksh
>> --- a/webrev.ksh
>> +++ b/webrev.ksh
>> @@ -1120,11 +1120,11 @@
>>                           for rev in $ALL_CREV; do
>>                               rev_opt="$rev_opt --rev $rev"
>>                           done
>> -                        comm=`hg log $rev_opt --follow --template 
>> 'rev {rev} : {desc}\n' $logf`
>> +                        comm=`hg log $rev_opt --removed --template 
>> 'rev {rev} : {desc}\n' $logf`
>>                       elif [[ -n $FIRST_CREV ]]; then
>> -                comm=`hg log --rev $FIRST_CREV:tip --follow 
>> --template 'rev {rev} : {desc}\n' $logf`
>> +                comm=`hg log --rev $FIRST_CREV:tip --removed 
>> --template 'rev {rev} : {desc}\n' $logf`
>>                       else
>> -                comm=`hg log -l1 --follow --template 'rev {rev} : 
>> {desc}\n' $logf`
>> +                comm=`hg log -l1 --removed --template 'rev {rev} : 
>> {desc}\n' $logf`
>>                       fi
>>               else
>>                   comm=""
>> --- cut here ---
>>
>> -DrD-
>>
>



More information about the code-tools-dev mailing list