##// END OF EJS Templates
hidden: change _domainancestors() to _revealancestors()...
Martin von Zweigbergk -
r32581:b9b41d8f default
parent child Browse files
Show More
@@ -59,10 +59,12 b' def _consistencyblocker(pfunc, hideable,'
59 59 break
60 60 return blockers
61 61
62 def _domainancestors(pfunc, revs, domain):
63 """return ancestors of 'revs' within 'domain'
62 def _revealancestors(pfunc, hidden, revs, domain):
63 """reveals contiguous chains of hidden ancestors of 'revs' within 'domain'
64 by removing them from 'hidden'
64 65
65 66 - pfunc(r): a funtion returning parent of 'r',
67 - hidden: the (preliminary) hidden revisions, to be updated
66 68 - revs: iterable of revnum,
67 69 - domain: consistent set of revnum.
68 70
@@ -85,16 +87,16 b' def _domainancestors(pfunc, revs, domain'
85 87 If C, D, E and F are in the domain but B is not, A cannot be ((A) is an
86 88 ancestors disconnected subset disconnected of (C+D)).
87 89
88 (Ancestors are returned inclusively)
90 (Ancestors are revealed inclusively, i.e. the elements in 'revs' are
91 also revealed)
89 92 """
90 93 stack = list(revs)
91 ancestors = set(stack)
94 hidden -= set(stack)
92 95 while stack:
93 96 for p in pfunc(stack.pop()):
94 if p != nullrev and p in domain and p not in ancestors:
95 ancestors.add(p)
97 if p != nullrev and p in domain and p in hidden:
98 hidden.remove(p)
96 99 stack.append(p)
97 return ancestors
98 100
99 101 def computehidden(repo):
100 102 """compute the set of hidden revision to filter
@@ -114,7 +116,9 b' def computehidden(repo):'
114 116 # changesets and remove those.
115 117 blockers |= (hidden & pinnedrevs(repo))
116 118 if blockers:
117 hidden = hidden - _domainancestors(pfunc, blockers, mutable)
119 # don't modify possibly cached result of hideablerevs()
120 hidden = hidden.copy()
121 _revealancestors(pfunc, hidden, blockers, mutable)
118 122 return frozenset(hidden)
119 123
120 124 def computeunserved(repo):
General Comments 0
You need to be logged in to leave comments. Login now