Show More
@@ -123,11 +123,22 from . import ( | |||||
123 |
|
123 | |||
124 | _fphasesentry = struct.Struct('>i20s') |
|
124 | _fphasesentry = struct.Struct('>i20s') | |
125 |
|
125 | |||
126 | allphases = public, draft, secret = range(3) |
|
126 | INTERNAL_FLAG = 64 # Phases for mercurial internal usage only | |
|
127 | HIDEABLE_FLAG = 32 # Phases that are hideable | |||
|
128 | ||||
|
129 | # record phase index | |||
|
130 | public, draft, secret = range(3) | |||
|
131 | internal = INTERNAL_FLAG | HIDEABLE_FLAG | |||
|
132 | allphases = range(internal + 1) | |||
127 | trackedphases = allphases[1:] |
|
133 | trackedphases = allphases[1:] | |
128 | phasenames = ['public', 'draft', 'secret'] |
|
134 | # record phase names | |
|
135 | phasenames = [None] * len(allphases) | |||
|
136 | phasenames[:3] = ['public', 'draft', 'secret'] | |||
|
137 | phasenames[internal] = 'internal' | |||
|
138 | # record phase property | |||
129 | mutablephases = tuple(allphases[1:]) |
|
139 | mutablephases = tuple(allphases[1:]) | |
130 | remotehiddenphases = tuple(allphases[2:]) |
|
140 | remotehiddenphases = tuple(allphases[2:]) | |
|
141 | localhiddenphases = tuple(p for p in allphases if p & HIDEABLE_FLAG) | |||
131 |
|
142 | |||
132 | def _readroots(repo, phasedefaults=None): |
|
143 | def _readroots(repo, phasedefaults=None): | |
133 | """Read phase roots from disk |
|
144 | """Read phase roots from disk |
@@ -28,7 +28,10 def hideablerevs(repo): | |||||
28 | branchmap (see mercurial.branchmap.subsettable), you cannot set "public" |
|
28 | branchmap (see mercurial.branchmap.subsettable), you cannot set "public" | |
29 | changesets as "hideable". Doing so would break multiple code assertions and |
|
29 | changesets as "hideable". Doing so would break multiple code assertions and | |
30 | lead to crashes.""" |
|
30 | lead to crashes.""" | |
31 |
|
|
31 | obsoletes = obsolete.getrevs(repo, 'obsolete') | |
|
32 | internals = repo._phasecache.getrevset(repo, phases.localhiddenphases) | |||
|
33 | internals = frozenset(internals) | |||
|
34 | return obsoletes | internals | |||
32 |
|
35 | |||
33 | def pinnedrevs(repo): |
|
36 | def pinnedrevs(repo): | |
34 | """revisions blocking hidden changesets from being filtered |
|
37 | """revisions blocking hidden changesets from being filtered |
@@ -826,3 +826,51 Try various actions. only the draft move | |||||
826 | rollback completed |
|
826 | rollback completed | |
827 | abort: pretxnclose-phase.nopublish_D hook exited with status 1 |
|
827 | abort: pretxnclose-phase.nopublish_D hook exited with status 1 | |
828 | [255] |
|
828 | [255] | |
|
829 | ||||
|
830 | $ cd .. | |||
|
831 | ||||
|
832 | Test for the "internal" phase | |||
|
833 | ============================= | |||
|
834 | ||||
|
835 | $ hg init internal-phase | |||
|
836 | $ cd internal-phase | |||
|
837 | $ mkcommit A | |||
|
838 | test-debug-phase: new rev 0: x -> 1 | |||
|
839 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> draft | |||
|
840 | ||||
|
841 | Commit an internal changesets | |||
|
842 | ||||
|
843 | $ echo B > B | |||
|
844 | $ hg add B | |||
|
845 | $ hg status | |||
|
846 | A B | |||
|
847 | $ hg --config "phases.new-commit=internal" commit -m "my test internal commit" | |||
|
848 | test-debug-phase: new rev 1: x -> 96 | |||
|
849 | test-hook-close-phase: c01c42dffc7f81223397e99652a0703f83e1c5ea: -> internal | |||
|
850 | ||||
|
851 | Usual visibility rules apply when working directory parents | |||
|
852 | ||||
|
853 | $ hg log -G -l 3 | |||
|
854 | @ changeset: 1:c01c42dffc7f | |||
|
855 | | tag: tip | |||
|
856 | | user: test | |||
|
857 | | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
858 | | summary: my test internal commit | |||
|
859 | | | |||
|
860 | o changeset: 0:4a2df7238c3b | |||
|
861 | user: test | |||
|
862 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
863 | summary: A | |||
|
864 | ||||
|
865 | ||||
|
866 | Commit is hidden as expected | |||
|
867 | ||||
|
868 | $ hg up 0 | |||
|
869 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
870 | $ hg log -G | |||
|
871 | @ changeset: 0:4a2df7238c3b | |||
|
872 | tag: tip | |||
|
873 | user: test | |||
|
874 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
875 | summary: A | |||
|
876 |
General Comments 0
You need to be logged in to leave comments.
Login now