##// END OF EJS Templates
config: raise ConfigError on non-existing include files...
Martin Geisler -
r10042:7cdd2a7d stable
parent child Browse files
Show More
@@ -100,7 +100,13 b' class config(object):'
100 base = os.path.dirname(src)
100 base = os.path.dirname(src)
101 inc = os.path.normpath(os.path.join(base, inc))
101 inc = os.path.normpath(os.path.join(base, inc))
102 if include:
102 if include:
103 include(inc, remap=remap, sections=sections)
103 try:
104 include(inc, remap=remap, sections=sections)
105 except IOError, inst:
106 msg = _("config error at %s:%d: "
107 "cannot include %s (%s)") \
108 % (src, line, inc, inst.strerror)
109 raise error.ConfigError(msg)
104 continue
110 continue
105 if emptyre.match(l):
111 if emptyre.match(l):
106 continue
112 continue
@@ -22,3 +22,6 b' cd ..'
22 echo '[foo]' >> $HGRCPATH
22 echo '[foo]' >> $HGRCPATH
23 echo ' x = y' >> $HGRCPATH
23 echo ' x = y' >> $HGRCPATH
24 hg version 2>&1 | sed -e "s|$HGRCPATH|\$HGRCPATH|"
24 hg version 2>&1 | sed -e "s|$HGRCPATH|\$HGRCPATH|"
25
26 echo '%include /no-such-file' > $HGRCPATH
27 hg version 2>&1 | sed -e "s|$HGRCPATH|\$HGRCPATH|"
@@ -11,3 +11,4 b' defaults.tag=-d "0 0"'
11 paths.default=.../foo%bar
11 paths.default=.../foo%bar
12 ui.slash=True
12 ui.slash=True
13 hg: config error at $HGRCPATH:8: ' x = y'
13 hg: config error at $HGRCPATH:8: ' x = y'
14 hg: config error at $HGRCPATH:1: cannot include /no-such-file (No such file or directory)
General Comments 0
You need to be logged in to leave comments. Login now