##// 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 break
59 break
60 return blockers
60 return blockers
61
61
62 def _domainancestors(pfunc, revs, domain):
62 def _revealancestors(pfunc, hidden, revs, domain):
63 """return ancestors of 'revs' within 'domain'
63 """reveals contiguous chains of hidden ancestors of 'revs' within 'domain'
64 by removing them from 'hidden'
64
65
65 - pfunc(r): a funtion returning parent of 'r',
66 - pfunc(r): a funtion returning parent of 'r',
67 - hidden: the (preliminary) hidden revisions, to be updated
66 - revs: iterable of revnum,
68 - revs: iterable of revnum,
67 - domain: consistent set of revnum.
69 - domain: consistent set of revnum.
68
70
@@ -85,16 +87,16 b' def _domainancestors(pfunc, revs, domain'
85 If C, D, E and F are in the domain but B is not, A cannot be ((A) is an
87 If C, D, E and F are in the domain but B is not, A cannot be ((A) is an
86 ancestors disconnected subset disconnected of (C+D)).
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 stack = list(revs)
93 stack = list(revs)
91 ancestors = set(stack)
94 hidden -= set(stack)
92 while stack:
95 while stack:
93 for p in pfunc(stack.pop()):
96 for p in pfunc(stack.pop()):
94 if p != nullrev and p in domain and p not in ancestors:
97 if p != nullrev and p in domain and p in hidden:
95 ancestors.add(p)
98 hidden.remove(p)
96 stack.append(p)
99 stack.append(p)
97 return ancestors
98
100
99 def computehidden(repo):
101 def computehidden(repo):
100 """compute the set of hidden revision to filter
102 """compute the set of hidden revision to filter
@@ -114,7 +116,9 b' def computehidden(repo):'
114 # changesets and remove those.
116 # changesets and remove those.
115 blockers |= (hidden & pinnedrevs(repo))
117 blockers |= (hidden & pinnedrevs(repo))
116 if blockers:
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 return frozenset(hidden)
122 return frozenset(hidden)
119
123
120 def computeunserved(repo):
124 def computeunserved(repo):
General Comments 0
You need to be logged in to leave comments. Login now