[PATCH 2 of 2] templatekw: introduce the changessincelatesttag keyword
Matt Harbison
mharbison72 at gmail.com
Sun Jun 28 21:00:53 UTC 2015
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.
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