# HG changeset patch # User Pierre-Yves David # Date 1573977021 -3600 # 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 -r 3fd6ec54704c -r f9068413bd0c mercurial/context.py --- a/mercurial/context.py Sat Nov 23 16:49:34 2019 -0800 +++ b/mercurial/context.py Sun Nov 17 08:50:21 2019 +0100 @@ -523,7 +523,12 @@ @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 -r 3fd6ec54704c -r f9068413bd0c tests/test-repo-filters-tiptoe.t --- a/tests/test-repo-filters-tiptoe.t Sat Nov 23 16:49:34 2019 -0800 +++ b/tests/test-repo-filters-tiptoe.t Sun Nov 17 08:50:21 2019 +0100 @@ -58,7 +58,6 @@ Getting status of null $ hg status --change null - debug.filters: computing revision filter for "visible" Getting status of working copy