Mercurial > public > mercurial-scm > hg-stable
comparison 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 |
comparison
equal
deleted
inserted
replaced
38665:6afa928033bd | 38666:a06b2b032557 |
---|---|
1677 def isancestor(self, a, b): | 1677 def isancestor(self, a, b): |
1678 """return True if node a is an ancestor of node b | 1678 """return True if node a is an ancestor of node b |
1679 | 1679 |
1680 A revision is considered an ancestor of itself.""" | 1680 A revision is considered an ancestor of itself.""" |
1681 a, b = self.rev(a), self.rev(b) | 1681 a, b = self.rev(a), self.rev(b) |
1682 return self.isancestorrev(a, b) | |
1683 | |
1684 def isancestorrev(self, a, b): | |
1685 """return True if revision a is an ancestor of revision b | |
1686 | |
1687 A revision is considered an ancestor of itself.""" | |
1682 return self.isdescendantrev(b, a) | 1688 return self.isdescendantrev(b, a) |
1683 | 1689 |
1684 def ancestor(self, a, b): | 1690 def ancestor(self, a, b): |
1685 """calculate the "best" common ancestor of nodes a and b""" | 1691 """calculate the "best" common ancestor of nodes a and b""" |
1686 | 1692 |