changeset 38511:879cbdde63df

revlog: do inclusive descendant testing (API) In many other places, a revision is considered a descendant of itself. We update the behavior of `revlog.descendant()` to match this. (for example. `revlog.isancestor` does inclusive testing). No tests break, so it seems safe to do so. This will make it easier to use a more efficient implementation in a later changeset.
author Boris Feld <boris.feld@octobus.net>
date Thu, 21 Jun 2018 23:53:43 +0100
parents 561a450c7b64
children 99f864b34451
files mercurial/revlog.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlog.py	Sat Jun 30 16:06:05 2018 -0700
+++ b/mercurial/revlog.py	Thu Jun 21 23:53:43 2018 +0100
@@ -1378,6 +1378,8 @@
     def descendant(self, start, end):
         if start == nullrev:
             return True
+        elif start == end:
+            return True
         for i in self.descendants([start]):
             if i == end:
                 return True