changeset 24619:ad6dea5d96f2

repoview: skip public parent earlier in _getstatichidden Public changeset have nothing to offer regarding hidden changeset. Lets not add them to the heap at all.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 03 Apr 2015 14:37:52 -0700
parents cde57a8d8fe7
children 7c6f9097e2e0
files mercurial/repoview.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/repoview.py	Fri Apr 03 14:36:05 2015 -0700
+++ b/mercurial/repoview.py	Fri Apr 03 14:37:52 2015 -0700
@@ -45,9 +45,6 @@
         heappush = heapq.heappush
         while heap:
             rev = -heappop(heap)
-            # Skip nodes which are public (guaranteed to not be hidden)
-            if not getphase(repo, rev):
-                continue
             # All children have been processed so at that point, if no children
             # removed 'rev' from the 'hidden' set, 'rev' is going to be hidden.
             blocker = rev not in hidden
@@ -57,7 +54,9 @@
                 if blocker:
                     # If visible, ensure parent will be visible too
                     hidden.discard(parent)
-                heappush(heap, -parent)
+                # Skip nodes which are public (guaranteed to not be hidden)
+                if getphase(repo, rev):
+                    heappush(heap, -parent)
     return hidden
 
 def _getdynamicblockers(repo):