##// END OF EJS Templates
match: add isexact() method to hide internals...
Martin von Zweigbergk -
r24448:55c44934 default
parent child Browse files
Show More
@@ -611,7 +611,7 b' class dirstate(object):'
611 611 dirsnotfound = []
612 612 notfoundadd = dirsnotfound.append
613 613
614 if match.matchfn != match.exact and self._checkcase:
614 if not match.isexact() and self._checkcase:
615 615 normalize = self._normalize
616 616 else:
617 617 normalize = None
@@ -711,7 +711,7 b' class dirstate(object):'
711 711 join = self._join
712 712
713 713 exact = skipstep3 = False
714 if matchfn == match.exact: # match.exact
714 if match.isexact(): # match.exact
715 715 exact = True
716 716 dirignore = util.always # skip step 2
717 717 elif match.files() and not match.anypats(): # match.match, no patterns
@@ -912,7 +912,7 b' class dirstate(object):'
912 912 if match.always():
913 913 return dmap.keys()
914 914 files = match.files()
915 if match.matchfn == match.exact:
915 if match.isexact():
916 916 # fast path -- filter the other way around, since typically files is
917 917 # much smaller than dmap
918 918 return [f for f in files if f in dmap]
@@ -164,7 +164,7 b' class manifestdict(object):'
164 164 return self.copy()
165 165
166 166 files = match.files()
167 if (len(files) < 100 and (match.matchfn == match.exact or
167 if (len(files) < 100 and (match.isexact() or
168 168 (not match.anypats() and util.all(fn in self for fn in files)))):
169 169 return self.intersectfiles(files)
170 170
@@ -519,7 +519,7 b' class treemanifest(object):'
519 519 return self.copy()
520 520
521 521 files = match.files()
522 if (match.matchfn == match.exact or
522 if (match.isexact() or
523 523 (not match.anypats() and util.all(fn in self for fn in files))):
524 524 return self.intersectfiles(files)
525 525
@@ -171,6 +171,9 b' class match(object):'
171 171 - optimization might be possible and necessary.'''
172 172 return self._always
173 173
174 def isexact(self):
175 return self.matchfn == self.exact
176
174 177 def exact(root, cwd, files):
175 178 return match(root, cwd, files, exact=True)
176 179
General Comments 0
You need to be logged in to leave comments. Login now