comparison mercurial/configuration/rcutil.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 e3b45916c375
children 22129ce9f86d
comparison
equal deleted inserted replaced
52455:e3b45916c375 52456:3e79ca017157
11 11
12 from typing import ( 12 from typing import (
13 Dict, 13 Dict,
14 List, 14 List,
15 Optional, 15 Optional,
16 Tuple,
17 Union,
18 ) 16 )
19 17
20 from .. import ( 18 from .. import (
19 configuration as conf_mod,
21 encoding, 20 encoding,
22 localrepo, 21 localrepo,
23 pycompat, 22 pycompat,
24 requirements as requirementsmod, 23 requirements as requirementsmod,
25 util, 24 util,
35 34
36 fallbackpager = scmplatform.fallbackpager 35 fallbackpager = scmplatform.fallbackpager
37 systemrcpath = scmplatform.systemrcpath 36 systemrcpath = scmplatform.systemrcpath
38 userrcpath = scmplatform.userrcpath 37 userrcpath = scmplatform.userrcpath
39 38
40 ConfigItemT = Tuple[bytes, bytes, bytes, bytes] 39 ComponentT = conf_mod.ComponentT
41 ResourceIDT = Tuple[bytes, bytes] 40 ConfigItemT = conf_mod.ConfigItemT
42 FileRCT = bytes 41 FileRCT = conf_mod.FileRCT
43 ComponentT = Tuple[ 42 ResourceIDT = conf_mod.ResourceIDT
44 bytes,
45 Union[
46 List[ConfigItemT],
47 FileRCT,
48 ResourceIDT,
49 ],
50 ]
51 43
52 44
53 def _expandrcpath(path: bytes) -> List[FileRCT]: 45 def _expandrcpath(path: bytes) -> List[FileRCT]:
54 '''path could be a file or a directory. return a list of file paths''' 46 '''path could be a file or a directory. return a list of file paths'''
55 p = util.expandpath(path) 47 p = util.expandpath(path)