changeset 21595:aca692aa0712

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'.
author Sean Farley <sean.michael.farley@gmail.com>
date Tue, 27 May 2014 15:55:35 -0700
parents 9e4567829129
children 83bbfb23cb24
files mercurial/context.py
diffstat 1 files changed, 9 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Thu Apr 24 18:07:42 2014 -0500
+++ b/mercurial/context.py	Tue May 27 15:55:35 2014 -0700
@@ -1438,20 +1438,17 @@
             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."""