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

login
register
mail settings
Submitter Matt Harbison
Date June 5, 2015, 4 a.m.
Message ID <91db1c0b272e90c500f1.1433476852@Envy>
Download mbox | patch
Permalink /patch/9507/
State Accepted
Commit aaede04c0ba65672cdce60fb43fe2b6316dcddf4
Headers show

Comments

Matt Harbison - June 5, 2015, 4 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@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.

Patch

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)