Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/configuration/rcutil.py @ 52455:e3b45916c375
config: return component from `repo_components`
We used to returns just paths. However using the same return types as
`rccomponents` will be quite useful later in this series.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 23 Oct 2024 01:12:52 +0200 |
parents | 0b791c90280a |
children | 3e79ca017157 |
comparison
equal
deleted
inserted
replaced
52454:0b791c90280a | 52455:e3b45916c375 |
---|---|
150 except IOError: | 150 except IOError: |
151 pass | 151 pass |
152 return [] | 152 return [] |
153 | 153 |
154 | 154 |
155 def repo_components(repo_path: bytes) -> List[FileRCT]: | 155 def repo_components(repo_path: bytes) -> List[ComponentT]: |
156 """return the list of config file to read for a repository""" | 156 """return the list of config file to read for a repository""" |
157 components = [] | 157 components = [] |
158 components.extend(_shared_source_component(repo_path)) | 158 components.extend(_shared_source_component(repo_path)) |
159 components.append(os.path.join(repo_path, b".hg", b"hgrc")) | 159 components.append(os.path.join(repo_path, b".hg", b"hgrc")) |
160 components.append(os.path.join(repo_path, b".hg", b"hgrc-not-shared")) | 160 components.append(os.path.join(repo_path, b".hg", b"hgrc-not-shared")) |
161 return components | 161 return [(b'path', c) for c in components] |
162 | 162 |
163 | 163 |
164 def defaultpagerenv() -> Dict[bytes, bytes]: | 164 def defaultpagerenv() -> Dict[bytes, bytes]: |
165 """return a dict of default environment variables and their values, | 165 """return a dict of default environment variables and their values, |
166 intended to be set before starting a pager. | 166 intended to be set before starting a pager. |