# HG changeset patch # User Boris Feld # Date 2018-10-09 22:50:34 # Node ID aee94f0a36cd7ddf1ea1435e410bb4e4fa8b5ff9 # Parent f3f4d8537b11d5ba7c1b6323c784478741e46008 context: take advantage of `_descendantrev` in introrev if available Before this changeset, `_descendantrev` was ignored and `introrev` could return a "wrong" result. I was previously fine because there seems to be no existing code using both `introrev` and `_descendantrev` at the same time. However, we would like to change that. diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -780,6 +780,11 @@ class basefilectx(object): if toprev is not None: return self._adjustlinkrev(toprev, inclusive=True) + elif r'_descendantrev' in attrs: + introrev = self._adjustlinkrev(self._descendantrev) + # be nice and cache the result of the computation + self._changeid = introrev + return introrev else: return self.linkrev()