Mercurial > hg
changeset 3150:a5e4c8172ace
filectx: lazy linkrev usage
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 22 Sep 2006 16:01:14 -0500 |
parents | ff1ab08e6732 |
children | 6719b3dd7d50 |
files | mercurial/context.py |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/context.py Fri Sep 22 15:34:02 2006 -0500 +++ b/mercurial/context.py Fri Sep 22 16:01:14 2006 -0500 @@ -124,7 +124,11 @@ def filenode(self): return self._filenode def filelog(self): return self._filelog - def rev(self): return self._changectx.rev() + def rev(self): + if hasattr(self, "_changectx"): + return self._changectx.rev() + return self._filelog.linkrev(self._filenode) + def node(self): return self._changectx.node() def user(self): return self._changectx.user() def date(self): return self._changectx.date()