repoview: directly skip public head in _getstatichidden
authorPierre-Yves David <pierre-yves.david@fb.com>
Fri, 03 Apr 2015 14:36:05 -0700
changeset 24618 cde57a8d8fe7
parent 24617 f76595f6ed7c
child 24619 ad6dea5d96f2
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	Fri Apr 03 14:35:53 2015 -0700
+++ b/mercurial/repoview.py	Fri Apr 03 14:36:05 2015 -0700
@@ -38,7 +38,8 @@
     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