revlog: do inclusive descendant testing (API)
authorBoris Feld <boris.feld@octobus.net>
Thu, 21 Jun 2018 23:53:43 +0100
changeset 38511 879cbdde63df
parent 38510 561a450c7b64
child 38512 99f864b34451
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.
mercurial/revlog.py
--- 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