Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 46626:ee91966aec0f
requirements: add constant for revlog v1 requirement
Since this series is adding a new requirement, we might as well clean up while
we're here.
Differential Revision: https://phab.mercurial-scm.org/D10105
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Wed, 03 Mar 2021 14:00:45 +0100 |
parents | e9901d01d135 |
children | f4c325bf80fc |
comparison
equal
deleted
inserted
replaced
46625:3941fe53670d | 46626:ee91966aec0f |
---|---|
972 # requirement, we have to assume the repo is using revlog version 0. | 972 # requirement, we have to assume the repo is using revlog version 0. |
973 # This revlog format is super old and we don't bother trying to parse | 973 # This revlog format is super old and we don't bother trying to parse |
974 # opener options for it because those options wouldn't do anything | 974 # opener options for it because those options wouldn't do anything |
975 # meaningful on such old repos. | 975 # meaningful on such old repos. |
976 if ( | 976 if ( |
977 b'revlogv1' in requirements | 977 requirementsmod.REVLOGV1_REQUIREMENT in requirements |
978 or requirementsmod.REVLOGV2_REQUIREMENT in requirements | 978 or requirementsmod.REVLOGV2_REQUIREMENT in requirements |
979 ): | 979 ): |
980 options.update(resolverevlogstorevfsoptions(ui, requirements, features)) | 980 options.update(resolverevlogstorevfsoptions(ui, requirements, features)) |
981 else: # explicitly mark repo as using revlogv0 | 981 else: # explicitly mark repo as using revlogv0 |
982 options[b'revlogv0'] = True | 982 options[b'revlogv0'] = True |
996 """Resolve opener options specific to revlogs.""" | 996 """Resolve opener options specific to revlogs.""" |
997 | 997 |
998 options = {} | 998 options = {} |
999 options[b'flagprocessors'] = {} | 999 options[b'flagprocessors'] = {} |
1000 | 1000 |
1001 if b'revlogv1' in requirements: | 1001 if requirementsmod.REVLOGV1_REQUIREMENT in requirements: |
1002 options[b'revlogv1'] = True | 1002 options[b'revlogv1'] = True |
1003 if requirementsmod.REVLOGV2_REQUIREMENT in requirements: | 1003 if requirementsmod.REVLOGV2_REQUIREMENT in requirements: |
1004 options[b'revlogv2'] = True | 1004 options[b'revlogv2'] = True |
1005 | 1005 |
1006 if b'generaldelta' in requirements: | 1006 if b'generaldelta' in requirements: |
1197 # - manifestv2: An experimental new manifest format that allowed | 1197 # - manifestv2: An experimental new manifest format that allowed |
1198 # for stem compression of long paths. Experiment ended up not | 1198 # for stem compression of long paths. Experiment ended up not |
1199 # being successful (repository sizes went up due to worse delta | 1199 # being successful (repository sizes went up due to worse delta |
1200 # chains), and the code was deleted in 4.6. | 1200 # chains), and the code was deleted in 4.6. |
1201 supportedformats = { | 1201 supportedformats = { |
1202 b'revlogv1', | 1202 requirementsmod.REVLOGV1_REQUIREMENT, |
1203 b'generaldelta', | 1203 b'generaldelta', |
1204 requirementsmod.TREEMANIFEST_REQUIREMENT, | 1204 requirementsmod.TREEMANIFEST_REQUIREMENT, |
1205 requirementsmod.COPIESSDC_REQUIREMENT, | 1205 requirementsmod.COPIESSDC_REQUIREMENT, |
1206 requirementsmod.REVLOGV2_REQUIREMENT, | 1206 requirementsmod.REVLOGV2_REQUIREMENT, |
1207 requirementsmod.SIDEDATA_REQUIREMENT, | 1207 requirementsmod.SIDEDATA_REQUIREMENT, |
3408 b'storage backend: %s' | 3408 b'storage backend: %s' |
3409 ) | 3409 ) |
3410 % createopts[b'backend'] | 3410 % createopts[b'backend'] |
3411 ) | 3411 ) |
3412 | 3412 |
3413 requirements = {b'revlogv1'} | 3413 requirements = {requirementsmod.REVLOGV1_REQUIREMENT} |
3414 if ui.configbool(b'format', b'usestore'): | 3414 if ui.configbool(b'format', b'usestore'): |
3415 requirements.add(b'store') | 3415 requirements.add(b'store') |
3416 if ui.configbool(b'format', b'usefncache'): | 3416 if ui.configbool(b'format', b'usefncache'): |
3417 requirements.add(b'fncache') | 3417 requirements.add(b'fncache') |
3418 if ui.configbool(b'format', b'dotencode'): | 3418 if ui.configbool(b'format', b'dotencode'): |
3456 if ui.configbool(b'experimental', b'treemanifest'): | 3456 if ui.configbool(b'experimental', b'treemanifest'): |
3457 requirements.add(requirementsmod.TREEMANIFEST_REQUIREMENT) | 3457 requirements.add(requirementsmod.TREEMANIFEST_REQUIREMENT) |
3458 | 3458 |
3459 revlogv2 = ui.config(b'experimental', b'revlogv2') | 3459 revlogv2 = ui.config(b'experimental', b'revlogv2') |
3460 if revlogv2 == b'enable-unstable-format-and-corrupt-my-data': | 3460 if revlogv2 == b'enable-unstable-format-and-corrupt-my-data': |
3461 requirements.remove(b'revlogv1') | 3461 requirements.remove(requirementsmod.REVLOGV1_REQUIREMENT) |
3462 # generaldelta is implied by revlogv2. | 3462 # generaldelta is implied by revlogv2. |
3463 requirements.discard(b'generaldelta') | 3463 requirements.discard(b'generaldelta') |
3464 requirements.add(requirementsmod.REVLOGV2_REQUIREMENT) | 3464 requirements.add(requirementsmod.REVLOGV2_REQUIREMENT) |
3465 # experimental config: format.internal-phase | 3465 # experimental config: format.internal-phase |
3466 if ui.configbool(b'format', b'internal-phase'): | 3466 if ui.configbool(b'format', b'internal-phase'): |