[PATCH 5 of 7] commands: use the optional badfn argument when building a matcher

Matt Harbison mharbison72 at gmail.com
Fri Jun 5 22:54:24 CDT 2015


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1433547221 14400
#      Fri Jun 05 19:33:41 2015 -0400
# Node ID ee489c5750e9ddd0c4398a64d195bc32ae48a89e
# Parent  61e4745abda8e645f86ff2449a3a0cd573df3c8c
commands: use the optional badfn argument when building a matcher

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -350,8 +350,8 @@
     def bad(x, y):
         raise util.Abort("%s: %s" % (x, y))
 
-    m = scmutil.match(ctx, pats, opts)
-    m.bad = bad
+    m = scmutil.match(ctx, pats, opts, badfn=bad)
+
     follow = not opts.get('no_follow')
     diffopts = patch.difffeatureopts(ui, opts, section='annotate',
                                      whitespace=True)
@@ -4442,8 +4442,8 @@
 
     ret = 1
     ctx = repo[rev]
-    m = scmutil.match(ctx, pats, opts, default='relglob')
-    m.bad = lambda x, y: False
+    m = scmutil.match(ctx, pats, opts, default='relglob',
+                      badfn=lambda x, y: False)
 
     for abs in ctx.matches(m):
         if opts.get('fullpath'):


More information about the Mercurial-devel mailing list