Mercurial > hg > mercurial-crew
changeset 10042:7cdd2a7db2c2 stable
config: raise ConfigError on non-existing include files
Before, an %include directive for a non-existing file resulted in an
IOError and a traceback.
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Sat, 12 Dec 2009 16:46:16 +0100 (2009-12-12) |
parents | fb45c1e4396f |
children | dc5462d94a72 27267b1f68b4 |
files | mercurial/config.py tests/test-hgrc tests/test-hgrc.out |
diffstat | 3 files changed, 11 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/config.py +++ b/mercurial/config.py @@ -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