Mercurial > public > mercurial-scm > hg-stable
diff mercurial/configuration/command.py @ 52456:3e79ca017157
config: gather constant and type into the `__init__.py`
This will help using them in multiple files.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 23 Oct 2024 00:43:17 +0200 |
parents | 04c3fb885fb6 |
children | 22129ce9f86d |
line wrap: on
line diff
--- a/mercurial/configuration/command.py Wed Oct 23 01:12:52 2024 +0200 +++ b/mercurial/configuration/command.py Wed Oct 23 00:43:17 2024 +0200 @@ -19,29 +19,24 @@ vfs as vfsmod, ) -from . import rcutil +from . import ( + ConfigLevelT, + EDIT_LEVELS, + LEVEL_GLOBAL, + LEVEL_LOCAL, + LEVEL_NON_SHARED, + LEVEL_SHARED, + LEVEL_USER, + rcutil, +) EDIT_FLAG = 'edit' -# keep typing simple for now -ConfigLevelT = str -LEVEL_USER = 'user' # "user" is the default level and never passed explicitly -LEVEL_LOCAL = 'local' -LEVEL_GLOBAL = 'global' -LEVEL_SHARED = 'shared' -LEVEL_NON_SHARED = 'non_shared' -EDIT_LEVELS = ( - LEVEL_USER, - LEVEL_LOCAL, - LEVEL_GLOBAL, - LEVEL_SHARED, - LEVEL_NON_SHARED, -) - - def find_edit_level( - ui: uimod.ui, repo, opts: Dict[str, Any] + ui: uimod.ui, + repo, + opts: Dict[str, Any], ) -> Optional[ConfigLevelT]: """return the level we should edit, if any.