comparison mercurial/phases.py @ 15695:1b9dcf2eb011

phases: fix advanceboundary behavior when targetphase !=0 Changeset was properly removed from upper phase but was not explicitly added to target phase. If advanced changesets had not pwasnt in target phase they was considered public (0-phase).
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Mon, 19 Dec 2011 11:29:39 +0100
parents 7fba5a245acc
children 0cb45fef99ba
comparison
equal deleted inserted replaced
15694:1e4e49c58b94 15695:1b9dcf2eb011
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