##// END OF EJS Templates
phases: leverage the collected information to record phase update...
marmoute -
r52303:eababb7b default
parent child Browse files
Show More
@@ -645,11 +645,6 b' class phasecache:'
645 return changes
645 return changes
646
646
647 def retractboundary(self, repo, tr, targetphase, nodes):
647 def retractboundary(self, repo, tr, targetphase, nodes):
648 oldroots = {
649 phase: revs
650 for phase, revs in self._phaseroots.items()
651 if phase <= targetphase
652 }
653 if tr is None:
648 if tr is None:
654 phasetracking = None
649 phasetracking = None
655 else:
650 else:
@@ -657,22 +652,8 b' class phasecache:'
657 repo = repo.unfiltered()
652 repo = repo.unfiltered()
658 retracted = self._retractboundary(repo, tr, targetphase, nodes)
653 retracted = self._retractboundary(repo, tr, targetphase, nodes)
659 if retracted and phasetracking is not None:
654 if retracted and phasetracking is not None:
660
655 for r, old_phase in sorted(retracted.items()):
661 # find the affected revisions
656 _trackphasechange(phasetracking, r, old_phase, targetphase)
662 new = self._phaseroots[targetphase]
663 old = oldroots[targetphase]
664 affected = set(repo.revs(b'(%ld::) - (%ld::)', new, old))
665
666 # find the phase of the affected revision
667 for phase in range(targetphase, -1, -1):
668 if phase:
669 roots = oldroots.get(phase, [])
670 revs = set(repo.revs(b'%ld::%ld', roots, affected))
671 affected -= revs
672 else: # public phase
673 revs = affected
674 for r in sorted(revs):
675 _trackphasechange(phasetracking, r, phase, targetphase)
676 repo.invalidatevolatilesets()
657 repo.invalidatevolatilesets()
677
658
678 def _retractboundary(self, repo, tr, targetphase, nodes=None, revs=None):
659 def _retractboundary(self, repo, tr, targetphase, nodes=None, revs=None):
@@ -1595,7 +1595,6 b' abort behavior'
1595 trying to push a secret changeset doesn't confuse auto-publish
1595 trying to push a secret changeset doesn't confuse auto-publish
1596
1596
1597 $ hg phase --secret --force
1597 $ hg phase --secret --force
1598 test-debug-phase: move rev 0: 1 -> 2
1599 test-debug-phase: move rev 1: 1 -> 2
1598 test-debug-phase: move rev 1: 1 -> 2
1600
1599
1601 $ hg push --config experimental.auto-publish=abort
1600 $ hg push --config experimental.auto-publish=abort
@@ -54,9 +54,7 b' Following commit are draft too'
54 Working directory phase is secret when its parent is secret.
54 Working directory phase is secret when its parent is secret.
55
55
56 $ hg phase --force --secret .
56 $ hg phase --force --secret .
57 test-debug-phase: move rev 0: 1 -> 2
58 test-debug-phase: move rev 1: 1 -> 2
57 test-debug-phase: move rev 1: 1 -> 2
59 test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: draft -> secret
60 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: draft -> secret
58 test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: draft -> secret
61 $ hg log -r 'wdir()' -T '{phase}\n'
59 $ hg log -r 'wdir()' -T '{phase}\n'
62 secret
60 secret
General Comments 0
You need to be logged in to leave comments. Login now