##// END OF EJS Templates
localrepo: subclass the new `repository.ipeercommandexecutor` Protocol class...
localrepo: subclass the new `repository.ipeercommandexecutor` Protocol class This is the same transformation as 3a90a6fd710d did for dirstate, but the CamelCase naming was already cleaned up here. See 4ef6dbc27a99 for the benefits of explicit subclassing. Since we're direct subclassing here and there are only a few methods on this interface, also make them abstract like was done in ef119f914fc1.

File last commit:

r53324:8c509a70 default
r53393:e123c8a2 default
Show More
__init__.py
46 lines | 929 B | text/x-python | PythonLexer
config: gather constant and type into the `__init__.py`...
r53322 # configuration related constants
from __future__ import annotations
from typing import (
List,
Tuple,
Union,
)
# keep typing simple for now
ConfigLevelT = str
config: include the component level when returning them...
r53323 LEVEL_BUNDLED_RESOURCE = 'RESOURCE'
LEVEL_ENV_OVERWRITE = 'ENV-HGRCPATH'
LEVEL_USER = 'user'
config: gather constant and type into the `__init__.py`...
r53322 LEVEL_LOCAL = 'local'
LEVEL_GLOBAL = 'global'
LEVEL_SHARED = 'shared'
LEVEL_NON_SHARED = 'non_shared'
config: include the component level when returning them...
r53323 # only include level that it make sense to edit
# note: "user" is the default level and never passed explicitly
config: gather constant and type into the `__init__.py`...
r53322 EDIT_LEVELS = (
LEVEL_USER,
LEVEL_LOCAL,
LEVEL_GLOBAL,
LEVEL_SHARED,
LEVEL_NON_SHARED,
)
config: gather the path to edit through rcutil...
r53324 # levels that can works without a repository
NO_REPO_EDIT_LEVELS = (
LEVEL_USER,
LEVEL_GLOBAL,
)
config: gather constant and type into the `__init__.py`...
r53322
ConfigItemT = Tuple[bytes, bytes, bytes, bytes]
ResourceIDT = Tuple[bytes, bytes]
FileRCT = bytes
ComponentT = Tuple[
config: include the component level when returning them...
r53323 ConfigLevelT,
config: gather constant and type into the `__init__.py`...
r53322 bytes,
Union[
List[ConfigItemT],
FileRCT,
ResourceIDT,
],
]