# HG changeset patch # User Raphaël Gomès # Date 1614771329 -3600 # Node ID ab58098bebed03f0e3e5c65ede72ab4deb2148f5 # Parent c3773636ddbbf2e45f66622091f6dc92eb813af9 requirements: also add a store constant Continue the cleanup to the remaining requirements Differential Revision: https://phab.mercurial-scm.org/D10108 diff -r c3773636ddbb -r ab58098bebed mercurial/localrepo.py --- a/mercurial/localrepo.py Wed Mar 03 12:33:24 2021 +0100 +++ b/mercurial/localrepo.py Wed Mar 03 12:35:29 2021 +0100 @@ -942,7 +942,7 @@ def makestore(requirements, path, vfstype): """Construct a storage object for a repository.""" - if b'store' in requirements: + if requirementsmod.STORE_REQUIREMENT in requirements: if b'fncache' in requirements: dotencode = requirementsmod.DOTENCODE_REQUIREMENT in requirements return storemod.fncachestore(path, vfstype, dotencode) @@ -1210,7 +1210,7 @@ requirementsmod.SHARESAFE_REQUIREMENT, } _basesupported = supportedformats | { - b'store', + requirementsmod.STORE_REQUIREMENT, b'fncache', requirementsmod.SHARED_REQUIREMENT, requirementsmod.RELATIVE_SHARED_REQUIREMENT, @@ -3411,7 +3411,7 @@ requirements = {requirementsmod.REVLOGV1_REQUIREMENT} if ui.configbool(b'format', b'usestore'): - requirements.add(b'store') + requirements.add(requirementsmod.STORE_REQUIREMENT) if ui.configbool(b'format', b'usefncache'): requirements.add(b'fncache') if ui.configbool(b'format', b'dotencode'): @@ -3493,7 +3493,7 @@ dropped = set() - if b'store' not in requirements: + if requirementsmod.STORE_REQUIREMENT not in requirements: if bookmarks.BOOKMARKS_IN_STORE_REQUIREMENT in requirements: ui.warn( _( @@ -3632,7 +3632,8 @@ hgvfs.mkdir(b'cache') hgvfs.mkdir(b'wcache') - if b'store' in requirements and b'sharedrepo' not in createopts: + has_store = requirementsmod.STORE_REQUIREMENT in requirements + if has_store and b'sharedrepo' not in createopts: hgvfs.mkdir(b'store') # We create an invalid changelog outside the store so very old diff -r c3773636ddbb -r ab58098bebed mercurial/requirements.py --- a/mercurial/requirements.py Wed Mar 03 12:33:24 2021 +0100 +++ b/mercurial/requirements.py Wed Mar 03 12:35:29 2021 +0100 @@ -9,6 +9,7 @@ GENERALDELTA_REQUIREMENT = b'generaldelta' DOTENCODE_REQUIREMENT = b'dotencode' +STORE_REQUIREMENT = b'store' # When narrowing is finalized and no longer subject to format changes, # we should move this to just "narrow" or similar. diff -r c3773636ddbb -r ab58098bebed mercurial/upgrade_utils/actions.py --- a/mercurial/upgrade_utils/actions.py Wed Mar 03 12:33:24 2021 +0100 +++ b/mercurial/upgrade_utils/actions.py Wed Mar 03 12:35:29 2021 +0100 @@ -859,7 +859,7 @@ # Introduced in Mercurial 0.9.2. requirements.REVLOGV1_REQUIREMENT, # Introduced in Mercurial 0.9.2. - b'store', + requirements.STORE_REQUIREMENT, } @@ -938,7 +938,7 @@ b'fncache', requirements.GENERALDELTA_REQUIREMENT, requirements.REVLOGV1_REQUIREMENT, - b'store', + requirements.STORE_REQUIREMENT, requirements.SPARSEREVLOG_REQUIREMENT, requirements.SIDEDATA_REQUIREMENT, requirements.COPIESSDC_REQUIREMENT,