[PATCH 13 of 19] context: separateworkingctx stats and raw status

David Schleimer dschleimer at fb.com
Sun Feb 10 17:30:03 CST 2013

# HG changeset patch
# User David Schleimer <dschleimer at fb.com>
# Date 1360413190 28800
# Node ID 1bae6048dd1028bb6b7506ec1ecb73bd819e7449
# Parent  cb00b77bc8e24c68b5b4df5e484f7c005f12d2d1
context: separateworkingctx stats and raw status

Split the workingctx _status property cache into _status, which is
possibly filtered, and _rawstatus which is never filtered.  By
default, _status proxies to _rawstatus, and then replaces itself with
the results.  Calling status() will update the _status property.
Subsequent changes will change status() to sometimes result in
filtered changes getting written to _status.  the point of this change
is to make sure the workingctx will have access to the unfiltered

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -919,6 +919,11 @@
     def _status(self):
+        '''A (possibly) filtered view of the status this context represents'''
+        return self._rawstatus()
+    def _rawstatus(self):
+        '''an unfiltered view of the status the context represents'''
         return self._repo.status()[:4]

More information about the Mercurial-devel mailing list