Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Path | Packages | |||
---|---|---|---|---|
M | hgext/zeroconf/__init__.py (4 lines) | |||
M | tests/test-hgrc.t (8 lines) |
from . import Zeroconf | from . import Zeroconf | ||||
from mercurial import ( | from mercurial import ( | ||||
dispatch, | dispatch, | ||||
encoding, | encoding, | ||||
extensions, | extensions, | ||||
hg, | hg, | ||||
pycompat, | pycompat, | ||||
rcutil, | |||||
ui as uimod, | ui as uimod, | ||||
) | ) | ||||
from mercurial.hgweb import server as servermod | from mercurial.hgweb import server as servermod | ||||
# Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for | # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for | ||||
# extensions which SHIP WITH MERCURIAL. Non-mainline extensions should | # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should | ||||
# be specifying the version(s) of Mercurial they are tested with, or | # be specifying the version(s) of Mercurial they are tested with, or | ||||
# leave the attribute unspecified. | # leave the attribute unspecified. | ||||
if not desc: | if not desc: | ||||
desc = name | desc = name | ||||
publish(name, desc, path, port) | publish(name, desc, path, port) | ||||
else: | else: | ||||
# webdir | # webdir | ||||
prefix = app.ui.config(b"web", b"prefix", b"").strip(b'/') + b'/' | prefix = app.ui.config(b"web", b"prefix", b"").strip(b'/') + b'/' | ||||
for repo, path in repos: | for repo, path in repos: | ||||
u = app.ui.copy() | u = app.ui.copy() | ||||
if rcutil.use_repo_hgrc(): | |||||
u.readconfig(os.path.join(path, b'.hg', b'hgrc')) | u.readconfig(os.path.join(path, b'.hg', b'hgrc')) | ||||
name = os.path.basename(repo) | name = os.path.basename(repo) | ||||
path = (prefix + repo).strip(b'/') | path = (prefix + repo).strip(b'/') | ||||
desc = u.config(b'web', b'description') | desc = u.config(b'web', b'description') | ||||
if not desc: | if not desc: | ||||
desc = name | desc = name | ||||
publish(name, desc, path, port) | publish(name, desc, path, port) | ||||
return httpd | return httpd | ||||
$ test -f errors.log && cat errors.log | $ test -f errors.log && cat errors.log | ||||
[1] | [1] | ||||
$ HGRCSKIPREPO=1 hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log | $ HGRCSKIPREPO=1 hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log | ||||
$ cat hg.pid >> $DAEMON_PIDS | $ cat hg.pid >> $DAEMON_PIDS | ||||
$ killdaemons.py | $ killdaemons.py | ||||
$ cat access.log | $ cat access.log | ||||
$ cat errors.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 |