Show More
@@ -140,6 +140,10 b' mutablephases = tuple(allphases[1:])' | |||||
140 | remotehiddenphases = tuple(allphases[2:]) |
|
140 | remotehiddenphases = tuple(allphases[2:]) | |
141 | localhiddenphases = tuple(p for p in allphases if p & HIDEABLE_FLAG) |
|
141 | localhiddenphases = tuple(p for p in allphases if p & HIDEABLE_FLAG) | |
142 |
|
142 | |||
|
143 | def supportinternal(repo): | |||
|
144 | """True if the internal phase can be used on a repository""" | |||
|
145 | return 'internal-phase' in repo.requirements | |||
|
146 | ||||
143 | def _readroots(repo, phasedefaults=None): |
|
147 | def _readroots(repo, phasedefaults=None): | |
144 | """Read phase roots from disk |
|
148 | """Read phase roots from disk | |
145 |
|
149 | |||
@@ -442,6 +446,9 b' class phasecache(object):' | |||||
442 | def _retractboundary(self, repo, tr, targetphase, nodes): |
|
446 | def _retractboundary(self, repo, tr, targetphase, nodes): | |
443 | # Be careful to preserve shallow-copied values: do not update |
|
447 | # Be careful to preserve shallow-copied values: do not update | |
444 | # phaseroots values, replace them. |
|
448 | # phaseroots values, replace them. | |
|
449 | if targetphase == internal and not supportinternal(repo): | |||
|
450 | msg = 'this repository does not support the internal phase' | |||
|
451 | raise error.ProgrammingError(msg) | |||
445 |
|
452 | |||
446 | repo = repo.unfiltered() |
|
453 | repo = repo.unfiltered() | |
447 | currentroots = self.phaseroots[targetphase] |
|
454 | currentroots = self.phaseroots[targetphase] |
@@ -832,8 +832,38 b' Try various actions. only the draft move' | |||||
832 | Test for the "internal" phase |
|
832 | Test for the "internal" phase | |
833 | ============================= |
|
833 | ============================= | |
834 |
|
834 | |||
835 | $ hg init internal-phase |
|
835 | Check we deny its usage on older repository | |
|
836 | ||||
|
837 | $ hg init no-internal-phase --config format.internal-phase=no | |||
|
838 | $ cd no-internal-phase | |||
|
839 | $ cat .hg/requires | |||
|
840 | dotencode | |||
|
841 | fncache | |||
|
842 | generaldelta | |||
|
843 | revlogv1 | |||
|
844 | store | |||
|
845 | $ echo X > X | |||
|
846 | $ hg add X | |||
|
847 | $ hg status | |||
|
848 | A X | |||
|
849 | $ hg --config "phases.new-commit=internal" commit -m "my test internal commit" 2>&1 | grep ProgrammingError | |||
|
850 | ** ProgrammingError: this repository does not support the internal phase | |||
|
851 | raise error.ProgrammingError(msg) | |||
|
852 | mercurial.error.ProgrammingError: this repository does not support the internal phase | |||
|
853 | ||||
|
854 | $ cd .. | |||
|
855 | ||||
|
856 | Check it works fine with repository that supports it. | |||
|
857 | ||||
|
858 | $ hg init internal-phase --config format.internal-phase=yes | |||
836 | $ cd internal-phase |
|
859 | $ cd internal-phase | |
|
860 | $ cat .hg/requires | |||
|
861 | dotencode | |||
|
862 | fncache | |||
|
863 | generaldelta | |||
|
864 | internal-phase | |||
|
865 | revlogv1 | |||
|
866 | store | |||
837 | $ mkcommit A |
|
867 | $ mkcommit A | |
838 | test-debug-phase: new rev 0: x -> 1 |
|
868 | test-debug-phase: new rev 0: x -> 1 | |
839 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> draft |
|
869 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> draft |
General Comments 0
You need to be logged in to leave comments.
Login now