comparison mercurial/context.py @ 24380:dd3bccb4b820

context.walk: call with util.all() a generator, not a list The file set can be large, so avoid going through the entire file set when a file happens not to be in the context.
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 18 Mar 2015 09:26:26 -0700
parents 5da0eb641881
children 82b82168d045
comparison
equal deleted inserted replaced
24379:8c445d8a915b 24380:dd3bccb4b820
592 # follow that here, too 592 # follow that here, too
593 fset.discard('.') 593 fset.discard('.')
594 594
595 # avoid the entire walk if we're only looking for specific files 595 # avoid the entire walk if we're only looking for specific files
596 if fset and not match.anypats(): 596 if fset and not match.anypats():
597 if util.all([fn in self for fn in fset]): 597 if util.all(fn in self for fn in fset):
598 for fn in sorted(fset): 598 for fn in sorted(fset):
599 if match(fn): 599 if match(fn):
600 yield fn 600 yield fn
601 raise StopIteration 601 raise StopIteration
602 602