[PATCH 5 of 8] committablectx: move status to workingctx

Sean Farley sean.michael.farley at gmail.com
Tue May 6 18:33:22 CDT 2014


# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1394580489 18000
#      Tue Mar 11 18:28:09 2014 -0500
# Node ID 2bb99e94978f9da3a6eb50bbddcbbfec28f399a1
# Parent  dae520d39627d8fd50668c590516baaae236d26b
committablectx: move status to workingctx

This method was accidentally placed into the committablectx class. It contains
logic for querying the dirstate so we move it to the correct class.

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -931,26 +931,10 @@ class committablectx(basectx):
 
     @propertycache
     def _date(self):
         return util.makedate()
 
-    def status(self, ignored=False, clean=False, unknown=False):
-        """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."""
-        stat = self._repo.status(ignored=ignored, clean=clean, unknown=unknown)
-        self._unknown = self._ignored = self._clean = None
-        if unknown:
-            self._unknown = stat[4]
-        if ignored:
-            self._ignored = stat[5]
-        if clean:
-            self._clean = stat[6]
-        self._status = stat[:4]
-        return stat
-
     def user(self):
         return self._user or self._repo.ui.username()
     def date(self):
         return self._date
     def description(self):
@@ -1229,10 +1213,26 @@ class workingctx(committablectx):
                     wlock.release()
             except error.LockError:
                 pass
         return modified, fixup
 
+    def status(self, ignored=False, clean=False, unknown=False):
+        """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."""
+        stat = self._repo.status(ignored=ignored, clean=clean, unknown=unknown)
+        self._unknown = self._ignored = self._clean = None
+        if unknown:
+            self._unknown = stat[4]
+        if ignored:
+            self._ignored = stat[5]
+        if clean:
+            self._clean = stat[6]
+        self._status = stat[:4]
+        return stat
+
 
 class committablefilectx(basefilectx):
     """A committablefilectx provides common functionality for a file context
     that wants the ability to commit, e.g. workingfilectx or memfilectx."""
     def __init__(self, repo, path, filelog=None, ctx=None):


More information about the Mercurial-devel mailing list