D4845: treemanifests: remove _loadalllazy in _diff()

spectral (Kyle Lippincott) phabricator at mercurial-scm.org
Tue Oct 2 19:12:51 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG731961d972ba: treemanifests: remove _loadalllazy in _diff() (authored by spectral, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4845?vs=11582&id=11586

REVISION DETAIL
  https://phab.mercurial-scm.org/D4845

AFFECTED FILES
  mercurial/manifest.py

CHANGE DETAILS

diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -1114,9 +1114,19 @@
                 return
             t1._load()
             t2._load()
-            # OPT: do we need to load everything?
-            t1._loadalllazy()
-            t2._loadalllazy()
+            toloadlazy = []
+            for d, v1 in t1._lazydirs.iteritems():
+                v2 = t2._lazydirs.get(d)
+                if not v2 or v2[1] != v1[1]:
+                    toloadlazy.append(d)
+            for d, v1 in t2._lazydirs.iteritems():
+                if d not in t1._lazydirs:
+                    toloadlazy.append(d)
+
+            for d in toloadlazy:
+                t1._loadlazy(d)
+                t2._loadlazy(d)
+
             for d, m1 in t1._dirs.iteritems():
                 m2 = t2._dirs.get(d, emptytree)
                 _diff(m1, m2)



To: spectral, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list