context: remove assumptions about manifest creation during _buildstatus
authorDurham Goode <durham@fb.com>
Tue, 07 Mar 2017 17:49:50 -0800
changeset 31260 aac054e5389b
parent 31259 6a9d0d24fdb4
child 31261 bd884ef2ee46
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.
mercurial/context.py
--- 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 = []