mercurial/context.py
changeset 20292 8dc254198a8f
parent 20236 d0097d5818f9
child 20400 f0137d994c83
equal deleted inserted replaced
20291:7d589d923b8a 20292:8dc254198a8f
   408     def walk(self, match):
   408     def walk(self, match):
   409         fset = set(match.files())
   409         fset = set(match.files())
   410         # for dirstate.walk, files=['.'] means "walk the whole tree".
   410         # for dirstate.walk, files=['.'] means "walk the whole tree".
   411         # follow that here, too
   411         # follow that here, too
   412         fset.discard('.')
   412         fset.discard('.')
       
   413 
       
   414         # avoid the entire walk if we're only looking for specific files
       
   415         if fset and not match.anypats():
       
   416             if util.all([fn in self for fn in fset]):
       
   417                 for fn in sorted(fset):
       
   418                     if match(fn):
       
   419                         yield fn
       
   420                 raise StopIteration
       
   421 
   413         for fn in self:
   422         for fn in self:
   414             if fn in fset:
   423             if fn in fset:
   415                 # specified pattern is the exact name
   424                 # specified pattern is the exact name
   416                 fset.remove(fn)
   425                 fset.remove(fn)
   417             if match(fn):
   426             if match(fn):