From patchwork Thu Sep 5 20:07:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [40,of,48,RFC] commitablectx: move walk from workingctx From: Sean Farley X-Patchwork-Id: 2378 Message-Id: To: mercurial-devel@selenic.com Date: Thu, 05 Sep 2013 15:07:34 -0500 # HG changeset patch # User Sean Farley # 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():