repoview: directly skip public head in _getstatichidden
authorPierre-Yves David <pierre-yves.david@fb.com>
Fri, 03 Apr 2015 14:36:05 -0700
changeset 24680 cde57a8d8fe712942b71db02eb764e3c3f4bb3e3
parent 24679 f76595f6ed7c5147cbaf8ab823b5636d66476de3
child 24681 ad6dea5d96f219ab4cdd12155081b2ba1879dbe6
push id12
push usergszorc@mozilla.com
push dateWed, 15 Apr 2015 21:42:54 +0000
repoview: directly skip public head in _getstatichidden Public heads have nothing to offer regarding hidden stuff, let's skip them.
mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -33,17 +33,18 @@ def _getstatichidden(repo):
     working directory parents.
 
     """
     assert not repo.changelog.filteredrevs
     hidden = set(hideablerevs(repo))
     if hidden:
         getphase = repo._phasecache.phase
         getparentrevs = repo.changelog.parentrevs
-        heap = [-r for r in repo.changelog.headrevs()]
+        # Skip heads which are public (guaranteed to not be hidden)
+        heap = [-r for r in repo.changelog.headrevs() if getphase(repo, r)]
         heapq.heapify(heap)
         heappop = heapq.heappop
         heappush = heapq.heappush
         while heap:
             rev = -heappop(heap)
             # Skip nodes which are public (guaranteed to not be hidden)
             if not getphase(repo, rev):
                 continue