changeset 42099:bccb322f1496

match: fix re2 compability broken in 2e2699af5649 When using re2, we call test_match() instead of match() on the compiled regex object. While match() returns a matcher object or None, test_match() returns True or False. So since 2e2699af5649 running test on a machine with a re2 install fails in many places. Instead we make the code a bit more general and everything goes back to normal.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 11 Apr 2019 18:34:56 +0200
parents 5753e5949b51
children b63b8b7ca5fa
files mercurial/match.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/match.py	Wed Apr 10 03:10:53 2019 +0530
+++ b/mercurial/match.py	Thu Apr 11 18:34:56 2019 +0200
@@ -1288,7 +1288,7 @@
 
         if startidx == 0:
             matcher = _rematcher(fullregexp)
-            func = lambda s: matcher(s) is not None
+            func = lambda s: bool(matcher(s))
         else:
             group = regexps[startidx:]
             allgroups.append(_joinregexes(group))