mercurial/context.py
changeset 19575 5a868137b830
parent 19574 a01436798988
child 19576 18bbd8a3abf3
equal deleted inserted replaced
19574:a01436798988 19575:5a868137b830
   430         elif '_changectx' in self.__dict__:
   430         elif '_changectx' in self.__dict__:
   431             return self._changectx.rev()
   431             return self._changectx.rev()
   432         else:
   432         else:
   433             return self._filelog.linkrev(self._filerev)
   433             return self._filelog.linkrev(self._filerev)
   434 
   434 
       
   435     @propertycache
       
   436     def _filenode(self):
       
   437         if '_fileid' in self.__dict__:
       
   438             return self._filelog.lookup(self._fileid)
       
   439         else:
       
   440             return self._changectx.filenode(self._path)
       
   441 
   435 class filectx(basefilectx):
   442 class filectx(basefilectx):
   436     """A filecontext object makes access to data related to a particular
   443     """A filecontext object makes access to data related to a particular
   437        filerevision convenient."""
   444        filerevision convenient."""
   438     def __init__(self, repo, path, changeid=None, fileid=None,
   445     def __init__(self, repo, path, changeid=None, fileid=None,
   439                  filelog=None, changectx=None):
   446                  filelog=None, changectx=None):
   478             #
   485             #
   479             # Linkrevs have several serious troubles with filtering that are
   486             # Linkrevs have several serious troubles with filtering that are
   480             # complicated to solve. Proper handling of the issue here should be
   487             # complicated to solve. Proper handling of the issue here should be
   481             # considered when solving linkrev issue are on the table.
   488             # considered when solving linkrev issue are on the table.
   482             return changectx(self._repo.unfiltered(), self._changeid)
   489             return changectx(self._repo.unfiltered(), self._changeid)
   483 
       
   484     @propertycache
       
   485     def _filenode(self):
       
   486         if '_fileid' in self.__dict__:
       
   487             return self._filelog.lookup(self._fileid)
       
   488         else:
       
   489             return self._changectx.filenode(self._path)
       
   490 
   490 
   491     @propertycache
   491     @propertycache
   492     def _filerev(self):
   492     def _filerev(self):
   493         return self._filelog.rev(self._filenode)
   493         return self._filelog.rev(self._filenode)
   494 
   494