largefiles: avoid walking full manifest
When using treemanifest, diffs between two manifests can often be much
cheaper than iterating the full manifests (because common subtrees are
skipped).
Differential Revision: https://phab.mercurial-scm.org/D5644
--- a/hgext/largefiles/lfcommands.py Fri Jan 25 23:22:23 2019 -0800
+++ b/hgext/largefiles/lfcommands.py Mon Jan 21 23:08:31 2019 -0800
@@ -288,12 +288,9 @@
files = set(ctx.files())
if node.nullid not in parents:
mc = ctx.manifest()
- mp1 = ctx.p1().manifest()
- mp2 = ctx.p2().manifest()
- files |= (set(mp1) | set(mp2)) - set(mc)
- for f in mc:
- if mc[f] != mp1.get(f, None) or mc[f] != mp2.get(f, None):
- files.add(f)
+ for pctx in ctx.parents():
+ for fn in pctx.manifest().diff(mc):
+ files.add(fn)
return files
# Convert src parents to dst parents