[PATCH 2 of 7] context: add an optional constructor parameter for a match.bad() override

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


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1433545264 14400
#      Fri Jun 05 19:01:04 2015 -0400
# Node ID 66903c607ef552bd11cd4f65d176a099df7231c6
# Parent  d40991e9e4e5b2f45ede19a76909515c1a9d07fd
context: add an optional constructor parameter for a match.bad() override

Most matcher creation is done by way of a context.

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -255,12 +255,12 @@
         return subrepo.nullsubrepo(self, path, pctx)
 
     def match(self, pats=[], include=None, exclude=None, default='glob',
-              listsubrepos=False):
+              listsubrepos=False, badfn=None):
         r = self._repo
         return matchmod.match(r.root, r.getcwd(), pats,
                               include, exclude, default,
                               auditor=r.auditor, ctx=self,
-                              listsubrepos=listsubrepos)
+                              listsubrepos=listsubrepos, badfn=badfn)
 
     def diff(self, ctx2=None, match=None, **opts):
         """Returns a diff generator for the given contexts and matcher"""
@@ -1448,7 +1448,7 @@
                 wlock.release()
 
     def match(self, pats=[], include=None, exclude=None, default='glob',
-              listsubrepos=False):
+              listsubrepos=False, badfn=None):
         r = self._repo
 
         # Only a case insensitive filesystem needs magic to translate user input
@@ -1456,11 +1456,12 @@
         if not util.checkcase(r.root):
             return matchmod.icasefsmatcher(r.root, r.getcwd(), pats, include,
                                            exclude, default, r.auditor, self,
-                                           listsubrepos=listsubrepos)
+                                           listsubrepos=listsubrepos,
+                                           badfn=badfn)
         return matchmod.match(r.root, r.getcwd(), pats,
                               include, exclude, default,
                               auditor=r.auditor, ctx=self,
-                              listsubrepos=listsubrepos)
+                              listsubrepos=listsubrepos, badfn=badfn)
 
     def _filtersuspectsymlink(self, files):
         if not files or self._repo.dirstate._checklink:


More information about the Mercurial-devel mailing list