##// END OF EJS Templates
dirstate-v2: Add a new experimental `exp-dirstate-v2` repository requirement...
Simon Sapin -
r48052:ed0d54b2 default
parent child Browse files
Show More
@@ -1303,6 +1303,14 b' coreconfigitem('
1303 1303 experimental=True,
1304 1304 )
1305 1305 coreconfigitem(
1306 # Enable this dirstate format *when creating a new repository*.
1307 # Which format to use for existing repos is controlled by .hg/requires
1308 b'format',
1309 b'exp-dirstate-v2',
1310 default=False,
1311 experimental=True,
1312 )
1313 coreconfigitem(
1306 1314 b'format',
1307 1315 b'dotencode',
1308 1316 default=True,
@@ -39,6 +39,8 b' from .interfaces import ('
39 39 parsers = policy.importmod('parsers')
40 40 rustmod = policy.importrust('dirstate')
41 41
42 SUPPORTS_DIRSTATE_V2 = rustmod is not None
43
42 44 propertycache = util.propertycache
43 45 filecache = scmutil.filecache
44 46 _rangemask = 0x7FFFFFFF
@@ -887,6 +887,9 b' def gathersupportedrequirements(ui):'
887 887 # Start with all requirements supported by this file.
888 888 supported = set(localrepository._basesupported)
889 889
890 if dirstate.SUPPORTS_DIRSTATE_V2:
891 supported.add(requirementsmod.DIRSTATE_V2_REQUIREMENT)
892
890 893 # Execute ``featuresetupfuncs`` entries if they belong to an extension
891 894 # relevant to this ui instance.
892 895 modules = {m.__name__ for n, m in extensions.extensions(ui)}
@@ -3527,6 +3530,18 b' def newreporequirements(ui, createopts):'
3527 3530 if ui.configbool(b'format', b'sparse-revlog'):
3528 3531 requirements.add(requirementsmod.SPARSEREVLOG_REQUIREMENT)
3529 3532
3533 # experimental config: format.exp-dirstate-v2
3534 if ui.configbool(b'format', b'exp-dirstate-v2'):
3535 if dirstate.SUPPORTS_DIRSTATE_V2:
3536 requirements.add(requirementsmod.DIRSTATE_V2_REQUIREMENT)
3537 else:
3538 raise error.Abort(
3539 _(
3540 b"dirstate v2 format requested by config "
3541 b"but not supported (requires Rust extensions)"
3542 )
3543 )
3544
3530 3545 # experimental config: format.exp-use-copies-side-data-changeset
3531 3546 if ui.configbool(b'format', b'exp-use-copies-side-data-changeset'):
3532 3547 requirements.add(requirementsmod.CHANGELOGV2_REQUIREMENT)
@@ -12,6 +12,8 b" DOTENCODE_REQUIREMENT = b'dotencode'"
12 12 STORE_REQUIREMENT = b'store'
13 13 FNCACHE_REQUIREMENT = b'fncache'
14 14
15 DIRSTATE_V2_REQUIREMENT = b'exp-dirstate-v2'
16
15 17 # When narrowing is finalized and no longer subject to format changes,
16 18 # we should move this to just "narrow" or similar.
17 19 NARROW_REQUIREMENT = b'narrowhg-experimental'
@@ -74,9 +76,12 b" SHARESAFE_REQUIREMENT = b'share-safe'"
74 76 # repo. Hence both of them should be stored in working copy
75 77 # * SHARESAFE_REQUIREMENT needs to be stored in working dir to mark that rest of
76 78 # the requirements are stored in store's requires
79 # * DIRSTATE_V2_REQUIREMENT affects .hg/dirstate, of which there is one per
80 # working directory.
77 81 WORKING_DIR_REQUIREMENTS = {
78 82 SPARSE_REQUIREMENT,
79 83 SHARED_REQUIREMENT,
80 84 RELATIVE_SHARED_REQUIREMENT,
81 85 SHARESAFE_REQUIREMENT,
86 DIRSTATE_V2_REQUIREMENT,
82 87 }
@@ -982,6 +982,7 b' def supporteddestrequirements(repo):'
982 982 requirements.SHARESAFE_REQUIREMENT,
983 983 requirements.REVLOGV2_REQUIREMENT,
984 984 requirements.CHANGELOGV2_REQUIREMENT,
985 requirements.DIRSTATE_V2_REQUIREMENT,
985 986 }
986 987 for name in compression.compengines:
987 988 engine = compression.compengines[name]
General Comments 0
You need to be logged in to leave comments. Login now