changeset 38709:6a032a8f741b

context: reintroduce `ctx.descendant` as deprecated Reintroduce `ctx.descendant` to help extensions authors update their extensions in order to use the new API.
author Boris Feld <boris.feld@octobus.net>
date Mon, 16 Jul 2018 16:21:12 +0200
parents ff1182d166a2
children 4ac3c2078567
files mercurial/context.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Sun Jul 15 18:32:17 2018 +0900
+++ b/mercurial/context.py	Mon Jul 16 16:21:12 2018 +0200
@@ -589,6 +589,12 @@
                             short(n) for n in sorted(cahs) if n != anc))
         return changectx(self._repo, anc)
 
+    def descendant(self, other):
+        msg = (b'ctx.descendant(other) is deprecated, '
+               'use ctx.isancestorof(other)')
+        self._repo.ui.deprecwarn(msg, b'4.7')
+        return self.isancestorof(other)
+
     def isancestorof(self, other):
         """True if this changeset is an ancestor of other"""
         return self._repo.changelog.isancestorrev(self._rev, other._rev)