Show More
@@ -61,9 +61,10 b' def filterunknown(repo, phaseroots=None)' | |||
|
61 | 61 | def advanceboundary(repo, targetphase, nodes): |
|
62 | 62 | """Add nodes to a phase changing other nodes phases if necessary. |
|
63 | 63 | |
|
64 | Simplify boundary to contains phase roots only.""" | |
|
64 | This function move boundary *forward* this means that all nodes are set | |
|
65 | in the target phase or kept in a *lower* phase. | |
|
65 | 66 |
|
|
66 | # move roots of lower states | |
|
67 | Simplify boundary to contains phase roots only.""" | |
|
67 | 68 | for phase in xrange(targetphase + 1, len(allphases)): |
|
68 | 69 | # filter nodes that are not in a compatible phase already |
|
69 | 70 | # XXX rev phase cache might have been invalidated by a previous loop |
@@ -81,3 +82,21 b' def advanceboundary(repo, targetphase, n' | |||
|
81 | 82 | if '_phaserev' in vars(repo): |
|
82 | 83 | del repo._phaserev |
|
83 | 84 | repo._dirtyphases = True |
|
85 | ||
|
86 | def retractboundary(repo, targetphase, nodes): | |
|
87 | """Set nodes back to a phase changing other nodes phases if necessary. | |
|
88 | ||
|
89 | This function move boundary *backward* this means that all nodes are set | |
|
90 | in the target phase or kept in a *higher* phase. | |
|
91 | ||
|
92 | Simplify boundary to contains phase roots only.""" | |
|
93 | currentroots = repo._phaseroots[targetphase] | |
|
94 | newroots = [n for n in nodes if repo[n].phase() < targetphase] | |
|
95 | if newroots: | |
|
96 | currentroots.update(newroots) | |
|
97 | ctxs = repo.set('roots(%ln::)', currentroots) | |
|
98 | currentroots.intersection_update(ctx.node() for ctx in ctxs) | |
|
99 | if '_phaserev' in vars(repo): | |
|
100 | del repo._phaserev | |
|
101 | repo._dirtyphases = True | |
|
102 |
General Comments 0
You need to be logged in to leave comments.
Login now