Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/localrepo.py @ 45391:e58e234096de
repository: introduce constant for treemanifest requirement and use it
In future we will like to much cleaner logic around which requirement is for
working copy and which can go in store. To start with that, we first need to
de-clutter the requirement values spread around and replace them with constants.
Differential Revision: https://phab.mercurial-scm.org/D8916
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sat, 08 Aug 2020 15:48:17 +0530 |
parents | f025b97f3758 |
children | 77b8588dd84e |
comparison
equal
deleted
inserted
replaced
45390:15d35f2ba474 | 45391:e58e234096de |
---|---|
844 | 844 |
845 The returned dict is used to influence behavior of the storage layer. | 845 The returned dict is used to influence behavior of the storage layer. |
846 """ | 846 """ |
847 options = {} | 847 options = {} |
848 | 848 |
849 if b'treemanifest' in requirements: | 849 if repository.TREEMANIFEST_REQUIREMENT in requirements: |
850 options[b'treemanifest'] = True | 850 options[b'treemanifest'] = True |
851 | 851 |
852 # experimental config: format.manifestcachesize | 852 # experimental config: format.manifestcachesize |
853 manifestcachesize = ui.configint(b'format', b'manifestcachesize') | 853 manifestcachesize = ui.configint(b'format', b'manifestcachesize') |
854 if manifestcachesize is not None: | 854 if manifestcachesize is not None: |
1051 # being successful (repository sizes went up due to worse delta | 1051 # being successful (repository sizes went up due to worse delta |
1052 # chains), and the code was deleted in 4.6. | 1052 # chains), and the code was deleted in 4.6. |
1053 supportedformats = { | 1053 supportedformats = { |
1054 b'revlogv1', | 1054 b'revlogv1', |
1055 b'generaldelta', | 1055 b'generaldelta', |
1056 b'treemanifest', | 1056 repository.TREEMANIFEST_REQUIREMENT, |
1057 COPIESSDC_REQUIREMENT, | 1057 COPIESSDC_REQUIREMENT, |
1058 REVLOGV2_REQUIREMENT, | 1058 REVLOGV2_REQUIREMENT, |
1059 SIDEDATA_REQUIREMENT, | 1059 SIDEDATA_REQUIREMENT, |
1060 SPARSEREVLOG_REQUIREMENT, | 1060 SPARSEREVLOG_REQUIREMENT, |
1061 NODEMAP_REQUIREMENT, | 1061 NODEMAP_REQUIREMENT, |
3312 # experimental config: format.exp-use-copies-side-data-changeset | 3312 # experimental config: format.exp-use-copies-side-data-changeset |
3313 if ui.configbool(b'format', b'exp-use-copies-side-data-changeset'): | 3313 if ui.configbool(b'format', b'exp-use-copies-side-data-changeset'): |
3314 requirements.add(SIDEDATA_REQUIREMENT) | 3314 requirements.add(SIDEDATA_REQUIREMENT) |
3315 requirements.add(COPIESSDC_REQUIREMENT) | 3315 requirements.add(COPIESSDC_REQUIREMENT) |
3316 if ui.configbool(b'experimental', b'treemanifest'): | 3316 if ui.configbool(b'experimental', b'treemanifest'): |
3317 requirements.add(b'treemanifest') | 3317 requirements.add(repository.TREEMANIFEST_REQUIREMENT) |
3318 | 3318 |
3319 revlogv2 = ui.config(b'experimental', b'revlogv2') | 3319 revlogv2 = ui.config(b'experimental', b'revlogv2') |
3320 if revlogv2 == b'enable-unstable-format-and-corrupt-my-data': | 3320 if revlogv2 == b'enable-unstable-format-and-corrupt-my-data': |
3321 requirements.remove(b'revlogv1') | 3321 requirements.remove(b'revlogv1') |
3322 # generaldelta is implied by revlogv2. | 3322 # generaldelta is implied by revlogv2. |