narrow: restrict manifest iteration by using manifest.walk(matcher)
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 13 Feb 2018 13:50:24 -0800
changeset 36209 2ad527f7d27a
parent 36208 c407ccd06abd
child 36210 5c9bdfb32eac
narrow: restrict manifest iteration by using manifest.walk(matcher) This is only for root nodes, so it shouldn't really matter (they're rarely huge), but seems cleaner. Differential Revision: https://phab.mercurial-scm.org/D2234
hgext/narrow/narrowbundle2.py
--- a/hgext/narrow/narrowbundle2.py	Tue Feb 13 13:16:06 2018 -0800
+++ b/hgext/narrow/narrowbundle2.py	Tue Feb 13 13:50:24 2018 -0800
@@ -152,7 +152,7 @@
             else:
                 # For a root node, we need to include the node if any
                 # files in the node match the narrowspec.
-                needed = any(match(f) for f in curmf)
+                needed = any(curmf.walk(match))
 
         if needed:
             for head in ellipsisheads[rev]: