# HG changeset patch # User Gregory Szorc # Date 1466904914 25200 # Node ID b62bce819d0cafcd94e3838e97062b42c9cb13b2 # Parent e1778b9c8d5354c3f37c36067fc0d6193fb0d789 ui: don't fixup [paths] sub-options As part of developing a subsequent patch I discovered that sub-option values like "." were getting converted to paths. This is because the [paths] section is treated specially during config loading. This patch prevents post-processing sub-options from the [paths] section. diff -r e1778b9c8d53 -r b62bce819d0c mercurial/ui.py --- a/mercurial/ui.py Sat Jun 25 07:26:43 2016 -0700 +++ b/mercurial/ui.py Sat Jun 25 18:35:14 2016 -0700 @@ -228,6 +228,9 @@ root = root or os.getcwd() for c in self._tcfg, self._ucfg, self._ocfg: for n, p in c.items('paths'): + # Ignore sub-options. + if ':' in n: + continue if not p: continue if '%%' in p: diff -r e1778b9c8d53 -r b62bce819d0c tests/test-config.t --- a/tests/test-config.t Sat Jun 25 07:26:43 2016 -0700 +++ b/tests/test-config.t Sat Jun 25 18:35:14 2016 -0700 @@ -90,3 +90,15 @@ $ hg config Section.idontexist [1] + +sub-options in [paths] aren't expanded + + $ cat > .hg/hgrc << EOF + > [paths] + > foo = ~/foo + > foo:suboption = ~/foo + > EOF + + $ hg showconfig paths + paths.foo:suboption=~/foo + paths.foo=$TESTTMP/foo