From david.dehaven at oracle.com Thu Dec 17 22:56:36 2015 From: david.dehaven at oracle.com (David DeHaven) Date: Thu, 17 Dec 2015 14:56:36 -0800 Subject: Fix for CODETOOLS-7901466? Message-ID: <5C500B60-786B-41B2-B68C-C0C29354D994@oracle.com> 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- From jonathan.gibbons at oracle.com Fri Dec 18 00:24:30 2015 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Thu, 17 Dec 2015 16:24:30 -0800 Subject: Fix for CODETOOLS-7901466? In-Reply-To: <5C500B60-786B-41B2-B68C-C0C29354D994@oracle.com> References: <5C500B60-786B-41B2-B68C-C0C29354D994@oracle.com> Message-ID: <5673523E.8050705@oracle.com> 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? -- 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- > From magnus.ihse.bursie at oracle.com Fri Dec 18 13:27:17 2015 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Fri, 18 Dec 2015 14:27:17 +0100 Subject: Fix for CODETOOLS-7901466? In-Reply-To: <5673523E.8050705@oracle.com> References: <5C500B60-786B-41B2-B68C-C0C29354D994@oracle.com> <5673523E.8050705@oracle.com> Message-ID: <567409B5.70004@oracle.com> 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- >> >