context: add an optional constructor parameter for a match.bad() override
authorMatt Harbison <matt_harbison@yahoo.com>
Fri, 05 Jun 2015 19:01:04 -0400
changeset 25465 f472228a9e5e
parent 25464 504a1f295677
child 25466 007a1d53f7c3
context: add an optional constructor parameter for a match.bad() override Most matcher creation is done by way of a context.
mercurial/context.py
--- a/mercurial/context.py	Fri Jun 05 18:56:33 2015 -0400
+++ b/mercurial/context.py	Fri Jun 05 19:01:04 2015 -0400
@@ -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: