Mercurial > public > mercurial-scm > hg
comparison mercurial/revlog.py @ 38665:6afa928033bd
revlog: make isdescendantrev(a, b) check if a < b
This check was taken from rebase.py. It seems to make sense to move it
here, but I haven't done any measurements.
Differential Revision: https://phab.mercurial-scm.org/D3930
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 11 Jul 2018 16:37:30 -0700 |
parents | 160da69ba1bf |
children | a06b2b032557 |
comparison
equal
deleted
inserted
replaced
38664:160da69ba1bf | 38665:6afa928033bd |
---|---|
1654 commonancestorsheads is not.""" | 1654 commonancestorsheads is not.""" |
1655 if b == nullrev: | 1655 if b == nullrev: |
1656 return True | 1656 return True |
1657 elif a == b: | 1657 elif a == b: |
1658 return True | 1658 return True |
1659 elif a < b: | |
1660 return False | |
1659 return b in self._commonancestorsheads(a, b) | 1661 return b in self._commonancestorsheads(a, b) |
1660 | 1662 |
1661 def commonancestorsheads(self, a, b): | 1663 def commonancestorsheads(self, a, b): |
1662 """calculate all the heads of the common ancestors of nodes a and b""" | 1664 """calculate all the heads of the common ancestors of nodes a and b""" |
1663 a, b = self.rev(a), self.rev(b) | 1665 a, b = self.rev(a), self.rev(b) |