comparison mercurial/configuration/__init__.py @ 52426:22129ce9f86d

config: include the component level when returning them This will be useful when modifying them.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 23 Oct 2024 01:32:33 +0200
parents 3e79ca017157
children 8c509a70b6fa
comparison
equal deleted inserted replaced
52425:3e79ca017157 52426:22129ce9f86d
8 Union, 8 Union,
9 ) 9 )
10 10
11 # keep typing simple for now 11 # keep typing simple for now
12 ConfigLevelT = str 12 ConfigLevelT = str
13 LEVEL_USER = 'user' # "user" is the default level and never passed explicitly 13 LEVEL_BUNDLED_RESOURCE = 'RESOURCE'
14 LEVEL_ENV_OVERWRITE = 'ENV-HGRCPATH'
15 LEVEL_USER = 'user'
14 LEVEL_LOCAL = 'local' 16 LEVEL_LOCAL = 'local'
15 LEVEL_GLOBAL = 'global' 17 LEVEL_GLOBAL = 'global'
16 LEVEL_SHARED = 'shared' 18 LEVEL_SHARED = 'shared'
17 LEVEL_NON_SHARED = 'non_shared' 19 LEVEL_NON_SHARED = 'non_shared'
20 # only include level that it make sense to edit
21 # note: "user" is the default level and never passed explicitly
18 EDIT_LEVELS = ( 22 EDIT_LEVELS = (
19 LEVEL_USER, 23 LEVEL_USER,
20 LEVEL_LOCAL, 24 LEVEL_LOCAL,
21 LEVEL_GLOBAL, 25 LEVEL_GLOBAL,
22 LEVEL_SHARED, 26 LEVEL_SHARED,
25 29
26 ConfigItemT = Tuple[bytes, bytes, bytes, bytes] 30 ConfigItemT = Tuple[bytes, bytes, bytes, bytes]
27 ResourceIDT = Tuple[bytes, bytes] 31 ResourceIDT = Tuple[bytes, bytes]
28 FileRCT = bytes 32 FileRCT = bytes
29 ComponentT = Tuple[ 33 ComponentT = Tuple[
34 ConfigLevelT,
30 bytes, 35 bytes,
31 Union[ 36 Union[
32 List[ConfigItemT], 37 List[ConfigItemT],
33 FileRCT, 38 FileRCT,
34 ResourceIDT, 39 ResourceIDT,