# HG changeset patch # User Martin von Zweigbergk # Date 2017-05-25 16:52:49 # Node ID 43e091847c4dd5b5621598276cc2fd09c114d0cf # Parent bb18728ea617c52f668df832474601a9af59dfa2 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. diff --git a/mercurial/match.py b/mercurial/match.py --- a/mercurial/match.py +++ b/mercurial/match.py @@ -209,7 +209,6 @@ class basematcher(object): 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 @@ class basematcher(object): '''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