changectx: use unfiltered changelog to walk ancestors in annotate
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 21 Nov 2019 23:46:51 +0100
changeset 44108 c472970339d2
parent 44107 5a012404503b
child 44109 98349eddceef
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
mercurial/context.py
tests/test-repo-filters-tiptoe.t
--- a/mercurial/context.py	Thu Nov 21 23:25:08 2019 +0100
+++ b/mercurial/context.py	Thu Nov 21 23:46:51 2019 +0100
@@ -1161,7 +1161,9 @@
         # use linkrev to find the first changeset where self appeared
         base = self.introfilectx()
         if getattr(base, '_ancestrycontext', None) is None:
-            cl = self._repo.changelog
+            # it is safe to use an unfiltered repository here because we are
+            # walking ancestors only.
+            cl = self._repo.unfiltered().changelog
             if base.rev() is None:
                 # wctx is not inclusive, but works because _ancestrycontext
                 # is used to test filelog revisions
--- a/tests/test-repo-filters-tiptoe.t	Thu Nov 21 23:25:08 2019 +0100
+++ b/tests/test-repo-filters-tiptoe.t	Thu Nov 21 23:46:51 2019 +0100
@@ -136,13 +136,11 @@
 - file with a single change
 
   $ hg annotate a
-  debug.filters: computing revision filter for "visible"
   0: a
 
 - file with multiple change
 
   $ hg annotate z
-  debug.filters: computing revision filter for "visible"
   0: some line
   1: in a
   2: file