[PATCH 40 of 48 RFC] commitablectx: move walk from workingctx

Sean Farley sean.michael.farley at gmail.com
Thu Sep 5 15:07:34 CDT 2013


# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1376516231 18000
#      Wed Aug 14 16:37:11 2013 -0500
# Node ID ba605dc891b76aba6b94fa877ddf5075b438f0fe
# Parent  7274902311f15774b62a035f498ccf296062d306
commitablectx: move walk from workingctx

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1032,10 +1032,14 @@
 
     def ancestor(self, c2):
         """return the ancestor context of self and c2"""
         return self._parents[0].ancestor(c2) # punt on two parents for now
 
+    def walk(self, match):
+        return sorted(self._repo.dirstate.walk(match, sorted(self.substate),
+                                               True, False))
+
 class workingctx(commitablectx):
     """A workingctx object makes access to data related to
     the current working directory convenient.
     date - any valid date string or (unixtime, offset), or None.
     user - username string, or None.
@@ -1063,14 +1067,10 @@
     def filectx(self, path, filelog=None):
         """get a file context from the working directory"""
         return workingfilectx(self._repo, path, workingctx=self,
                               filelog=filelog)
 
-    def walk(self, match):
-        return sorted(self._repo.dirstate.walk(match, sorted(self.substate),
-                                               True, False))
-
     def dirty(self, missing=False, merge=True, branch=True):
         "check whether a working directory is modified"
         # check subrepos first
         for s in sorted(self.substate):
             if self.sub(s).dirty():


More information about the Mercurial-devel mailing list