Mercurial > public > mercurial-scm > hg
comparison mercurial/context.py @ 19576:18bbd8a3abf3
basefilectx: move _filerev from filectx
author | Sean Farley <sean.michael.farley@gmail.com> |
---|---|
date | Sun, 11 Aug 2013 22:44:36 -0500 |
parents | 5a868137b830 |
children | b52d572a2177 |
comparison
equal
deleted
inserted
replaced
19575:5a868137b830 | 19576:18bbd8a3abf3 |
---|---|
437 if '_fileid' in self.__dict__: | 437 if '_fileid' in self.__dict__: |
438 return self._filelog.lookup(self._fileid) | 438 return self._filelog.lookup(self._fileid) |
439 else: | 439 else: |
440 return self._changectx.filenode(self._path) | 440 return self._changectx.filenode(self._path) |
441 | 441 |
442 @propertycache | |
443 def _filerev(self): | |
444 return self._filelog.rev(self._filenode) | |
445 | |
442 class filectx(basefilectx): | 446 class filectx(basefilectx): |
443 """A filecontext object makes access to data related to a particular | 447 """A filecontext object makes access to data related to a particular |
444 filerevision convenient.""" | 448 filerevision convenient.""" |
445 def __init__(self, repo, path, changeid=None, fileid=None, | 449 def __init__(self, repo, path, changeid=None, fileid=None, |
446 filelog=None, changectx=None): | 450 filelog=None, changectx=None): |
485 # | 489 # |
486 # Linkrevs have several serious troubles with filtering that are | 490 # Linkrevs have several serious troubles with filtering that are |
487 # complicated to solve. Proper handling of the issue here should be | 491 # complicated to solve. Proper handling of the issue here should be |
488 # considered when solving linkrev issue are on the table. | 492 # considered when solving linkrev issue are on the table. |
489 return changectx(self._repo.unfiltered(), self._changeid) | 493 return changectx(self._repo.unfiltered(), self._changeid) |
490 | |
491 @propertycache | |
492 def _filerev(self): | |
493 return self._filelog.rev(self._filenode) | |
494 | 494 |
495 @propertycache | 495 @propertycache |
496 def _repopath(self): | 496 def _repopath(self): |
497 return self._path | 497 return self._path |
498 | 498 |