filectx: if we have a _descendantrev, use it to adjust linkrev stable
authorMatt Mackall <mpm@selenic.com>
Sun, 01 Feb 2015 16:26:35 -0600
branchstable
changeset 23983 ff070a53ee74
parent 23982 751d1138ce35
child 23984 2896f53509a7
filectx: if we have a _descendantrev, use it to adjust linkrev This lets us use _adjustlinkrev lazily.
mercurial/context.py
--- a/mercurial/context.py	Sun Feb 01 16:25:12 2015 -0600
+++ b/mercurial/context.py	Sun Feb 01 16:26:35 2015 -0600
@@ -633,6 +633,11 @@
             return self._changeid
         elif '_changectx' in self.__dict__:
             return self._changectx.rev()
+        elif '_descendantrev' in self.__dict__:
+            # this file context was created from a revision with a known
+            # descendant, we can (lazily) correct for linkrev aliases
+            return self._adjustlinkrev(self._path, self._filelog,
+                                       self._filenode, self._descendantrev)
         else:
             return self._filelog.linkrev(self._filerev)