##// END OF EJS Templates
match: override 'visitdir' in subdirmatcher...
Martin von Zweigbergk -
r28128:92f2c69e default
parent child Browse files
Show More
@@ -381,7 +381,16 b' class subdirmatcher(match):'
381 self._always = any(f == path for f in matcher._files)
381 self._always = any(f == path for f in matcher._files)
382
382
383 self._anypats = matcher._anypats
383 self._anypats = matcher._anypats
384 # Some information is lost in the superclass's constructor, so we
385 # can not accurately create the matching function for the subdirectory
386 # from the inputs. Instead, we override matchfn() and visitdir() to
387 # call the original matcher with the subdirectory path prepended.
384 self.matchfn = lambda fn: matcher.matchfn(self._path + "/" + fn)
388 self.matchfn = lambda fn: matcher.matchfn(self._path + "/" + fn)
389 def visitdir(dir):
390 if dir == '.':
391 return matcher.visitdir(self._path)
392 return matcher.visitdir(self._path + "/" + dir)
393 self.visitdir = visitdir
385 self._fileroots = set(self._files)
394 self._fileroots = set(self._files)
386
395
387 def abs(self, f):
396 def abs(self, f):
General Comments 0
You need to be logged in to leave comments. Login now