##// END OF EJS Templates
config: also respect HGRCSKIPREPO in hgwebdir_mod...
marmoute -
r44729:bf23d6ee stable
parent child Browse files
Show More
@@ -35,6 +35,7 b' from .. import ('
35 pathutil,
35 pathutil,
36 profiling,
36 profiling,
37 pycompat,
37 pycompat,
38 rcutil,
38 registrar,
39 registrar,
39 scmutil,
40 scmutil,
40 templater,
41 templater,
@@ -192,11 +193,12 b' def rawindexentries(ui, repos, req, subd'
192 continue
193 continue
193
194
194 u = ui.copy()
195 u = ui.copy()
195 try:
196 if rcutil.use_repo_hgrc():
196 u.readconfig(os.path.join(path, b'.hg', b'hgrc'))
197 try:
197 except Exception as e:
198 u.readconfig(os.path.join(path, b'.hg', b'hgrc'))
198 u.warn(_(b'error reading %s/.hg/hgrc: %s\n') % (path, e))
199 except Exception as e:
199 continue
200 u.warn(_(b'error reading %s/.hg/hgrc: %s\n') % (path, e))
201 continue
200
202
201 def get(section, name, default=uimod._unset):
203 def get(section, name, default=uimod._unset):
202 return u.config(section, name, default, untrusted=True)
204 return u.config(section, name, default, untrusted=True)
@@ -281,3 +281,21 b' Test we can skip the user configuration'
281 $ HGRCSKIPREPO=1 hg path
281 $ HGRCSKIPREPO=1 hg path
282 foo = $TESTTMP/bar
282 foo = $TESTTMP/bar
283
283
284 Check that hgweb respect HGRCSKIPREPO=1
285
286 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
287 hg: parse error at $TESTTMP/.hg/hgrc:3: [broken
288 [255]
289 $ test -f hg.pid && (cat hg.pid >> $DAEMON_PIDS)
290 [1]
291 $ killdaemons.py
292 $ test -f access.log && cat access.log
293 [1]
294 $ test -f errors.log && cat errors.log
295 [1]
296
297 $ HGRCSKIPREPO=1 hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
298 $ cat hg.pid >> $DAEMON_PIDS
299 $ killdaemons.py
300 $ cat access.log
301 $ cat errors.log
General Comments 0
You need to be logged in to leave comments. Login now