Mercurial > hg
comparison mercurial/context.py @ 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 | 1cfded2fa1a9 |
children | 2f8f7cc6a53b |
comparison
equal
deleted
inserted
replaced
24419:0e41f110e69e | 24420:065b886f61c6 |
---|---|
1592 self._changectx = ctx | 1592 self._changectx = ctx |
1593 | 1593 |
1594 def __nonzero__(self): | 1594 def __nonzero__(self): |
1595 return True | 1595 return True |
1596 | 1596 |
1597 def linkrev(self): | |
1598 # linked to self._changectx no matter if file is modified or not | |
1599 return self.rev() | |
1600 | |
1597 def parents(self): | 1601 def parents(self): |
1598 '''return parent filectxs, following copies if necessary''' | 1602 '''return parent filectxs, following copies if necessary''' |
1599 def filenode(ctx, path): | 1603 def filenode(ctx, path): |
1600 return ctx._manifest.get(path, nullid) | 1604 return ctx._manifest.get(path, nullid) |
1601 | 1605 |