##// END OF EJS Templates
repository: introduce constant for internal phase repo requirement and use it...
Pulkit Goyal -
r45915:f025b97f default
parent child Browse files
Show More
@@ -18,6 +18,10 b" NARROW_REQUIREMENT = b'narrowhg-experime"
18 # Enables sparse working directory usage
18 # Enables sparse working directory usage
19 SPARSE_REQUIREMENT = b'exp-sparse'
19 SPARSE_REQUIREMENT = b'exp-sparse'
20
20
21 # Enables the internal phase which is used to hide changesets instead
22 # of stripping them
23 INTERNAL_PHASE_REQUIREMENT = b'internal-phase'
24
21 # Local repository feature string.
25 # Local repository feature string.
22
26
23 # Revlogs are being used for file storage.
27 # Revlogs are being used for file storage.
@@ -1068,7 +1068,7 b' class localrepository(object):'
1068 b'relshared',
1068 b'relshared',
1069 b'dotencode',
1069 b'dotencode',
1070 repository.SPARSE_REQUIREMENT,
1070 repository.SPARSE_REQUIREMENT,
1071 b'internal-phase',
1071 repository.INTERNAL_PHASE_REQUIREMENT,
1072 }
1072 }
1073
1073
1074 # list of prefix for file which can be written without 'wlock'
1074 # list of prefix for file which can be written without 'wlock'
@@ -3324,7 +3324,7 b' def newreporequirements(ui, createopts):'
3324 requirements.add(REVLOGV2_REQUIREMENT)
3324 requirements.add(REVLOGV2_REQUIREMENT)
3325 # experimental config: format.internal-phase
3325 # experimental config: format.internal-phase
3326 if ui.configbool(b'format', b'internal-phase'):
3326 if ui.configbool(b'format', b'internal-phase'):
3327 requirements.add(b'internal-phase')
3327 requirements.add(repository.INTERNAL_PHASE_REQUIREMENT)
3328
3328
3329 if createopts.get(b'narrowfiles'):
3329 if createopts.get(b'narrowfiles'):
3330 requirements.add(repository.NARROW_REQUIREMENT)
3330 requirements.add(repository.NARROW_REQUIREMENT)
@@ -125,6 +125,7 b' from . import ('
125 txnutil,
125 txnutil,
126 util,
126 util,
127 )
127 )
128 from .interfaces import repository
128
129
129 _fphasesentry = struct.Struct(b'>i20s')
130 _fphasesentry = struct.Struct(b'>i20s')
130
131
@@ -154,7 +155,7 b' localhiddenphases = (internal, archived)'
154
155
155 def supportinternal(repo):
156 def supportinternal(repo):
156 """True if the internal phase can be used on a repository"""
157 """True if the internal phase can be used on a repository"""
157 return b'internal-phase' in repo.requirements
158 return repository.INTERNAL_PHASE_REQUIREMENT in repo.requirements
158
159
159
160
160 def _readroots(repo, phasedefaults=None):
161 def _readroots(repo, phasedefaults=None):
General Comments 0
You need to be logged in to leave comments. Login now