##// END OF EJS Templates
phases: extract the core of boundary retraction in '_retractboundary'...
Boris Feld -
r33452:7b25a563 default
parent child Browse files
Show More
@@ -331,10 +331,14 b' class phasecache(object):'
331 delroots.extend(olds - roots)
331 delroots.extend(olds - roots)
332 # declare deleted root in the target phase
332 # declare deleted root in the target phase
333 if targetphase != 0:
333 if targetphase != 0:
334 self.retractboundary(repo, tr, targetphase, delroots)
334 self._retractboundary(repo, tr, targetphase, delroots)
335 repo.invalidatevolatilesets()
335 repo.invalidatevolatilesets()
336
336
337 def retractboundary(self, repo, tr, targetphase, nodes):
337 def retractboundary(self, repo, tr, targetphase, nodes):
338 self._retractboundary(repo, tr, targetphase, nodes)
339 repo.invalidatevolatilesets()
340
341 def _retractboundary(self, repo, tr, targetphase, nodes):
338 # Be careful to preserve shallow-copied values: do not update
342 # Be careful to preserve shallow-copied values: do not update
339 # phaseroots values, replace them.
343 # phaseroots values, replace them.
340
344
@@ -343,6 +347,7 b' class phasecache(object):'
343 newroots = [n for n in nodes
347 newroots = [n for n in nodes
344 if self.phase(repo, repo[n].rev()) < targetphase]
348 if self.phase(repo, repo[n].rev()) < targetphase]
345 if newroots:
349 if newroots:
350
346 if nullid in newroots:
351 if nullid in newroots:
347 raise error.Abort(_('cannot change null revision phase'))
352 raise error.Abort(_('cannot change null revision phase'))
348 currentroots = currentroots.copy()
353 currentroots = currentroots.copy()
@@ -360,7 +365,6 b' class phasecache(object):'
360 finalroots.update(ctx.node() for ctx in updatedroots)
365 finalroots.update(ctx.node() for ctx in updatedroots)
361
366
362 self._updateroots(targetphase, finalroots, tr)
367 self._updateroots(targetphase, finalroots, tr)
363 repo.invalidatevolatilesets()
364
368
365 def filterunknown(self, repo):
369 def filterunknown(self, repo):
366 """remove unknown nodes from the phase boundary
370 """remove unknown nodes from the phase boundary
General Comments 0
You need to be logged in to leave comments. Login now