Comments
Patch
@@ -258,3 +258,16 @@
plain: True
read config from: $TESTTMP/hgrc
$TESTTMP/hgrc:17: paths.foo=$TESTTMP/bar
+
+Test we can skip the user configuration
+
+ $ cat >> .hg/hgrc <<EOF
+ > [paths]
+ > elephant = babar
+ > EOF
+ $ hg path
+ elephant = $TESTTMP/babar
+ foo = $TESTTMP/bar
+ $ HGRCSKIPREPO=1 hg path
+ foo = $TESTTMP/bar
+
@@ -676,6 +676,8 @@
configs are loaded. For example, an extension may wish to pull in
configs from alternate files or sources.
"""
+ if b'HGRCSKIPREPO' in encoding.environ:
+ return False
try:
ui.readconfig(hgvfs.join(b'hgrc'), root=wdirvfs.base)
return True
@@ -74,6 +74,14 @@
like the username and extensions that may be required to interface
with a repository.
+HGRCSKIPREPO
+ When set, the .hg/hgrc from repositories are not read.
+
+ Note that not reading the repository's configuration can have
+ unintended consequences, as the repository config files can define
+ things like extensions that are required for access to the
+ repository.
+
Command-line Flags
==================
@@ -49,6 +49,9 @@
- if it's a directory, all files ending with .rc are added
- otherwise, the file itself will be added
+HGRCSKIPREPO
+ When set, the .hg/hgrc from repositories are not read.
+
HGPLAIN
When set, this disables any configuration settings that might
change Mercurial's default output. This includes encoding,