##// END OF EJS Templates
hgrc: introduce HGRCSKIPREPO to skip reading the repository's hgrc...
marmoute -
r44583:d56a2d6f default
parent child Browse files
Show More
@@ -49,6 +49,9 b' HGRCPATH'
49 - if it's a directory, all files ending with .rc are added
49 - if it's a directory, all files ending with .rc are added
50 - otherwise, the file itself will be added
50 - otherwise, the file itself will be added
51
51
52 HGRCSKIPREPO
53 When set, the .hg/hgrc from repositories are not read.
54
52 HGPLAIN
55 HGPLAIN
53 When set, this disables any configuration settings that might
56 When set, this disables any configuration settings that might
54 change Mercurial's default output. This includes encoding,
57 change Mercurial's default output. This includes encoding,
@@ -74,6 +74,14 b' HGRCPATH'
74 like the username and extensions that may be required to interface
74 like the username and extensions that may be required to interface
75 with a repository.
75 with a repository.
76
76
77 HGRCSKIPREPO
78 When set, the .hg/hgrc from repositories are not read.
79
80 Note that not reading the repository's configuration can have
81 unintended consequences, as the repository config files can define
82 things like extensions that are required for access to the
83 repository.
84
77 Command-line Flags
85 Command-line Flags
78 ==================
86 ==================
79
87
@@ -676,6 +676,8 b' def loadhgrc(ui, wdirvfs, hgvfs, require'
676 configs are loaded. For example, an extension may wish to pull in
676 configs are loaded. For example, an extension may wish to pull in
677 configs from alternate files or sources.
677 configs from alternate files or sources.
678 """
678 """
679 if b'HGRCSKIPREPO' in encoding.environ:
680 return False
679 try:
681 try:
680 ui.readconfig(hgvfs.join(b'hgrc'), root=wdirvfs.base)
682 ui.readconfig(hgvfs.join(b'hgrc'), root=wdirvfs.base)
681 return True
683 return True
@@ -258,3 +258,16 b' source of paths is not mangled'
258 plain: True
258 plain: True
259 read config from: $TESTTMP/hgrc
259 read config from: $TESTTMP/hgrc
260 $TESTTMP/hgrc:17: paths.foo=$TESTTMP/bar
260 $TESTTMP/hgrc:17: paths.foo=$TESTTMP/bar
261
262 Test we can skip the user configuration
263
264 $ cat >> .hg/hgrc <<EOF
265 > [paths]
266 > elephant = babar
267 > EOF
268 $ hg path
269 elephant = $TESTTMP/babar
270 foo = $TESTTMP/bar
271 $ HGRCSKIPREPO=1 hg path
272 foo = $TESTTMP/bar
273
General Comments 0
You need to be logged in to leave comments. Login now