[PATCH 7 of 8] revert: replace match.bad() monkey patching with match.badmatch()

Matt Harbison mharbison72 at gmail.com
Thu Jun 4 23:00:52 CDT 2015


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1433469742 14400
#      Thu Jun 04 22:02:22 2015 -0400
# Node ID 91db1c0b272e90c500f1fe5416150a65c2c6579f
# Parent  6316bb0636ce6669559c16f466d1065177ca637f
revert: replace match.bad() monkey patching with match.badmatch()

No known issues with the previous code since it immediately overwrote the
patched, locally create matcher.

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2838,8 +2838,7 @@
         targetsubs = sorted(s for s in wctx.substate if m(s))
 
         if not m.always():
-            m.bad = lambda x, y: False
-            for abs in repo.walk(m):
+            for abs in repo.walk(matchmod.badmatch(m, lambda x, y: False)):
                 names[abs] = m.rel(abs), m.exact(abs)
 
             # walk target manifest to fill `names`
@@ -2855,8 +2854,7 @@
                         return
                 ui.warn("%s: %s\n" % (m.rel(path), msg))
 
-            m.bad = badfn
-            for abs in ctx.walk(m):
+            for abs in ctx.walk(matchmod.badmatch(m, badfn)):
                 if abs not in names:
                     names[abs] = m.rel(abs), m.exact(abs)
 


More information about the Mercurial-devel mailing list