[PATCH] revset: add function for matching extra data (issue2767)

Henrik Stuart hg at hstuart.dk
Sat May 12 02:03:36 CDT 2012


On 11-05-2012 22:30, Matt Mackall wrote:
> On Fri, 2012-05-11 at 14:23 +0200, Henrik Stuart wrote:
>> # HG changeset patch
>> # User Henrik Stuart<hg at hstuart.dk>
>> # Date 1336738342 -7200
>> # Node ID 417f576e3552190b4a5ba9d2e2d1db0ec5b65927
>> # Parent  ddd4996740c785cc187766249977ea3ece8c17ab
>> revset: add function for matching extra data (issue2767)
>>
>> diff --git a/mercurial/revset.py b/mercurial/revset.py
>> --- a/mercurial/revset.py
>> +++ b/mercurial/revset.py
>> @@ -464,6 +464,31 @@
>>       getargs(x, 0, 0, _("draft takes no arguments"))
>>       return [r for r in subset if repo._phaserev[r] == phases.draft]
>>
>> +def extra(repo, subset, x):
>> +    """``extra(label, [value], [set])``
>> +    Changesets with the given label in the extra metadata, with the given
>> +    optional value, matched globally or from the optional set."""
>
> Not sure about the optional set bit. Is there any reason not to do:
>
> <set>  and extra(foo)
>
> instead?

Mostly just convenience (and possibly performance in some cases?); I 
don't feel strongly about it, so I can omit it if you prefer.

-- 
Kind regards,
   Henrik


More information about the Mercurial-devel mailing list