changeset 32463:43e091847c4d

match: make matchfn a method on the class This makes it easier to override in subclasses, so they don't have to assign the attribute with a lambda.
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 25 May 2017 09:52:49 -0700
parents bb18728ea617
children 2e80a691e575
files mercurial/match.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/match.py	Wed May 24 17:50:17 2017 +0200
+++ b/mercurial/match.py	Thu May 25 09:52:49 2017 -0700
@@ -209,7 +209,6 @@
         self._cwd = cwd
         if badfn is not None:
             self.bad = badfn
-        self.matchfn = lambda f: False
 
     def __call__(self, fn):
         return self.matchfn(fn)
@@ -266,6 +265,9 @@
         '''Returns True if f is in .files().'''
         return f in self._fileset
 
+    def matchfn(self, f):
+        return False
+
     def visitdir(self, dir):
         '''Decides whether a directory should be visited based on whether it
         has potential matches in it or one of its subdirectories. This is