comparison mercurial/context.py @ 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 fbec9c0b32d3
children 71d6886d27cf
comparison
equal deleted inserted replaced
38708:ff1182d166a2 38709:6a032a8f741b
586 (short(anc), short(self._node), short(n2))) + 586 (short(anc), short(self._node), short(n2))) +
587 ''.join(_(" alternatively, use --config " 587 ''.join(_(" alternatively, use --config "
588 "merge.preferancestor=%s\n") % 588 "merge.preferancestor=%s\n") %
589 short(n) for n in sorted(cahs) if n != anc)) 589 short(n) for n in sorted(cahs) if n != anc))
590 return changectx(self._repo, anc) 590 return changectx(self._repo, anc)
591
592 def descendant(self, other):
593 msg = (b'ctx.descendant(other) is deprecated, '
594 'use ctx.isancestorof(other)')
595 self._repo.ui.deprecwarn(msg, b'4.7')
596 return self.isancestorof(other)
591 597
592 def isancestorof(self, other): 598 def isancestorof(self, other):
593 """True if this changeset is an ancestor of other""" 599 """True if this changeset is an ancestor of other"""
594 return self._repo.changelog.isancestorrev(self._rev, other._rev) 600 return self._repo.changelog.isancestorrev(self._rev, other._rev)
595 601