Mercurial > public > mercurial-scm > hg-stable
diff mercurial/localrepo.py @ 46665: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 |
line wrap: on
line diff
--- a/mercurial/localrepo.py Thu Feb 18 15:07:45 2021 +0100 +++ b/mercurial/localrepo.py Wed Mar 03 14:00:45 2021 +0100 @@ -974,7 +974,7 @@ # opener options for it because those options wouldn't do anything # meaningful on such old repos. if ( - b'revlogv1' in requirements + requirementsmod.REVLOGV1_REQUIREMENT in requirements or requirementsmod.REVLOGV2_REQUIREMENT in requirements ): options.update(resolverevlogstorevfsoptions(ui, requirements, features)) @@ -998,7 +998,7 @@ options = {} options[b'flagprocessors'] = {} - if b'revlogv1' in requirements: + if requirementsmod.REVLOGV1_REQUIREMENT in requirements: options[b'revlogv1'] = True if requirementsmod.REVLOGV2_REQUIREMENT in requirements: options[b'revlogv2'] = True @@ -1199,7 +1199,7 @@ # being successful (repository sizes went up due to worse delta # chains), and the code was deleted in 4.6. supportedformats = { - b'revlogv1', + requirementsmod.REVLOGV1_REQUIREMENT, b'generaldelta', requirementsmod.TREEMANIFEST_REQUIREMENT, requirementsmod.COPIESSDC_REQUIREMENT, @@ -3410,7 +3410,7 @@ % createopts[b'backend'] ) - requirements = {b'revlogv1'} + requirements = {requirementsmod.REVLOGV1_REQUIREMENT} if ui.configbool(b'format', b'usestore'): requirements.add(b'store') if ui.configbool(b'format', b'usefncache'): @@ -3458,7 +3458,7 @@ revlogv2 = ui.config(b'experimental', b'revlogv2') if revlogv2 == b'enable-unstable-format-and-corrupt-my-data': - requirements.remove(b'revlogv1') + requirements.remove(requirementsmod.REVLOGV1_REQUIREMENT) # generaldelta is implied by revlogv2. requirements.discard(b'generaldelta') requirements.add(requirementsmod.REVLOGV2_REQUIREMENT)