##// END OF EJS Templates
config: also respect HGRCSKIPREPO in `dispatch._getlocal`...
marmoute -
r44728:ef11dfc5 stable
parent child Browse files
Show More
@@ -37,6 +37,7 b' from . import ('
37 hook,
37 hook,
38 profiling,
38 profiling,
39 pycompat,
39 pycompat,
40 rcutil,
40 registrar,
41 registrar,
41 scmutil,
42 scmutil,
42 ui as uimod,
43 ui as uimod,
@@ -902,17 +903,20 b' def _getlocal(ui, rpath, wd=None):'
902 _(b"error getting current working directory: %s")
903 _(b"error getting current working directory: %s")
903 % encoding.strtolocal(e.strerror)
904 % encoding.strtolocal(e.strerror)
904 )
905 )
906
905 path = cmdutil.findrepo(wd) or b""
907 path = cmdutil.findrepo(wd) or b""
906 if not path:
908 if not path:
907 lui = ui
909 lui = ui
908 else:
910 else:
909 lui = ui.copy()
911 lui = ui.copy()
910 lui.readconfig(os.path.join(path, b".hg", b"hgrc"), path)
912 if rcutil.use_repo_hgrc():
913 lui.readconfig(os.path.join(path, b".hg", b"hgrc"), path)
911
914
912 if rpath:
915 if rpath:
913 path = lui.expandpath(rpath)
916 path = lui.expandpath(rpath)
914 lui = ui.copy()
917 lui = ui.copy()
915 lui.readconfig(os.path.join(path, b".hg", b"hgrc"), path)
918 if rcutil.use_repo_hgrc():
919 lui.readconfig(os.path.join(path, b".hg", b"hgrc"), path)
916
920
917 return path, lui
921 return path, lui
918
922
@@ -271,3 +271,13 b' Test we can skip the user configuration'
271 $ HGRCSKIPREPO=1 hg path
271 $ HGRCSKIPREPO=1 hg path
272 foo = $TESTTMP/bar
272 foo = $TESTTMP/bar
273
273
274 $ cat >> .hg/hgrc <<EOF
275 > [broken
276 > EOF
277
278 $ hg path
279 hg: parse error at $TESTTMP/.hg/hgrc:3: [broken
280 [255]
281 $ HGRCSKIPREPO=1 hg path
282 foo = $TESTTMP/bar
283
General Comments 0
You need to be logged in to leave comments. Login now