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

login
register
mail settings
Submitter David Schleimer
Date Feb. 10, 2013, 11:30 p.m.
Message ID <1bae6048dd1028bb6b75.1360539003@dev010.prn1.facebook.com>
Download mbox | patch
Permalink /patch/953/
State Changes Requested
Headers show

Comments

David Schleimer - Feb. 10, 2013, 11:30 p.m.
# HG changeset patch
# User David Schleimer <dschleimer@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
status.
Pierre-Yves David - Feb. 12, 2013, 1:51 p.m.
On Mon, Feb 11, 2013 at 03:28:20AM +0000, Kevin Bullock wrote:
> On 10 Feb 2013, at 11:30 PM, David Schleimer wrote:
> 
> > # HG changeset patch
> > # User David Schleimer <dschleimer@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
> > status.
> 
> "Filtered" and "unfiltered" are terms that are throwing me off in this context, because we use those terms for the repo and changelog already. Can we be more explicit about how we're describing the new function?
> 
I think it is about "matching" here. Stuff that -X and -I does

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -919,6 +919,11 @@ 
 
     @propertycache
     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]
 
     @propertycache