[PATCH 14 of 19] context: support matches in workingctx.status

David Schleimer dschleimer at fb.com
Sun Feb 10 17:30:04 CST 2013

# HG changeset patch
# User David Schleimer <dschleimer at fb.com>
# Date 1360424562 28800
# Node ID 730f81cd4b340348dfc5d2eb571f3b13e01c73e4
# Parent  1bae6048dd1028bb6b7506ec1ecb73bd819e7449
context: support matches in workingctx.status

This makes it possible to get a filtered view of the workingcopy via
workingctx.status().  This is currently unused, but subsequent patches
will use this to pull validation steps out of localrepo.commit and
into the workingctx.  This in turn will make it practical to unify
workingctx and memctx, making memctx more useful.

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -941,12 +941,15 @@
             p = p[:-1]
         return [changectx(self._repo, x) for x in p]
-    def status(self, ignored=False, clean=False, unknown=False):
+    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
-        stat = self._repo.status(ignored=ignored, clean=clean, unknown=unknown)
+        stat = self._repo.status(ignored=ignored,
+                                 clean=clean,
+                                 unknown=unknown,
+                                 match=match)
         self._unknown = self._ignored = self._clean = None
         if unknown:
             self._unknown = stat[4]

More information about the Mercurial-devel mailing list