changeset 29888:8a84347b9907

manifest: call m1.load and m2.load before writing a subtree As part of refactoring the manifest, certain test cases started failing because writesubtrees was called with p1 and p2 manifests that had not been loaded (so accessing m1._dirs resulted in an empty set). Let's call _load on these before attempting to access _dirs. This was caught by tests when future patches were applied.
author Durham Goode <durham@fb.com>
date Mon, 29 Aug 2016 17:48:14 -0700
parents 6d66200bff3b
children 6f447b9ec263
files mercurial/manifest.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/manifest.py	Tue Aug 30 13:13:50 2016 -0400
+++ b/mercurial/manifest.py	Mon Aug 29 17:48:14 2016 -0700
@@ -882,6 +882,8 @@
 
     def writesubtrees(self, m1, m2, writesubtree):
         self._load() # for consistency; should never have any effect here
+        m1._load()
+        m2._load()
         emptytree = treemanifest()
         for d, subm in self._dirs.iteritems():
             subp1 = m1._dirs.get(d, emptytree)._node