Patchwork debuginstall: add a line about re2 availability

login
register
mail settings
Submitter Boris Feld
Date Nov. 28, 2017, 8:33 p.m.
Message ID <dfade8ee7beafb4c6c8e.1511901215@FB>
Download mbox | patch
Permalink /patch/25785/
State Superseded
Headers show

Comments

Boris Feld - Nov. 28, 2017, 8:33 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1511826516 18000
#      Mon Nov 27 18:48:36 2017 -0500
# Node ID dfade8ee7beafb4c6c8eecfdf54b301dba0ecaf1
# Parent  8287df8b7be545fdafa22b771012ac65f6264d12
# EXP-Topic debugpyre2
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r dfade8ee7bea
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.
Augie Fackler - Nov. 29, 2017, 10:47 p.m.
On Tue, Nov 28, 2017 at 03:33:35PM -0500, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld@octobus.net>
> # Date 1511826516 18000
> #      Mon Nov 27 18:48:36 2017 -0500
> # Node ID dfade8ee7beafb4c6c8eecfdf54b301dba0ecaf1
> # Parent  8287df8b7be545fdafa22b771012ac65f6264d12
> # EXP-Topic debugpyre2
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r dfade8ee7bea
> 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('regextre2', _('checking "re2" regexp engine (%s)\n'), re2)

"regextre2"? I'm not sure what to make of that key (the "regext" part
in particular - is that a typo for "regexp"? something else?). "re2"
might be enough here...

