<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 11, 2019 at 9:46 AM Pierre-Yves David <<a href="mailto:pierre-yves.david@ens-lyon.org">pierre-yves.david@ens-lyon.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"># HG changeset patch<br>
# User Pierre-Yves David <<a href="mailto:pierre-yves.david@octobus.net" target="_blank">pierre-yves.david@octobus.net</a>><br>
# Date 1555000496 -7200<br>
#      Thu Apr 11 18:34:56 2019 +0200<br>
# Node ID ca4f233c0f5c4ca5604a53c01216a16d136c69d8<br>
# Parent  509a0477b3a6e9f1ea0fe32bfb028c256aada7fa<br>
# EXP-Topic fix-2e2699af5649<br>
# Available At <a href="https://bitbucket.org/octobus/mercurial-devel/" rel="noreferrer" target="_blank">https://bitbucket.org/octobus/mercurial-devel/</a><br>
#              hg pull <a href="https://bitbucket.org/octobus/mercurial-devel/" rel="noreferrer" target="_blank">https://bitbucket.org/octobus/mercurial-devel/</a> -r ca4f233c0f5c<br>
match: fix re2 compability broken in 2e2699af5649<br>
<br>
Apparently, the re2 regex matcher return False when no match are found.</blockquote><div><br></div><div>This is not quite true; we explicitly use a different method on the compiled regex when we use re2: <a href="https://www.mercurial-scm.org/repo/hg/file/509a0477b3a6/mercurial/match.py#l41">https://www.mercurial-scm.org/repo/hg/file/509a0477b3a6/mercurial/match.py#l41</a></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> So since<br>
2e2699af5649 running test on a machine with a re2 install fails in many places.<br>
Instead we make the code a bit more general and everything goes back to normal.<br>
<br>
diff --git a/mercurial/match.py b/mercurial/match.py<br>
--- a/mercurial/match.py<br>
+++ b/mercurial/match.py<br>
@@ -1288,7 +1288,7 @@ def _buildregexmatch(kindpats, globsuffi<br>
<br>
         if startidx == 0:<br>
             matcher = _rematcher(fullregexp)<br>
-            func = lambda s: matcher(s) is not None<br>
+            func = lambda s: bool(matcher(s))<br>
         else:<br>
             group = regexps[startidx:]<br>
             allgroups.append(_joinregexes(group))<br>
</blockquote></div></div>