# HG changeset patch # User Sean Farley # Date 2013-08-12 03:44:19 # Node ID 5a868137b83032daf8f3affac4f44d35e243cfa8 # Parent a014367989887106e7bc3d31ee3ab4806ebaeb08 basefilectx: move _filenode from filectx diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -432,6 +432,13 @@ class basefilectx(object): else: return self._filelog.linkrev(self._filerev) + @propertycache + def _filenode(self): + if '_fileid' in self.__dict__: + return self._filelog.lookup(self._fileid) + else: + return self._changectx.filenode(self._path) + class filectx(basefilectx): """A filecontext object makes access to data related to a particular filerevision convenient.""" @@ -482,13 +489,6 @@ class filectx(basefilectx): return changectx(self._repo.unfiltered(), self._changeid) @propertycache - def _filenode(self): - if '_fileid' in self.__dict__: - return self._filelog.lookup(self._fileid) - else: - return self._changectx.filenode(self._path) - - @propertycache def _filerev(self): return self._filelog.rev(self._filenode)