changeset 31260:aac054e5389b

context: remove assumptions about manifest creation during _buildstatus Previously we called self.manifest() in some cases to preload the first manifest. This relied on the assumption that the later _manifestmatches() call did not duplicate any work the original self.manifest() call did. Let's remove that assumption, since it bit me during my refactors of this area and is easy to remove.
author Durham Goode <durham@fb.com>
date Tue, 07 Mar 2017 17:49:50 -0800
parents 6a9d0d24fdb4
children bd884ef2ee46
files mercurial/context.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Tue Mar 07 17:56:30 2017 -0800
+++ b/mercurial/context.py	Tue Mar 07 17:49:50 2017 -0800
@@ -117,10 +117,12 @@
         # 1000 and cache it so that when you read 1001, we just need to apply a
         # delta to what's in the cache. So that's one full reconstruction + one
         # delta application.
+        mf2 = None
         if self.rev() is not None and self.rev() < other.rev():
-            self.manifest()
+            mf2 = self._manifestmatches(match, s)
         mf1 = other._manifestmatches(match, s)
-        mf2 = self._manifestmatches(match, s)
+        if mf2 is None:
+            mf2 = self._manifestmatches(match, s)
 
         modified, added = [], []
         removed = []