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

login
register
mail settings
Submitter Sean Farley
Date Sept. 5, 2013, 8:07 p.m.
Message ID <ba605dc891b76aba6b94.1378411654@laptop.local>
Download mbox | patch
Permalink /patch/2378/
State Accepted
Commit 8c95e74857c62839527fab89985d7ad602eaa464
Headers show

Comments

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

Patch

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():