[PATCH 4 of 6] repoview: directly skip public head in _getstatichidden

Pierre-Yves David pierre-yves.david at ens-lyon.org
Fri Apr 3 17:23:49 CDT 2015


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1428096965 25200
#      Fri Apr 03 14:36:05 2015 -0700
# Node ID a8b5ea29991bd173f34a8fe3aedbbdb336444ce8
# Parent  52464cbacdf048fa115caa7109baff6f2631211c
repoview: directly skip public head in _getstatichidden

Public head have nothing to offer regarding hidden stuff, let's skip them.

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -34,11 +34,12 @@ def _getstatichidden(repo):
     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)


More information about the Mercurial-devel mailing list