changeset 23983:ff070a53ee74 stable

filectx: if we have a _descendantrev, use it to adjust linkrev This lets us use _adjustlinkrev lazily.
author Matt Mackall <mpm@selenic.com>
date Sun, 01 Feb 2015 16:26:35 -0600
parents 751d1138ce35
children 2896f53509a7
files mercurial/context.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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)