context.walk: call with util.all() a generator, not a list
authorMartin von Zweigbergk <martinvonz@google.com>
Wed, 18 Mar 2015 09:26:26 -0700
changeset 24380 dd3bccb4b820
parent 24379 8c445d8a915b
child 24381 82b82168d045
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.
mercurial/context.py
--- a/mercurial/context.py	Tue Mar 17 14:52:58 2015 -0700
+++ b/mercurial/context.py	Wed Mar 18 09:26:26 2015 -0700
@@ -594,7 +594,7 @@
 
         # avoid the entire walk if we're only looking for specific files
         if fset and not match.anypats():
-            if util.all([fn in self for fn in fset]):
+            if util.all(fn in self for fn in fset):
                 for fn in sorted(fset):
                     if match(fn):
                         yield fn