mercurial/repoview.py
changeset 45114 e2d17974a869
parent 43766 d4c2221240a6
child 45115 672ad1f6eeb8
--- a/mercurial/repoview.py	Wed Jun 24 17:53:44 2020 +0200
+++ b/mercurial/repoview.py	Tue Jul 07 21:45:10 2020 +0200
@@ -129,7 +129,7 @@
 def computemutable(repo, visibilityexceptions=None):
     assert not repo.changelog.filteredrevs
     # fast check to avoid revset call on huge repo
-    if any(repo._phasecache.phaseroots[1:]):
+    if repo._phasecache.hasnonpublicphases(repo):
         getphase = repo._phasecache.phase
         maymutable = filterrevs(repo, b'base')
         return frozenset(r for r in maymutable if getphase(repo, r))
@@ -154,9 +154,9 @@
     assert not repo.changelog.filteredrevs
     cl = repo.changelog
     firstmutable = len(cl)
-    for roots in repo._phasecache.phaseroots[1:]:
-        if roots:
-            firstmutable = min(firstmutable, min(cl.rev(r) for r in roots))
+    roots = repo._phasecache.nonpublicphaseroots(repo)
+    if roots:
+        firstmutable = min(firstmutable, min(cl.rev(r) for r in roots))
     # protect from nullrev root
     firstmutable = max(0, firstmutable)
     return frozenset(pycompat.xrange(firstmutable, len(cl)))