>
>      # templates
>      p = templater.templatepaths()
> diff --git a/tests/test-install.t b/tests/test-install.t
> --- a/tests/test-install.t
> +++ b/tests/test-install.t
> @@ -14,6 +14,7 @@ hg debuginstall
>    checking registered compression engines (*zlib*) (glob)
>    checking available compression engines (*zlib*) (glob)
>    checking available compression engines for wire protocol (*zlib*) (glob)
> +  checking "re2" regexp engine \((available|missing)\) (re)
>    checking templates (*mercurial?templates)... (glob)
>    checking default template (*mercurial?templates?map-cmdline.default) (glob)
>    checking commit editor... (* -c "import sys; sys.exit(0)") (glob)
> @@ -44,6 +45,7 @@ hg debuginstall JSON
>      "pythonlib": "*", (glob)
>      "pythonsecurity": [*], (glob)
>      "pythonver": "*.*.*", (glob)
> +    "regextre2": "(available|missing)", (re)
>      "templatedirs": "*mercurial?templates", (glob)
>      "username": "test",
>      "usernameerror": null,
> @@ -67,6 +69,7 @@ hg debuginstall with no username
>    checking registered compression engines (*zlib*) (glob)
>    checking available compression engines (*zlib*) (glob)
>    checking available compression engines for wire protocol (*zlib*) (glob)
> +  checking "re2" regexp engine \((available|missing)\) (re)
>    checking templates (*mercurial?templates)... (glob)
>    checking default template (*mercurial?templates?map-cmdline.default) (glob)
>    checking commit editor... (* -c "import sys; sys.exit(0)") (glob)
> @@ -110,6 +113,7 @@ path variables are expanded (~ is the sa
>    checking registered compression engines (*zlib*) (glob)
>    checking available compression engines (*zlib*) (glob)
>    checking available compression engines for wire protocol (*zlib*) (glob)
> +  checking "re2" regexp engine \((available|missing)\) (re)
>    checking templates (*mercurial?templates)... (glob)
>    checking default template (*mercurial?templates?map-cmdline.default) (glob)
>    checking commit editor... (* -c "import sys; sys.exit(0)") (glob)
> @@ -217,6 +221,7 @@ since it's bin on most platforms but Scr
>    checking registered compression engines (*) (glob)
>    checking available compression engines (*) (glob)
>    checking available compression engines for wire protocol (*) (glob)
> +  checking "re2" regexp engine \((available|missing)\) (re)
>    checking templates ($TESTTMP/installenv/*/site-packages/mercurial/templates)... (glob)
>    checking default template ($TESTTMP/installenv/*/site-packages/mercurial/templates/map-cmdline.default) (glob)
>    checking commit editor... (*) (glob)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Boris Feld - Nov. 30, 2017, 4:40 a.m.
On Wed, 2017-11-29 at 17:47 -0500, Augie Fackler wrote:
> On Tue, Nov 28, 2017 at 03:33:35PM -0500, Boris Feld wrote:
> > # HG changeset patch
> > # User Boris Feld <boris.feld@octobus.net>
> > # Date 1511826516 18000
> > #      Mon Nov 27 18:48:36 2017 -0500
> > # Node ID dfade8ee7beafb4c6c8eecfdf54b301dba0ecaf1
> > # Parent  8287df8b7be545fdafa22b771012ac65f6264d12
> > # EXP-Topic debugpyre2
> > # Available At https://bitbucket.org/octobus/mercurial-devel/
> > #              hg pull https://bitbucket.org/octobus/mercurial-deve
> > l/ -r dfade8ee7bea
> > 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('regextre2', _('checking "re2" regexp engine
> > (%s)\n'), re2)
> 
> "regextre2"? I'm not sure what to make of that key (the "regext" part
> in particular - is that a typo for "regexp"? something else?). "re2"
> might be enough here...

Right, we just sent a V2 with a much more simple name, "re2".

> 
> > 
> >      # templates
> >      p = templater.templatepaths()
> > diff --git a/tests/test-install.t b/tests/test-install.t
> > --- a/tests/test-install.t
> > +++ b/tests/test-install.t
> > @@ -14,6 +14,7 @@ hg debuginstall
> >    checking registered compression engines (*zlib*) (glob)
> >    checking available compression engines (*zlib*) (glob)
> >    checking available compression engines for wire protocol
> > (*zlib*) (glob)
> > +  checking "re2" regexp engine \((available|missing)\) (re)
> >    checking templates (*mercurial?templates)... (glob)
> >    checking default template (*mercurial?templates?map-
> > cmdline.default) (glob)
> >    checking commit editor... (* -c "import sys; sys.exit(0)")
> > (glob)
> > @@ -44,6 +45,7 @@ hg debuginstall JSON
> >      "pythonlib": "*", (glob)
> >      "pythonsecurity": [*], (glob)
> >      "pythonver": "*.*.*", (glob)
> > +    "regextre2": "(available|missing)", (re)
> >      "templatedirs": "*mercurial?templates", (glob)
> >      "username": "test",
> >      "usernameerror": null,
> > @@ -67,6 +69,7 @@ hg debuginstall with no username
> >    checking registered compression engines (*zlib*) (glob)
> >    checking available compression engines (*zlib*) (glob)
> >    checking available compression engines for wire protocol
> > (*zlib*) (glob)
> > +  checking "re2" regexp engine \((available|missing)\) (re)
> >    checking templates (*mercurial?templates)... (glob)
> >    checking default template (*mercurial?templates?map-
> > cmdline.default) (glob)
> >    checking commit editor... (* -c "import sys; sys.exit(0)")
> > (glob)
> > @@ -110,6 +113,7 @@ path variables are expanded (~ is the sa
> >    checking registered compression engines (*zlib*) (glob)
> >    checking available compression engines (*zlib*) (glob)
> >    checking available compression engines for wire protocol
> > (*zlib*) (glob)
> > +  checking "re2" regexp engine \((available|missing)\) (re)
> >    checking templates (*mercurial?templates)... (glob)
> >    checking default template (*mercurial?templates?map-
> > cmdline.default) (glob)
> >    checking commit editor... (* -c "import sys; sys.exit(0)")
> > (glob)
> > @@ -217,6 +221,7 @@ since it's bin on most platforms but Scr
> >    checking registered compression engines (*) (glob)
> >    checking available compression engines (*) (glob)
> >    checking available compression engines for wire protocol (*)
> > (glob)
> > +  checking "re2" regexp engine \((available|missing)\) (re)
> >    checking templates ($TESTTMP/installenv/*/site-
> > packages/mercurial/templates)... (glob)
> >    checking default template ($TESTTMP/installenv/*/site-
> > packages/mercurial/templates/map-cmdline.default) (glob)
> >    checking commit editor... (*) (glob)
> > _______________________________________________
> > Mercurial-devel mailing list
> > Mercurial-devel@mercurial-scm.org
> > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

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('regextre2', _('checking "re2" regexp engine (%s)\n'), re2)
 
     # templates
     p = templater.templatepaths()
diff --git a/tests/test-install.t b/tests/test-install.t
--- a/tests/test-install.t
+++ b/tests/test-install.t
@@ -14,6 +14,7 @@  hg debuginstall
   checking registered compression engines (*zlib*) (glob)
   checking available compression engines (*zlib*) (glob)
   checking available compression engines for wire protocol (*zlib*) (glob)
+  checking "re2" regexp engine \((available|missing)\) (re)
   checking templates (*mercurial?templates)... (glob)
   checking default template (*mercurial?templates?map-cmdline.default) (glob)
   checking commit editor... (* -c "import sys; sys.exit(0)") (glob)
@@ -44,6 +45,7 @@  hg debuginstall JSON
     "pythonlib": "*", (glob)
     "pythonsecurity": [*], (glob)
     "pythonver": "*.*.*", (glob)
+    "regextre2": "(available|missing)", (re)
     "templatedirs": "*mercurial?templates", (glob)
     "username": "test",
     "usernameerror": null,
@@ -67,6 +69,7 @@  hg debuginstall with no username
   checking registered compression engines (*zlib*) (glob)
   checking available compression engines (*zlib*) (glob)
   checking available compression engines for wire protocol (*zlib*) (glob)
+  checking "re2" regexp engine \((available|missing)\) (re)
   checking templates (*mercurial?templates)... (glob)
   checking default template (*mercurial?templates?map-cmdline.default) (glob)
   checking commit editor... (* -c "import sys; sys.exit(0)") (glob)
@@ -110,6 +113,7 @@  path variables are expanded (~ is the sa
   checking registered compression engines (*zlib*) (glob)
   checking available compression engines (*zlib*) (glob)
   checking available compression engines for wire protocol (*zlib*) (glob)
+  checking "re2" regexp engine \((available|missing)\) (re)
   checking templates (*mercurial?templates)... (glob)
   checking default template (*mercurial?templates?map-cmdline.default) (glob)
   checking commit editor... (* -c "import sys; sys.exit(0)") (glob)
@@ -217,6 +221,7 @@  since it's bin on most platforms but Scr
   checking registered compression engines (*) (glob)
   checking available compression engines (*) (glob)
   checking available compression engines for wire protocol (*) (glob)
+  checking "re2" regexp engine \((available|missing)\) (re)
   checking templates ($TESTTMP/installenv/*/site-packages/mercurial/templates)... (glob)
   checking default template ($TESTTMP/installenv/*/site-packages/mercurial/templates/map-cmdline.default) (glob)
   checking commit editor... (*) (glob)