mercurial/revlog.py
changeset 22381 392ae5cb8d62
parent 22282 4092d12ba18a
child 22389 94f77624dbb5
--- a/mercurial/revlog.py	Tue Sep 09 17:16:24 2014 -0400
+++ b/mercurial/revlog.py	Tue Aug 19 01:13:10 2014 +0200
@@ -745,6 +745,13 @@
             ancs = ancestor.commonancestorsheads(self.parentrevs, a, b)
         return map(self.node, ancs)
 
+    def isancestor(self, a, b):
+        """return True if node a is an ancestor of node b
+
+        The implementation of this is trivial but the use of
+        commonancestorsheads is not."""
+        return a in self.commonancestorsheads(a, b)
+
     def ancestor(self, a, b):
         """calculate the least common ancestor of nodes a and b"""