changeset 24420:065b886f61c6

committablefilectx: override linkrev() to point to the associated changectx This is necessary to annotate workingctx revision. basefilectx.linkrev() can't be used because committablefilectx has no filelog. committablefilectx looks for parents() from self._changectx. That means fctx is linked to self._changectx, so linkrev() can simply be aliased to rev().
author Yuya Nishihara <yuya@tcha.org>
date Thu, 19 Mar 2015 23:31:53 +0900
parents 0e41f110e69e
children 77881cade20e
files mercurial/context.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Sat Aug 16 13:44:16 2014 +0900
+++ b/mercurial/context.py	Thu Mar 19 23:31:53 2015 +0900
@@ -1594,6 +1594,10 @@
     def __nonzero__(self):
         return True
 
+    def linkrev(self):
+        # linked to self._changectx no matter if file is modified or not
+        return self.rev()
+
     def parents(self):
         '''return parent filectxs, following copies if necessary'''
         def filenode(ctx, path):