Show More
@@ -583,30 +583,28 b' class phasecache(object):' | |||
|
583 | 583 | raise error.ProgrammingError(msg) |
|
584 | 584 | |
|
585 | 585 | repo = repo.unfiltered() |
|
586 | currentroots = self.phaseroots[targetphase] | |
|
586 | torev = repo.changelog.rev | |
|
587 | tonode = repo.changelog.node | |
|
588 | currentroots = {torev(node) for node in self.phaseroots[targetphase]} | |
|
587 | 589 | finalroots = oldroots = set(currentroots) |
|
588 | newroots = [ | |
|
589 |
|
|
|
590 | ] | |
|
590 | newroots = [torev(node) for node in nodes] | |
|
591 | newroots = [rev for rev in newroots if self.phase(repo, rev) < targetphase] | |
|
592 | ||
|
591 | 593 | if newroots: |
|
592 | ||
|
593 | if nullid in newroots: | |
|
594 | if nullrev in newroots: | |
|
594 | 595 | raise error.Abort(_(b'cannot change null revision phase')) |
|
595 | currentroots = currentroots.copy() | |
|
596 | 596 | currentroots.update(newroots) |
|
597 | 597 | |
|
598 | 598 | # Only compute new roots for revs above the roots that are being |
|
599 | 599 | # retracted. |
|
600 |
minnewroot = min( |
|
|
601 | aboveroots = [ | |
|
602 | n for n in currentroots if repo[n].rev() >= minnewroot | |
|
603 | ] | |
|
604 | updatedroots = repo.set(b'roots(%ln::)', aboveroots) | |
|
600 | minnewroot = min(newroots) | |
|
601 | aboveroots = [rev for rev in currentroots if rev >= minnewroot] | |
|
602 | updatedroots = repo.set(b'roots(%ld::)', aboveroots) | |
|
605 | 603 | |
|
606 |
finalroots = { |
|
|
607 |
finalroots.update(ctx. |
|
|
604 | finalroots = {rev for rev in currentroots if rev < minnewroot} | |
|
605 | finalroots.update(ctx.rev() for ctx in updatedroots) | |
|
608 | 606 | if finalroots != oldroots: |
|
609 | self._updateroots(targetphase, finalroots, tr) | |
|
607 | self._updateroots(targetphase, {tonode(rev) for rev in finalroots}, tr) | |
|
610 | 608 | return True |
|
611 | 609 | return False |
|
612 | 610 |
General Comments 0
You need to be logged in to leave comments.
Login now