changeset 41400:4a409c19831f

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
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 21 Jan 2019 23:08:31 -0800
parents 5cb8158a61f7
children 4a33a6bf2b52
files hgext/largefiles/lfcommands.py
diffstat 1 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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