[PATCH 1 of 2] workingctx: add explicit status method, add ignored and fix clean

steve at borho.org steve at borho.org
Tue May 4 15:25:03 CDT 2010


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1273002745 18000
# Node ID 9239ffe508f4b75e56808cd4021c751b57c0ede7
# Parent  3ec4c544291087d01d2323436af70f10df37b0bd
workingctx: add explicit status method, add ignored and fix clean

workingctx.clean() and memctx.clean() have both been returning ignored files
since their creation.  This patch fixes clean() while introducing a method for
querying ignored files.  The new status() method can be used to explicitly
override the default (fast) arguments used by the _status property.

diff -r 3ec4c5442910 -r 9239ffe508f4 mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -634,6 +634,15 @@
         self._parents = [changectx(self._repo, x) for x in p]
         return self._parents
 
+    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."""
+        self._status = self._repo.status(ignored=ignored, clean=clean,
+                                         unknown=unknown)
+        return self._status
+
     def manifest(self):
         return self._manifest
     def user(self):
@@ -655,8 +664,10 @@
         return self._status[3]
     def unknown(self):
         return self._status[4]
+    def ignored(self):
+        return self._status[5]
     def clean(self):
-        return self._status[5]
+        return self._status[6]
     def branch(self):
         return self._extra['branch']
     def extra(self):
@@ -870,8 +881,10 @@
         return self._status[3]
     def unknown(self):
         return self._status[4]
+    def ignored(self):
+        return self._status[5]
     def clean(self):
-        return self._status[5]
+        return self._status[6]
     def branch(self):
         return self._extra['branch']
     def extra(self):


More information about the Mercurial-devel mailing list