[PATCH 39 of 48 RFC] commitablectx: move ancestor from workingctx
Sean Farley
sean.michael.farley at gmail.com
Thu Sep 5 15:07:33 CDT 2013
# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1376516221 18000
# Wed Aug 14 16:37:01 2013 -0500
# Node ID 7274902311f15774b62a035f498ccf296062d306
# Parent 71c828371ffd75b706a037f860ed82ae5d67d1c0
commitablectx: move ancestor from workingctx
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1028,10 +1028,14 @@
try:
return self._flagfunc(path)
except OSError:
return ''
+ def ancestor(self, c2):
+ """return the ancestor context of self and c2"""
+ return self._parents[0].ancestor(c2) # punt on two parents for now
+
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.
@@ -1059,14 +1063,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 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))
def dirty(self, missing=False, merge=True, branch=True):
More information about the Mercurial-devel
mailing list