[PATCH 2 of 2] templatekw: introduce the changessincelatesttag keyword

Matt Harbison mharbison72 at gmail.com
Mon Jun 29 11:45:59 CDT 2015


On Mon, 29 Jun 2015 05:15:20 -0400, Pierre-Yves David  
<pierre-yves.david at ens-lyon.org> wrote:

>
>
> On 06/28/2015 02:00 PM, Matt Harbison wrote:
>> On Sun, 28 Jun 2015 12:51:38 -0400, Matt Harbison
>> <mharbison72 at gmail.com> wrote:
>>
>>> On Sun, 28 Jun 2015 07:03:21 -0400, Yuya Nishihara <yuya at tcha.org>  
>>> wrote:
>>>
>>>> On Sat, 27 Jun 2015 12:50:48 -0400, Matt Harbison wrote:
>>>>> On Sat, 27 Jun 2015 09:15:33 -0400, Yuya Nishihara <yuya at tcha.org>
>>>>> wrote:
>>>>> > On Sat, 27 Jun 2015 00:01:24 -0400, Matt Harbison wrote:
>>
>> [snip]
>>
>>>>> I added something like this to a build script:
>>>>>
>>>>>      hg log -r "wdir()" -T
>>>>> "{latesttag}+{changessincelatesttag}-{p1node|short}{if(files,'+')}\n"
>>>>>
>>>>> and cut on the first '+' if the value between '+' and '-' is zero.
>>>>> Treating a change count of 1 as the tagged release is why it seems
>>>>> weird.
>>>>
>>>> Perhaps it would need something to select the revision to be  
>>>> displayed,
>>>> for example:
>>>>
>>>>   hg log -r 'last(. + wdir() & file("**"))' -T '...{ifeq(node,
>>>> "ff...", "+")}'
>>>
>>> Maybe it is something wrong with the intersection of last() and dirty
>>> wdir(), but:
>>>
>>> $ ../hg log -r '. + wdir() & file("**")'
>>> changeset:   27772:d8cc3dd1acc6
>>> tag:         tip
>>> user:        Matt Harbison <matt_harbison at yahoo.com>
>>> date:        Sat Jun 27 13:00:11 2015 -0400
>>> summary:     revset: Yuya's patch to support kwargs
>>>
>>> changeset:   27772:d8cc3dd1acc6+
>>> user:        Matt Harbison <matt_harbison at yahoo.com>
>>> date:        Sun Jun 28 11:48:00 2015 -0400
>>>
>>> $ ../hg log -r 'last(. + wdir() & file("**"))'
>>> $
>>>
>>> $ ../hg log -r 'first(. + wdir() & file("**"))'
>>> changeset:   27772:d8cc3dd1acc6
>>> tag:         tip
>>> user:        Matt Harbison <matt_harbison at yahoo.com>
>>> date:        Sat Jun 27 13:00:11 2015 -0400
>>> summary:     revset: Yuya's patch to support kwargs
>>
>> I did a little more digging here, and there are two causes:
>>
>> 1) inside revset.last(), the line 'y = next(it, None)' returns None for
>> wdir().  Using -2 as the default and checking against that causes the
>> elif path to be taken.
>
> Fixing thing in this direction looks like an hopeless battle. None will  
> be used as "no value" all arounds. We should settle for a special value  
> for wdir and check them. I think the latest state is:

Fair enough, this was just proving to myself that there was an ambiguity  
here, and not something else wrong.

> rev = maxint
> hex = 'f' * 40 (and related node)

I assume that means wctx.rev() will return maxint, not just that maxint is  
magic within a revset?  Should we put a wdirrev = None in node for now,  
and switch it later when ready?  I've got 2 patches that rely on None, and  
I know I've added others in the past.  It seems silly to hunt them all  
down later, but IDK how soon we are ready to pull the trigger on this  
change.

>> 2) inside the elif path, None is not in 'ss'.  'ss' is a fullreposet, so
>> this goes back to the discussion of the revset virtual revision plan and
>> is a known WIP.
>


More information about the Mercurial-devel mailing list