# HG changeset patch # User Sean Farley # Date 2014-05-27 22:55:35 # Node ID aca692aa0712c483a79e7bc548c4d9c1d2a3870a # Parent 9e4567829129e2e8e97a8f4b7fcd47ea0572380f workingctx: have status method call super instead of customized code. The old code is unneeded now that basectx has the ability to calculate the status between two context objects. Now, we use the objected oriented pattern called 'super'. diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -1438,20 +1438,17 @@ class workingctx(committablectx): match.bad = bad return match - def status(self, ignored=False, clean=False, unknown=False, match=None): - """Explicit status query - Unless this method is used to query the working copy status, the - _status property will implicitly read the status using its default - arguments.""" - listignored, listclean, listunknown = ignored, clean, unknown - s = self._dirstatestatus(match=match, ignored=listignored, - clean=listclean, unknown=listunknown) - - s[0] = self._filtersuspectsymlink(s[0]) - self._status = s + def status(self, other='.', match=None, listignored=False, + listclean=False, listunknown=False, listsubrepos=False): + # yet to be determined: what to do if 'other' is a 'workingctx' or a + # 'memctx'? + s = super(workingctx, self).status(other, match, listignored, listclean, + listunknown, listsubrepos) + # calling 'super' subtly reveresed the contexts, so we flip the results + # (s[1] is 'added' and s[2] is 'removed') + s[1], s[2] = s[2], s[1] return s - class committablefilectx(basefilectx): """A committablefilectx provides common functionality for a file context that wants the ability to commit, e.g. workingfilectx or memfilectx."""