[PATCH V2] debuginstall: add a line about re2 availability

Yuya Nishihara yuya at tcha.org
Thu Nov 30 07:04:56 EST 2017


On Wed, 29 Nov 2017 23:39:07 -0500, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld at octobus.net>
> # Date 1511826516 18000
> #      Mon Nov 27 18:48:36 2017 -0500
> # Node ID 436617b471ed303bc28e977ff335086d3d7d0f3c
> # Parent  8287df8b7be545fdafa22b771012ac65f6264d12
> # EXP-Topic debugpyre2
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 436617b471ed
> debuginstall: add a line about re2 availability
> 
> Using re2 engine can massively speed up regexp. We make it simpler to check if
> it is available in a given install.
> 
> diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
> --- a/mercurial/debugcommands.py
> +++ b/mercurial/debugcommands.py
> @@ -1120,6 +1120,10 @@ def debuginstall(ui, **opts):
>               fm.formatlist([e.name() for e in wirecompengines
>                              if e.wireprotosupport()],
>                             name='compengine', fmt='%s', sep=', '))
> +    re2 = 'missing'
> +    if util._re2:
> +        re2 = 'available'
> +    fm.write('re2', _('checking "re2" regexp engine (%s)\n'), re2)

Just a nitpick, but raw boolean value is preferred in JSON output, and
'missing'/'available' should be translated in plain output.


More information about the Mercurial-devel mailing list