##// END OF EJS Templates
phase: add an archived phase...
Boris Feld -
r40463:49c7b701 stable
parent child Browse files
Show More
@@ -129,11 +129,13 b' HIDEABLE_FLAG = 32 # Phases that are hid'
129 129 # record phase index
130 130 public, draft, secret = range(3)
131 131 internal = INTERNAL_FLAG | HIDEABLE_FLAG
132 archived = HIDEABLE_FLAG
132 133 allphases = range(internal + 1)
133 134 trackedphases = allphases[1:]
134 135 # record phase names
135 136 phasenames = [None] * len(allphases)
136 137 phasenames[:3] = ['public', 'draft', 'secret']
138 phasenames[archived] = 'archived'
137 139 phasenames[internal] = 'internal'
138 140 # record phase property
139 141 mutablephases = tuple(allphases[1:])
@@ -446,8 +448,9 b' class phasecache(object):'
446 448 def _retractboundary(self, repo, tr, targetphase, nodes):
447 449 # Be careful to preserve shallow-copied values: do not update
448 450 # phaseroots values, replace them.
449 if targetphase == internal and not supportinternal(repo):
450 msg = 'this repository does not support the internal phase'
451 if targetphase in (archived, internal) and not supportinternal(repo):
452 name = phasenames[targetphase]
453 msg = 'this repository does not support the %s phase' % name
451 454 raise error.ProgrammingError(msg)
452 455
453 456 repo = repo.unfiltered()
@@ -850,6 +850,10 b' Check we deny its usage on older reposit'
850 850 ** ProgrammingError: this repository does not support the internal phase
851 851 raise error.ProgrammingError(msg)
852 852 mercurial.error.ProgrammingError: this repository does not support the internal phase
853 $ hg --config "phases.new-commit=archived" commit -m "my test archived commit" 2>&1 | grep ProgrammingError
854 ** ProgrammingError: this repository does not support the archived phase
855 raise error.ProgrammingError(msg)
856 mercurial.error.ProgrammingError: this repository does not support the archived phase
853 857
854 858 $ cd ..
855 859
@@ -878,7 +882,8 b' Commit an internal changesets'
878 882 test-debug-phase: new rev 1: x -> 96
879 883 test-hook-close-phase: c01c42dffc7f81223397e99652a0703f83e1c5ea: -> internal
880 884
881 Usual visibility rules apply when working directory parents
885 The changeset is a working parent descendant.
886 Per the usual visibility rules, it is made visible.
882 887
883 888 $ hg log -G -l 3
884 889 @ changeset: 1:c01c42dffc7f
@@ -904,3 +909,45 b' Commit is hidden as expected'
904 909 date: Thu Jan 01 00:00:00 1970 +0000
905 910 summary: A
906 911
912
913 Test for archived phase
914 -----------------------
915
916 Commit an archived changesets
917
918 $ echo B > B
919 $ hg add B
920 $ hg status
921 A B
922 $ hg --config "phases.new-commit=archived" commit -m "my test archived commit"
923 test-debug-phase: new rev 2: x -> 32
924 test-hook-close-phase: 8df5997c3361518f733d1ae67cd3adb9b0eaf125: -> archived
925
926 The changeset is a working parent descendant.
927 Per the usual visibility rules, it is made visible.
928
929 $ hg log -G -l 3
930 @ changeset: 2:8df5997c3361
931 | tag: tip
932 | parent: 0:4a2df7238c3b
933 | user: test
934 | date: Thu Jan 01 00:00:00 1970 +0000
935 | summary: my test archived commit
936 |
937 o changeset: 0:4a2df7238c3b
938 user: test
939 date: Thu Jan 01 00:00:00 1970 +0000
940 summary: A
941
942
943 Commit is hidden as expected
944
945 $ hg up 0
946 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
947 $ hg log -G
948 @ changeset: 0:4a2df7238c3b
949 tag: tip
950 user: test
951 date: Thu Jan 01 00:00:00 1970 +0000
952 summary: A
953
General Comments 0
You need to be logged in to leave comments. Login now