##// END OF EJS Templates
phases: add a function to compute heads from root
Pierre-Yves David -
r15649:ca7c4254 default
parent child Browse files
Show More
@@ -140,3 +140,30 b' def pushphase(repo, nhex, oldphasestr, n'
140 140 return 0
141 141 finally:
142 142 lock.release()
143
144 def analyzeremotephases(repo, subset, roots):
145 """Compute phases heads and root in a subset of node from root dict
146
147 * subset is heads of the subset
148 * roots is {<nodeid> => phase} mapping. key and value are string.
149
150 Accept unknown element input
151 """
152 # build list from dictionary
153 phaseroots = [[] for p in allphases]
154 for nhex, phase in roots.iteritems():
155 if nhex == 'publishing': # ignore data related to publish option
156 continue
157 node = bin(nhex)
158 phase = int(phase)
159 if node in repo:
160 phaseroots[phase].append(node)
161 # compute heads
162 phaseheads = [[] for p in allphases]
163 for phase in allphases[:-1]:
164 toproof = phaseroots[phase + 1]
165 revset = repo.set('heads((%ln + parents(%ln)) - (%ln::%ln))',
166 subset, toproof, toproof, subset)
167 phaseheads[phase].extend(c.node() for c in revset)
168 return phaseheads, phaseroots
169
General Comments 0
You need to be logged in to leave comments. Login now