# HG changeset patch # User Brendan Cully # Date 1159572369 25200 # Node ID 0790dce2f3a85442cc7c5b29afc10a871f5b95f7 # Parent 79fd7a92f3e2cca90d506c91064225df746d8331 Add lookup method to filectx diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -130,6 +130,12 @@ class filectx(object): def __repr__(self): return "" % (self.path(), short(self.node())) + def filectx(self, fileid): + '''opens an arbitrary revision of the file without + opening a new filelog''' + return filectx(self._repo, self._path, fileid=fileid, + filelog=self._filelog) + def filerev(self): return self._filerev def filenode(self): return self._filenode def filelog(self): return self._filelog