Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/context.py @ 23983:ff070a53ee74 stable
filectx: if we have a _descendantrev, use it to adjust linkrev
This lets us use _adjustlinkrev lazily.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 01 Feb 2015 16:26:35 -0600 |
parents | 24b57c3899f8 |
children | 2896f53509a7 |
comparison
equal
deleted
inserted
replaced
23982:751d1138ce35 | 23983:ff070a53ee74 |
---|---|
631 def _changeid(self): | 631 def _changeid(self): |
632 if '_changeid' in self.__dict__: | 632 if '_changeid' in self.__dict__: |
633 return self._changeid | 633 return self._changeid |
634 elif '_changectx' in self.__dict__: | 634 elif '_changectx' in self.__dict__: |
635 return self._changectx.rev() | 635 return self._changectx.rev() |
636 elif '_descendantrev' in self.__dict__: | |
637 # this file context was created from a revision with a known | |
638 # descendant, we can (lazily) correct for linkrev aliases | |
639 return self._adjustlinkrev(self._path, self._filelog, | |
640 self._filenode, self._descendantrev) | |
636 else: | 641 else: |
637 return self._filelog.linkrev(self._filerev) | 642 return self._filelog.linkrev(self._filerev) |
638 | 643 |
639 @propertycache | 644 @propertycache |
640 def _filenode(self): | 645 def _filenode(self): |