comparison mercurial/context.py @ 23705:28a302e9225d

linkrev: also adjust linkrev when bootstrapping annotate (issue4305) The annotate logic now use the new 'introrev' method to bootstrap its traversal. This catches issues from linkrev-shadowing of the changeset introducing the version of a file in source changeset. More tests have been added to display pathological cases.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 24 Dec 2014 03:26:48 -0800
parents aaa76612b3c0
children 33e5431684c0
comparison
equal deleted inserted replaced
23704:c624fb2c4239 23705:28a302e9225d
875 p._filelog = getlog(p.path()) 875 p._filelog = getlog(p.path())
876 876
877 return pl 877 return pl
878 878
879 # use linkrev to find the first changeset where self appeared 879 # use linkrev to find the first changeset where self appeared
880 if self.rev() != self.linkrev(): 880 base = self
881 base = self.filectx(self.filenode()) 881 introrev = self.introrev()
882 else: 882 if self.rev() != introrev:
883 base = self 883 base = filectx(self._repo, self._path, filelog=self.filelog(),
884 fileid=self.filenode(), changeid=introrev)
884 885
885 # This algorithm would prefer to be recursive, but Python is a 886 # This algorithm would prefer to be recursive, but Python is a
886 # bit recursion-hostile. Instead we do an iterative 887 # bit recursion-hostile. Instead we do an iterative
887 # depth-first search. 888 # depth-first search.
888 889