changeset 35452:8251c4c4abdc

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.
author Boris Feld <boris.feld@octobus.net>
date Mon, 27 Nov 2017 18:48:36 -0500
parents e28dedf4ff43
children 24528dba0e64
files mercurial/debugcommands.py tests/test-install.t
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Sat Dec 16 12:34:40 2017 -0500
+++ b/mercurial/debugcommands.py	Mon Nov 27 18:48:36 2017 -0500
@@ -1173,6 +1173,11 @@
              fm.formatlist([e.name() for e in wirecompengines
                             if e.wireprotosupport()],
                            name='compengine', fmt='%s', sep=', '))
+    re2 = 'missing'
+    if util._re2:
+        re2 = 'available'
+    fm.plain(_('checking "re2" regexp engine (%s)\n') % re2)
+    fm.data(re2=bool(util._re2))
 
     # templates
     p = templater.templatepaths()
--- a/tests/test-install.t	Sat Dec 16 12:34:40 2017 -0500
+++ b/tests/test-install.t	Mon Nov 27 18:48:36 2017 -0500
@@ -14,6 +14,7 @@
   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 @@
     "pythonlib": "*", (glob)
     "pythonsecurity": [*], (glob)
     "pythonver": "*.*.*", (glob)
+    "re2": (true|false), (re)
     "templatedirs": "*mercurial?templates", (glob)
     "username": "test",
     "usernameerror": null,
@@ -67,6 +69,7 @@
   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 @@
   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 @@
   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)