[PATCH 04 of 12] basectx: preserve loading the cached manifest in _prestatus

Sean Farley sean.michael.farley at gmail.com
Mon May 19 15:32:11 CDT 2014


# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1398287183 18000
#      Wed Apr 23 16:06:23 2014 -0500
# Node ID fc8654d37dd78bc8f79554f06f0b3f141fc9d8b2
# Parent  3fd24754f34c5358e7cd9d1d8d72a59e6c9ae47b
basectx: preserve loading the cached manifest in _prestatus

This is just a copy from localrepo.status and is a small step to removing that
method entirely. The prestatus hook is only called for changectx's, thereby
ensuring that the same behavior is guaranteed.

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -91,10 +91,13 @@ class basectx(object):
         """provide a hook to allow child objects to preprocess status results
 
         For example, this allows other contexts, such as workingctx, to query
         the dirstate before comparing the manifests.
         """
+        # load earliest manifest first for caching reasons
+        if self.rev() < other.rev():
+            self.manifest()
         return s
 
     def _poststatus(self, other, s, match, listignored, listclean, listunknown):
         """provide a hook to allow child objects to postprocess status results
 


More information about the Mercurial-devel mailing list