762 |
762 |
763 def isintroducedafter(self, changelogrev): |
763 def isintroducedafter(self, changelogrev): |
764 """True if a filectx has been introduced after a given floor revision |
764 """True if a filectx has been introduced after a given floor revision |
765 """ |
765 """ |
766 return (self.linkrev() >= changelogrev |
766 return (self.linkrev() >= changelogrev |
767 or self.introrev() >= changelogrev) |
767 or self._introrev() >= changelogrev) |
768 |
768 |
769 def introrev(self): |
769 def introrev(self): |
770 """return the rev of the changeset which introduced this file revision |
770 """return the rev of the changeset which introduced this file revision |
771 |
771 |
772 This method is different from linkrev because it take into account the |
772 This method is different from linkrev because it take into account the |
773 changeset the filectx was created from. It ensures the returned |
773 changeset the filectx was created from. It ensures the returned |
774 revision is one of its ancestors. This prevents bugs from |
774 revision is one of its ancestors. This prevents bugs from |
775 'linkrev-shadowing' when a file revision is used by multiple |
775 'linkrev-shadowing' when a file revision is used by multiple |
776 changesets. |
776 changesets. |
777 """ |
777 """ |
|
778 return self._introrev() |
|
779 |
|
780 def _introrev(self): |
778 toprev = None |
781 toprev = None |
779 attrs = vars(self) |
782 attrs = vars(self) |
780 if r'_changeid' in attrs: |
783 if r'_changeid' in attrs: |
781 # We have a cached value already |
784 # We have a cached value already |
782 toprev = self._changeid |
785 toprev = self._changeid |