D10064: re2: byteify some regex used to get check re2 availability

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Wed Feb 24 14:32:38 UTC 2021


marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Changeset 687b865b95ad <https://phab.mercurial-scm.org/rHG687b865b95add1fb486e556ab3afc9321f3f298c> failed to properly byteify this because it was a raw
  string. This went undetected so far because re2 does not seems to be widely
  tested.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D10064

AFFECTED FILES
  mercurial/util.py

CHANGE DETAILS

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -2170,7 +2170,7 @@
         global _re2
         try:
             # check if match works, see issue3964
-            _re2 = bool(re2.match(r'\[([^\[]+)\]', b'[ui]'))
+            _re2 = bool(re2.match(br'\[([^\[]+)\]', b'[ui]'))
         except ImportError:
             _re2 = False
 



To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel


More information about the Mercurial-devel mailing list