comparison mercurial/context.py @ 39078:48157f198a04

context: drop compatibility for `context.descendant` (API) As advertised, the method is dropped in 4.8.
author Boris Feld <boris.feld@octobus.net>
date Tue, 14 Aug 2018 13:36:11 -0700
parents 2488dcfa71f8
children 95bd19f60957
comparison
equal deleted inserted replaced
39077:b5040a9cb84c 39078:48157f198a04
590 (short(anc), short(self._node), short(n2))) + 590 (short(anc), short(self._node), short(n2))) +
591 ''.join(_(" alternatively, use --config " 591 ''.join(_(" alternatively, use --config "
592 "merge.preferancestor=%s\n") % 592 "merge.preferancestor=%s\n") %
593 short(n) for n in sorted(cahs) if n != anc)) 593 short(n) for n in sorted(cahs) if n != anc))
594 return changectx(self._repo, anc) 594 return changectx(self._repo, anc)
595
596 def descendant(self, other):
597 msg = (b'ctx.descendant(other) is deprecated, '
598 b'use ctx.isancestorof(other)')
599 self._repo.ui.deprecwarn(msg, b'4.7')
600 return self.isancestorof(other)
601 595
602 def isancestorof(self, other): 596 def isancestorof(self, other):
603 """True if this changeset is an ancestor of other""" 597 """True if this changeset is an ancestor of other"""
604 return self._repo.changelog.isancestorrev(self._rev, other._rev) 598 return self._repo.changelog.isancestorrev(self._rev, other._rev)
605 599