Mercurial > hg-stable
changeset 44163:eecc005229ff stable
config: also respect HGRCSKIPREPO in the zeroconf extension
Differential Revision: https://phab.mercurial-scm.org/D8075
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 04 Feb 2020 12:07:37 +0100 |
parents | bf23d6ee7ec7 |
children | c443b9ba6f63 |
files | hgext/zeroconf/__init__.py tests/test-hgrc.t |
diffstat | 2 files changed, 11 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/zeroconf/__init__.py Tue Feb 04 12:07:42 2020 +0100 +++ b/hgext/zeroconf/__init__.py Tue Feb 04 12:07:37 2020 +0100 @@ -35,6 +35,7 @@ extensions, hg, pycompat, + rcutil, ui as uimod, ) from mercurial.hgweb import server as servermod @@ -144,7 +145,8 @@ prefix = app.ui.config(b"web", b"prefix", b"").strip(b'/') + b'/' for repo, path in repos: u = app.ui.copy() - u.readconfig(os.path.join(path, b'.hg', b'hgrc')) + if rcutil.use_repo_hgrc(): + u.readconfig(os.path.join(path, b'.hg', b'hgrc')) name = os.path.basename(repo) path = (prefix + repo).strip(b'/') desc = u.config(b'web', b'description')
--- a/tests/test-hgrc.t Tue Feb 04 12:07:42 2020 +0100 +++ b/tests/test-hgrc.t Tue Feb 04 12:07:37 2020 +0100 @@ -299,3 +299,11 @@ $ killdaemons.py $ cat access.log $ cat errors.log + +Check that zeroconf respect HGRCSKIPREPO=1 + + $ hg paths --config extensions.zeroconf= + hg: parse error at $TESTTMP/.hg/hgrc:3: [broken + [255] + $ HGRCSKIPREPO=1 hg paths --config extensions.zeroconf= + foo = $TESTTMP/bar