# HG changeset patch # User Pierre-Yves David # Date 2019-11-17 07:50:21 # Node ID f9068413bd0ca73c5b619a2dd82e28e1120db2d7 # Parent 3fd6ec54704c9965b52652af7d2d79c7d7062e8e changectx: use unfiltered changelog to access parents of unfiltered revs If a revision is not filtered, we know that its parents are not either. So we can take a shortcut. This shortcut avoid the computation of all filtered revs in some cases. Differential Revision: https://phab.mercurial-scm.org/D7487 diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -523,7 +523,12 @@ class changectx(basectx): @propertycache def _parents(self): repo = self._repo - p1, p2 = repo.changelog.parentrevs(self._rev) + if self._maybe_filtered: + cl = repo.changelog + else: + cl = repo.unfiltered().changelog + + p1, p2 = cl.parentrevs(self._rev) if p2 == nullrev: return [repo[p1]] return [repo[p1], repo[p2]] diff --git a/tests/test-repo-filters-tiptoe.t b/tests/test-repo-filters-tiptoe.t --- a/tests/test-repo-filters-tiptoe.t +++ b/tests/test-repo-filters-tiptoe.t @@ -58,7 +58,6 @@ Getting basic changeset inforation about Getting status of null $ hg status --change null - debug.filters: computing revision filter for "visible" Getting status of working copy