# HG changeset patch # User Yuya Nishihara # Date 2015-03-19 14:31:53 # Node ID 065b886f61c6255c0ae5f9e4b2ad3945d2d7973f # Parent 0e41f110e69efad849c1eb82a0a887106d21e853 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(). diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -1594,6 +1594,10 @@ class committablefilectx(basefilectx): 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):