# HG changeset patch # User Martin Geisler # Date 1260633273 -3600 # Node ID dc5462d94a72c1ca1bb7f32bb2c9a20a0ac0c151 # Parent e95f0f70c3fd8f7580d77fe80b7caf2e8f99876f# Parent 7cdd2a7db2c2a9499c8e58926a0ebcb2b500ba15 Merge with stable diff -r e95f0f70c3fd -r dc5462d94a72 mercurial/config.py --- a/mercurial/config.py Sat Dec 12 15:26:57 2009 +0100 +++ b/mercurial/config.py Sat Dec 12 16:54:33 2009 +0100 @@ -100,7 +100,13 @@ base = os.path.dirname(src) inc = os.path.normpath(os.path.join(base, inc)) if include: - include(inc, remap=remap, sections=sections) + try: + include(inc, remap=remap, sections=sections) + except IOError, inst: + msg = _("config error at %s:%d: " + "cannot include %s (%s)") \ + % (src, line, inc, inst.strerror) + raise error.ConfigError(msg) continue if emptyre.match(l): continue diff -r e95f0f70c3fd -r dc5462d94a72 tests/test-hgrc --- a/tests/test-hgrc Sat Dec 12 15:26:57 2009 +0100 +++ b/tests/test-hgrc Sat Dec 12 16:54:33 2009 +0100 @@ -18,3 +18,6 @@ echo '[foo]' > $HGRCPATH echo ' x = y' >> $HGRCPATH hg version 2>&1 | sed -e "s|$HGRCPATH|\$HGRCPATH|" + +echo '%include /no-such-file' > $HGRCPATH +hg version 2>&1 | sed -e "s|$HGRCPATH|\$HGRCPATH|" diff -r e95f0f70c3fd -r dc5462d94a72 tests/test-hgrc.out --- a/tests/test-hgrc.out Sat Dec 12 15:26:57 2009 +0100 +++ b/tests/test-hgrc.out Sat Dec 12 16:54:33 2009 +0100 @@ -7,3 +7,4 @@ bundle.mainreporoot=.../foobar paths.default=.../foo%bar hg: config error at $HGRCPATH:2: ' x = y' +hg: config error at $HGRCPATH:1: cannot include /no-such-file (No such file or directory)