Patchwork [3,of,4] manifestdict.walk: remove now-redundant check for match.files()

login
register
mail settings
Submitter Martin von Zweigbergk
Date April 9, 2015, 8:31 p.m.
Message ID <b2aa870b2de74190ba04.1428611514@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/8580/
State Accepted
Headers show

Comments

Martin von Zweigbergk - April 9, 2015, 8:31 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1428471625 25200
#      Tue Apr 07 22:40:25 2015 -0700
# Node ID b2aa870b2de74190ba04146c91faebbf693969ca
# Parent  a31f6340769584c6baddffb04b0408ced948d94f
manifestdict.walk: remove now-redundant check for match.files()

When checking whether we can take the fast path of iterating over
matcher files instead of manifest files, we check whether
match.files() is non-empty. However, now that return early for
match.always(), it can only be empty when there are only
include/exclude patterns, but in that case anypats() will be True, so
it's already covered. This makes manifestdict.walk() more similar to
manifestdict.matches().

Patch

diff -r a31f63407695 -r b2aa870b2de7 mercurial/manifest.py
--- a/mercurial/manifest.py	Tue Apr 07 21:08:23 2015 -0700
+++ b/mercurial/manifest.py	Tue Apr 07 22:40:25 2015 -0700
@@ -230,7 +230,7 @@ 
         fset = set(match.files())
 
         # avoid the entire walk if we're only looking for specific files
-        if fset and not match.anypats() and util.all(fn in self for fn in fset):
+        if not match.anypats() and util.all(fn in self for fn in fset):
             for fn in sorted(fset):
                 yield fn
             return