diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -228,6 +228,9 @@ class ui(object):
             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 --git a/tests/test-config.t b/tests/test-config.t
--- a/tests/test-config.t
+++ b/tests/test-config.t
@@ -90,3 +90,15 @@ Test exit code when no config matches
 
   $ 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