equal
deleted
inserted
replaced
151 |
151 |
152 This function move boundary *forward* this means that all nodes are set |
152 This function move boundary *forward* this means that all nodes are set |
153 in the target phase or kept in a *lower* phase. |
153 in the target phase or kept in a *lower* phase. |
154 |
154 |
155 Simplify boundary to contains phase roots only.""" |
155 Simplify boundary to contains phase roots only.""" |
|
156 delroots = [] # set of root deleted by this path |
156 for phase in xrange(targetphase + 1, len(allphases)): |
157 for phase in xrange(targetphase + 1, len(allphases)): |
157 # filter nodes that are not in a compatible phase already |
158 # filter nodes that are not in a compatible phase already |
158 # XXX rev phase cache might have been invalidated by a previous loop |
159 # XXX rev phase cache might have been invalidated by a previous loop |
159 # XXX we need to be smarter here |
160 # XXX we need to be smarter here |
160 nodes = [n for n in nodes if repo[n].phase() >= phase] |
161 nodes = [n for n in nodes if repo[n].phase() >= phase] |
168 if olds != roots: |
169 if olds != roots: |
169 # invalidate cache (we probably could be smarter here |
170 # invalidate cache (we probably could be smarter here |
170 if '_phaserev' in vars(repo): |
171 if '_phaserev' in vars(repo): |
171 del repo._phaserev |
172 del repo._phaserev |
172 repo._dirtyphases = True |
173 repo._dirtyphases = True |
|
174 # some roots may need to be declared for lower phases |
|
175 delroots.extend(olds - roots) |
|
176 # declare deleted root in the target phase |
|
177 if targetphase != 0: |
|
178 retractboundary(repo, targetphase, delroots) |
|
179 |
173 |
180 |
174 def retractboundary(repo, targetphase, nodes): |
181 def retractboundary(repo, targetphase, nodes): |
175 """Set nodes back to a phase changing other nodes phases if necessary. |
182 """Set nodes back to a phase changing other nodes phases if necessary. |
176 |
183 |
177 This function move boundary *backward* this means that all nodes are set |
184 This function move boundary *backward* this means that all nodes are set |