Mercurial > public > mercurial-scm > hg
comparison mercurial/context.py @ 44108:c472970339d2
changectx: use unfiltered changelog to walk ancestors in annotate
Since we are only walking ancestors, it is safe to use an unfiltered repository.
(Because if the original rev is not filtered, none of its ancestors will be).
Differential Revision: https://phab.mercurial-scm.org/D7501
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 21 Nov 2019 23:46:51 +0100 |
parents | 85c4cd73996b |
children | 98349eddceef |
comparison
equal
deleted
inserted
replaced
44107:5a012404503b | 44108:c472970339d2 |
---|---|
1159 return pl | 1159 return pl |
1160 | 1160 |
1161 # use linkrev to find the first changeset where self appeared | 1161 # use linkrev to find the first changeset where self appeared |
1162 base = self.introfilectx() | 1162 base = self.introfilectx() |
1163 if getattr(base, '_ancestrycontext', None) is None: | 1163 if getattr(base, '_ancestrycontext', None) is None: |
1164 cl = self._repo.changelog | 1164 # it is safe to use an unfiltered repository here because we are |
1165 # walking ancestors only. | |
1166 cl = self._repo.unfiltered().changelog | |
1165 if base.rev() is None: | 1167 if base.rev() is None: |
1166 # wctx is not inclusive, but works because _ancestrycontext | 1168 # wctx is not inclusive, but works because _ancestrycontext |
1167 # is used to test filelog revisions | 1169 # is used to test filelog revisions |
1168 ac = cl.ancestors( | 1170 ac = cl.ancestors( |
1169 [p.rev() for p in base.parents()], inclusive=True | 1171 [p.rev() for p in base.parents()], inclusive=True |