Mercurial > hg
comparison hgext/narrow/narrowbundle2.py @ 36209:2ad527f7d27a
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
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 13 Feb 2018 13:50:24 -0800 |
parents | c407ccd06abd |
children | f3b9377d6aea |
comparison
equal
deleted
inserted
replaced
36208:c407ccd06abd | 36209:2ad527f7d27a |
---|---|
150 p2mf = mfl[cl.changelogrevision(ps[1]).manifest].read() | 150 p2mf = mfl[cl.changelogrevision(ps[1]).manifest].read() |
151 needed = bool(curmf.diff(p2mf, match)) | 151 needed = bool(curmf.diff(p2mf, match)) |
152 else: | 152 else: |
153 # For a root node, we need to include the node if any | 153 # For a root node, we need to include the node if any |
154 # files in the node match the narrowspec. | 154 # files in the node match the narrowspec. |
155 needed = any(match(f) for f in curmf) | 155 needed = any(curmf.walk(match)) |
156 | 156 |
157 if needed: | 157 if needed: |
158 for head in ellipsisheads[rev]: | 158 for head in ellipsisheads[rev]: |
159 addroot(head, rev) | 159 addroot(head, rev) |
160 for p in ps: | 160 for p in ps: |