--- a/mercurial/context.py Sun Aug 11 23:05:08 2013 -0500
+++ b/mercurial/context.py Sun Aug 11 23:05:50 2013 -0500
@@ -710,6 +710,18 @@
return None
+ def ancestors(self, followfirst=False):
+ visit = {}
+ c = self
+ cut = followfirst and 1 or None
+ while True:
+ for parent in c.parents()[:cut]:
+ visit[(parent.rev(), parent.node())] = parent
+ if not visit:
+ break
+ c = visit.pop(max(visit))
+ yield c
+
class filectx(basefilectx):
"""A filecontext object makes access to data related to a particular
filerevision convenient."""
@@ -801,18 +813,6 @@
return [filectx(self._repo, self._path, fileid=x,
filelog=self._filelog) for x in c]
- def ancestors(self, followfirst=False):
- visit = {}
- c = self
- cut = followfirst and 1 or None
- while True:
- for parent in c.parents()[:cut]:
- visit[(parent.rev(), parent.node())] = parent
- if not visit:
- break
- c = visit.pop(max(visit))
- yield c
-
def copies(self, c2):
if not util.safehasattr(self, "_copycache"):
self._copycache = {}