##// END OF EJS Templates
match: override matchfn() the usual way in subdirmatcher
Martin von Zweigbergk -
r32464:2e80a691 default
parent child Browse files
Show More
@@ -462,12 +462,6 b' class subdirmatcher(basematcher):'
462 if matcher.prefix():
462 if matcher.prefix():
463 self._always = any(f == path for f in matcher._files)
463 self._always = any(f == path for f in matcher._files)
464
464
465 # Some information is lost in the superclass's constructor, so we
466 # can not accurately create the matching function for the subdirectory
467 # from the inputs. Instead, we override matchfn() and visitdir() to
468 # call the original matcher with the subdirectory path prepended.
469 self.matchfn = lambda fn: matcher.matchfn(self._path + "/" + fn)
470
471 def bad(self, f, msg):
465 def bad(self, f, msg):
472 self._matcher.bad(self._path + "/" + f, msg)
466 self._matcher.bad(self._path + "/" + f, msg)
473
467
@@ -480,6 +474,13 b' class subdirmatcher(basematcher):'
480 def uipath(self, f):
474 def uipath(self, f):
481 return self._matcher.uipath(self._path + "/" + f)
475 return self._matcher.uipath(self._path + "/" + f)
482
476
477 def matchfn(self, f):
478 # Some information is lost in the superclass's constructor, so we
479 # can not accurately create the matching function for the subdirectory
480 # from the inputs. Instead, we override matchfn() and visitdir() to
481 # call the original matcher with the subdirectory path prepended.
482 return self._matcher.matchfn(self._path + "/" + f)
483
483 def visitdir(self, dir):
484 def visitdir(self, dir):
484 if dir == '.':
485 if dir == '.':
485 dir = self._path
486 dir = self._path
General Comments 0
You need to be logged in to leave comments. Login now