comparison mercurial/context.py @ 40046:50700a025953

context: reverse conditional branch order in introrev Positive logic will be simpler to follow. It will help to clarify coming refactoring.
author Boris Feld <boris.feld@octobus.net>
date Thu, 04 Oct 2018 01:22:25 +0200
parents 6ed53b194124
children a38a99c74ad4
comparison
equal deleted inserted replaced
40045:6ed53b194124 40046:50700a025953
775 revision is one of its ancestors. This prevents bugs from 775 revision is one of its ancestors. This prevents bugs from
776 'linkrev-shadowing' when a file revision is used by multiple 776 'linkrev-shadowing' when a file revision is used by multiple
777 changesets. 777 changesets.
778 """ 778 """
779 attrs = vars(self) 779 attrs = vars(self)
780 noctx = not (r'_changeid' in attrs or r'_changectx' in attrs) 780 hastoprev = (r'_changeid' in attrs or r'_changectx' in attrs)
781 if noctx: 781 if hastoprev:
782 return self._adjustlinkrev(self.rev(), inclusive=True)
783 else:
782 return self.linkrev() 784 return self.linkrev()
783 return self._adjustlinkrev(self.rev(), inclusive=True)
784 785
785 def introfilectx(self): 786 def introfilectx(self):
786 """Return filectx having identical contents, but pointing to the 787 """Return filectx having identical contents, but pointing to the
787 changeset revision where this filectx was introduced""" 788 changeset revision where this filectx was introduced"""
788 introrev = self.introrev() 789 introrev = self.introrev()