context: walk both parents for workingctx.ancestors() stable
authorMatt Mackall <mpm@selenic.com>
Mon, 15 Nov 2010 17:00:43 -0600
branchstable
changeset 12999 acd69df118ab
parent 12989 827aa0992cea
child 13000 417f3c27983b
context: walk both parents for workingctx.ancestors()
mercurial/context.py
--- a/mercurial/context.py	Mon Nov 15 10:55:54 2010 -0600
+++ b/mercurial/context.py	Mon Nov 15 17:00:43 2010 -0600
@@ -818,6 +818,11 @@
         finally:
             wlock.release()
 
+    def ancestors(self):
+        for a in self._repo.changelog.ancestors(
+            *[p.rev() for p in self._parents]):
+            yield changectx(self._repo, a)
+
     def remove(self, list, unlink=False):
         if unlink:
             for f in list: