##// END OF EJS Templates
phase: introduce a dedicated requirement for the `archived` phase...
marmoute -
r50346:0c70d888 default
parent child Browse files
Show More
@@ -1431,6 +1431,23 b' coreconfigitem('
1431 default=False,
1431 default=False,
1432 experimental=True,
1432 experimental=True,
1433 )
1433 )
1434 # The interaction between the archived phase and obsolescence markers needs to
1435 # be sorted out before wider usage of this are to be considered.
1436 #
1437 # At the time this message is written, behavior when archiving obsolete
1438 # changeset differ significantly from stripping. As part of stripping, we also
1439 # remove the obsolescence marker associated to the stripped changesets,
1440 # revealing the precedecessors changesets when applicable. When archiving, we
1441 # don't touch the obsolescence markers, keeping everything hidden. This can
1442 # result in quite confusing situation for people combining exchanging draft
1443 # with the archived phases. As some markers needed by others may be skipped
1444 # during exchange.
1445 coreconfigitem(
1446 b'format',
1447 b'exp-archived-phase',
1448 default=False,
1449 experimental=True,
1450 )
1434 coreconfigitem(
1451 coreconfigitem(
1435 b'shelve',
1452 b'shelve',
1436 b'store',
1453 b'store',
@@ -1281,6 +1281,7 b' class localrepository:'
1281 """
1281 """
1282
1282
1283 _basesupported = {
1283 _basesupported = {
1284 requirementsmod.ARCHIVED_PHASE_REQUIREMENT,
1284 requirementsmod.BOOKMARKS_IN_STORE_REQUIREMENT,
1285 requirementsmod.BOOKMARKS_IN_STORE_REQUIREMENT,
1285 requirementsmod.CHANGELOGV2_REQUIREMENT,
1286 requirementsmod.CHANGELOGV2_REQUIREMENT,
1286 requirementsmod.COPIESSDC_REQUIREMENT,
1287 requirementsmod.COPIESSDC_REQUIREMENT,
@@ -3664,6 +3665,10 b' def newreporequirements(ui, createopts):'
3664 if ui.configbool(b'format', b'internal-phase'):
3665 if ui.configbool(b'format', b'internal-phase'):
3665 requirements.add(requirementsmod.INTERNAL_PHASE_REQUIREMENT)
3666 requirements.add(requirementsmod.INTERNAL_PHASE_REQUIREMENT)
3666
3667
3668 # experimental config: format.exp-archived-phase
3669 if ui.configbool(b'format', b'exp-archived-phase'):
3670 requirements.add(requirementsmod.ARCHIVED_PHASE_REQUIREMENT)
3671
3667 if createopts.get(b'narrowfiles'):
3672 if createopts.get(b'narrowfiles'):
3668 requirements.add(requirementsmod.NARROW_REQUIREMENT)
3673 requirements.add(requirementsmod.NARROW_REQUIREMENT)
3669
3674
@@ -181,7 +181,7 b' def supportinternal(repo):'
181 def supportarchived(repo):
181 def supportarchived(repo):
182 # type: (localrepo.localrepository) -> bool
182 # type: (localrepo.localrepository) -> bool
183 """True if the archived phase can be used on a repository"""
183 """True if the archived phase can be used on a repository"""
184 return requirements.INTERNAL_PHASE_REQUIREMENT in repo.requirements
184 return requirements.ARCHIVED_PHASE_REQUIREMENT in repo.requirements
185
185
186
186
187 def _readroots(repo, phasedefaults=None):
187 def _readroots(repo, phasedefaults=None):
@@ -31,6 +31,10 b" SPARSE_REQUIREMENT = b'exp-sparse'"
31 # of stripping them
31 # of stripping them
32 INTERNAL_PHASE_REQUIREMENT = b'internal-phase'
32 INTERNAL_PHASE_REQUIREMENT = b'internal-phase'
33
33
34 # Enables the internal phase which is used to hide changesets instead
35 # of stripping them
36 ARCHIVED_PHASE_REQUIREMENT = b'exp-archived-phase'
37
34 # Stores manifest in Tree structure
38 # Stores manifest in Tree structure
35 TREEMANIFEST_REQUIREMENT = b'treemanifest'
39 TREEMANIFEST_REQUIREMENT = b'treemanifest'
36
40
@@ -107,6 +111,7 b' WORKING_DIR_REQUIREMENTS = {'
107 #
111 #
108 # note: the list is currently inherited from previous code and miss some relevant requirement while containing some irrelevant ones.
112 # note: the list is currently inherited from previous code and miss some relevant requirement while containing some irrelevant ones.
109 STREAM_FIXED_REQUIREMENTS = {
113 STREAM_FIXED_REQUIREMENTS = {
114 ARCHIVED_PHASE_REQUIREMENT,
110 BOOKMARKS_IN_STORE_REQUIREMENT,
115 BOOKMARKS_IN_STORE_REQUIREMENT,
111 CHANGELOGV2_REQUIREMENT,
116 CHANGELOGV2_REQUIREMENT,
112 COPIESSDC_REQUIREMENT,
117 COPIESSDC_REQUIREMENT,
@@ -4,7 +4,7 b' Test features and behaviors related to t'
4
4
5 $ cat << EOF >> $HGRCPATH
5 $ cat << EOF >> $HGRCPATH
6 > [format]
6 > [format]
7 > internal-phase=yes
7 > exp-archived-phase=yes
8 > [extensions]
8 > [extensions]
9 > strip=
9 > strip=
10 > [experimental]
10 > [experimental]
@@ -951,21 +951,28 b' Test for archived phase'
951
951
952 Commit an archived changesets
952 Commit an archived changesets
953
953
954 $ cd ..
955 $ hg clone --quiet --pull internal-phase archived-phase \
956 > --config format.exp-archived-phase=yes \
957 > --config extensions.phasereport='!' \
958 > --config hooks.txnclose-phase.test=
959
960 $ cd archived-phase
961
954 $ echo B > B
962 $ echo B > B
955 $ hg add B
963 $ hg add B
956 $ hg status
964 $ hg status
957 A B
965 A B
958 $ hg --config "phases.new-commit=archived" commit -m "my test archived commit"
966 $ hg --config "phases.new-commit=archived" commit -m "my test archived commit"
959 test-debug-phase: new rev 2: x -> 32
967 test-debug-phase: new rev 1: x -> 32
960 test-hook-close-phase: 8df5997c3361518f733d1ae67cd3adb9b0eaf125: -> archived
968 test-hook-close-phase: 8df5997c3361518f733d1ae67cd3adb9b0eaf125: -> archived
961
969
962 The changeset is a working parent descendant.
970 The changeset is a working parent descendant.
963 Per the usual visibility rules, it is made visible.
971 Per the usual visibility rules, it is made visible.
964
972
965 $ hg log -G -l 3
973 $ hg log -G -l 3
966 @ changeset: 2:8df5997c3361
974 @ changeset: 1:8df5997c3361
967 | tag: tip
975 | tag: tip
968 | parent: 0:4a2df7238c3b
969 | user: test
976 | user: test
970 | date: Thu Jan 01 00:00:00 1970 +0000
977 | date: Thu Jan 01 00:00:00 1970 +0000
971 | summary: my test archived commit
978 | summary: my test archived commit
General Comments 0
You need to be logged in to leave comments. Login now