Mercurial > hg
comparison mercurial/repoview.py @ 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 |
comparison
equal
deleted
inserted
replaced
24618:cde57a8d8fe7 | 24619:ad6dea5d96f2 |
---|---|
43 heapq.heapify(heap) | 43 heapq.heapify(heap) |
44 heappop = heapq.heappop | 44 heappop = heapq.heappop |
45 heappush = heapq.heappush | 45 heappush = heapq.heappush |
46 while heap: | 46 while heap: |
47 rev = -heappop(heap) | 47 rev = -heappop(heap) |
48 # Skip nodes which are public (guaranteed to not be hidden) | |
49 if not getphase(repo, rev): | |
50 continue | |
51 # All children have been processed so at that point, if no children | 48 # All children have been processed so at that point, if no children |
52 # removed 'rev' from the 'hidden' set, 'rev' is going to be hidden. | 49 # removed 'rev' from the 'hidden' set, 'rev' is going to be hidden. |
53 blocker = rev not in hidden | 50 blocker = rev not in hidden |
54 for parent in getparentrevs(rev): | 51 for parent in getparentrevs(rev): |
55 if parent == nullrev: | 52 if parent == nullrev: |
56 continue | 53 continue |
57 if blocker: | 54 if blocker: |
58 # If visible, ensure parent will be visible too | 55 # If visible, ensure parent will be visible too |
59 hidden.discard(parent) | 56 hidden.discard(parent) |
60 heappush(heap, -parent) | 57 # Skip nodes which are public (guaranteed to not be hidden) |
58 if getphase(repo, rev): | |
59 heappush(heap, -parent) | |
61 return hidden | 60 return hidden |
62 | 61 |
63 def _getdynamicblockers(repo): | 62 def _getdynamicblockers(repo): |
64 """Non-cacheable revisions blocking hidden changesets from being filtered. | 63 """Non-cacheable revisions blocking hidden changesets from being filtered. |
65 | 64 |