Show More
@@ -1303,6 +1303,14 b' coreconfigitem(' | |||||
1303 | experimental=True, |
|
1303 | experimental=True, | |
1304 | ) |
|
1304 | ) | |
1305 | coreconfigitem( |
|
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 | b'format', |
|
1314 | b'format', | |
1307 | b'dotencode', |
|
1315 | b'dotencode', | |
1308 | default=True, |
|
1316 | default=True, |
@@ -39,6 +39,8 b' from .interfaces import (' | |||||
39 | parsers = policy.importmod('parsers') |
|
39 | parsers = policy.importmod('parsers') | |
40 | rustmod = policy.importrust('dirstate') |
|
40 | rustmod = policy.importrust('dirstate') | |
41 |
|
41 | |||
|
42 | SUPPORTS_DIRSTATE_V2 = rustmod is not None | |||
|
43 | ||||
42 | propertycache = util.propertycache |
|
44 | propertycache = util.propertycache | |
43 | filecache = scmutil.filecache |
|
45 | filecache = scmutil.filecache | |
44 | _rangemask = 0x7FFFFFFF |
|
46 | _rangemask = 0x7FFFFFFF |
@@ -887,6 +887,9 b' def gathersupportedrequirements(ui):' | |||||
887 | # Start with all requirements supported by this file. |
|
887 | # Start with all requirements supported by this file. | |
888 | supported = set(localrepository._basesupported) |
|
888 | supported = set(localrepository._basesupported) | |
889 |
|
889 | |||
|
890 | if dirstate.SUPPORTS_DIRSTATE_V2: | |||
|
891 | supported.add(requirementsmod.DIRSTATE_V2_REQUIREMENT) | |||
|
892 | ||||
890 | # Execute ``featuresetupfuncs`` entries if they belong to an extension |
|
893 | # Execute ``featuresetupfuncs`` entries if they belong to an extension | |
891 | # relevant to this ui instance. |
|
894 | # relevant to this ui instance. | |
892 | modules = {m.__name__ for n, m in extensions.extensions(ui)} |
|
895 | modules = {m.__name__ for n, m in extensions.extensions(ui)} | |
@@ -3527,6 +3530,18 b' def newreporequirements(ui, createopts):' | |||||
3527 | if ui.configbool(b'format', b'sparse-revlog'): |
|
3530 | if ui.configbool(b'format', b'sparse-revlog'): | |
3528 | requirements.add(requirementsmod.SPARSEREVLOG_REQUIREMENT) |
|
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 | # experimental config: format.exp-use-copies-side-data-changeset |
|
3545 | # experimental config: format.exp-use-copies-side-data-changeset | |
3531 | if ui.configbool(b'format', b'exp-use-copies-side-data-changeset'): |
|
3546 | if ui.configbool(b'format', b'exp-use-copies-side-data-changeset'): | |
3532 | requirements.add(requirementsmod.CHANGELOGV2_REQUIREMENT) |
|
3547 | requirements.add(requirementsmod.CHANGELOGV2_REQUIREMENT) |
@@ -12,6 +12,8 b" DOTENCODE_REQUIREMENT = b'dotencode'" | |||||
12 | STORE_REQUIREMENT = b'store' |
|
12 | STORE_REQUIREMENT = b'store' | |
13 | FNCACHE_REQUIREMENT = b'fncache' |
|
13 | FNCACHE_REQUIREMENT = b'fncache' | |
14 |
|
14 | |||
|
15 | DIRSTATE_V2_REQUIREMENT = b'exp-dirstate-v2' | |||
|
16 | ||||
15 | # When narrowing is finalized and no longer subject to format changes, |
|
17 | # When narrowing is finalized and no longer subject to format changes, | |
16 | # we should move this to just "narrow" or similar. |
|
18 | # we should move this to just "narrow" or similar. | |
17 | NARROW_REQUIREMENT = b'narrowhg-experimental' |
|
19 | NARROW_REQUIREMENT = b'narrowhg-experimental' | |
@@ -74,9 +76,12 b" SHARESAFE_REQUIREMENT = b'share-safe'" | |||||
74 | # repo. Hence both of them should be stored in working copy |
|
76 | # repo. Hence both of them should be stored in working copy | |
75 | # * SHARESAFE_REQUIREMENT needs to be stored in working dir to mark that rest of |
|
77 | # * SHARESAFE_REQUIREMENT needs to be stored in working dir to mark that rest of | |
76 | # the requirements are stored in store's requires |
|
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 | WORKING_DIR_REQUIREMENTS = { |
|
81 | WORKING_DIR_REQUIREMENTS = { | |
78 | SPARSE_REQUIREMENT, |
|
82 | SPARSE_REQUIREMENT, | |
79 | SHARED_REQUIREMENT, |
|
83 | SHARED_REQUIREMENT, | |
80 | RELATIVE_SHARED_REQUIREMENT, |
|
84 | RELATIVE_SHARED_REQUIREMENT, | |
81 | SHARESAFE_REQUIREMENT, |
|
85 | SHARESAFE_REQUIREMENT, | |
|
86 | DIRSTATE_V2_REQUIREMENT, | |||
82 | } |
|
87 | } |
@@ -982,6 +982,7 b' def supporteddestrequirements(repo):' | |||||
982 | requirements.SHARESAFE_REQUIREMENT, |
|
982 | requirements.SHARESAFE_REQUIREMENT, | |
983 | requirements.REVLOGV2_REQUIREMENT, |
|
983 | requirements.REVLOGV2_REQUIREMENT, | |
984 | requirements.CHANGELOGV2_REQUIREMENT, |
|
984 | requirements.CHANGELOGV2_REQUIREMENT, | |
|
985 | requirements.DIRSTATE_V2_REQUIREMENT, | |||
985 | } |
|
986 | } | |
986 | for name in compression.compengines: |
|
987 | for name in compression.compengines: | |
987 | engine = compression.compengines[name] |
|
988 | engine = compression.compengines[name] |
General Comments 0
You need to be logged in to leave comments.
Login now