diff mercurial/revlog.py @ 38666:a06b2b032557

revlog: introduce a isancestorrev() and use it in rebase Differential Revision: https://phab.mercurial-scm.org/D3931
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 11 Jul 2018 16:29:23 -0700
parents 6afa928033bd
children 21846c94e605
line wrap: on
line diff
--- a/mercurial/revlog.py	Wed Jul 11 16:37:30 2018 -0700
+++ b/mercurial/revlog.py	Wed Jul 11 16:29:23 2018 -0700
@@ -1679,6 +1679,12 @@
 
         A revision is considered an ancestor of itself."""
         a, b = self.rev(a), self.rev(b)
+        return self.isancestorrev(a, b)
+
+    def isancestorrev(self, a, b):
+        """return True if revision a is an ancestor of revision b
+
+        A revision is considered an ancestor of itself."""
         return self.isdescendantrev(b, a)
 
     def ancestor(self, a, b):