largefiles: avoid walking full manifest
authorMartin von Zweigbergk <martinvonz@google.com>
Mon, 21 Jan 2019 23:08:31 -0800
changeset 41400 4a409c19831f
parent 41399 5cb8158a61f7
child 41401 4a33a6bf2b52
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
hgext/largefiles/lfcommands.py
--- 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