[PATCH 2 of 6 V2] match: extract a literal constant into a symbolic one

Martin von Zweigbergk martinvonz at google.com
Fri Nov 23 17:33:14 EST 2018


On Fri, Nov 23, 2018 at 9:17 AM Boris FELD <lothiraldan at gmail.com> wrote:

> On 23/11/2018 08:17, Martin von Zweigbergk via Mercurial-devel wrote:
>
>
>
> On Thu, Nov 22, 2018 at 2:21 PM Boris Feld <boris.feld at octobus.net> wrote:
>
>> # HG changeset patch
>> # User Boris Feld <boris.feld at octobus.net>
>> # Date 1542903632 -3600
>> #      Thu Nov 22 17:20:32 2018 +0100
>> # Node ID 7540e746d44775c7098d5fa473be9968317616f1
>> # Parent  98300756a74d424fcd1510b0bb98f07b9b0f8663
>> # EXP-Topic perf-ignore-2
>> # Available At https://bitbucket.org/octobus/mercurial-devel/
>> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r
>> 7540e746d447
>> match: extract a literal constant into a symbolic one
>>
>> diff --git a/mercurial/match.py b/mercurial/match.py
>> --- a/mercurial/match.py
>> +++ b/mercurial/match.py
>> @@ -1184,13 +1184,15 @@ def _buildmatch(kindpats, globsuffix, li
>>      else:
>>          return regex, lambda f: any(mf(f) for mf in matchfuncs)
>>
>> +MAXRESIZE = 20000
>
>
> Would be clearer as MAX_RE_SIZE or MAX_REGEX_SIZE (it's very easy to parse
> the current name as "max resize")
>
> We would be more than happy to use '_' here. What're the new rules
> regarding '_'? Where can we use them and where can we not?
>

I don't know, but there are many instances of constants with this style in
revlog.py, so I think it should be fine. I'd happily queue it anyway, and
if someone objects, we can drop the underscores in a follow-up patch (seems
unlikely to happen).


> _______________________________________________
> Mercurial-devel mailing listMercurial-devel at mercurial-scm.orghttps://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20181123/2a595926/attachment.html>


More information about the Mercurial-devel mailing list