##// END OF EJS Templates
py3: encode underlying error message during parse error of %include
Denis Laxalde -
r43570:d201a637 default
parent child Browse files
Show More
@@ -13,6 +13,7 b' import os'
13 from .i18n import _
13 from .i18n import _
14 from .pycompat import getattr
14 from .pycompat import getattr
15 from . import (
15 from . import (
16 encoding,
16 error,
17 error,
17 pycompat,
18 pycompat,
18 util,
19 util,
@@ -173,7 +174,7 b' class config(object):'
173 if inst.errno != errno.ENOENT:
174 if inst.errno != errno.ENOENT:
174 raise error.ParseError(
175 raise error.ParseError(
175 _(b"cannot include %s (%s)")
176 _(b"cannot include %s (%s)")
176 % (inc, inst.strerror),
177 % (inc, encoding.strtolocal(inst.strerror)),
177 b"%s:%d" % (src, line),
178 b"%s:%d" % (src, line),
178 )
179 )
179 continue
180 continue
@@ -49,6 +49,18 b" Issue1199: Can't use '%' in hgrc (eg url"
49 paths.default=$TESTTMP/foo%bar
49 paths.default=$TESTTMP/foo%bar
50 $ cd ..
50 $ cd ..
51
51
52 Check %include
53
54 $ echo '[section]' > $TESTTMP/included
55 $ echo 'option = value' >> $TESTTMP/included
56 $ echo '%include $TESTTMP/included' >> $HGRC
57 $ hg showconfig section
58 section.option=value
59 $ chmod u-r $TESTTMP/included
60 $ hg showconfig section
61 hg: parse error at $TESTTMP/hgrc:2: cannot include $TESTTMP/included (Permission denied)
62 [255]
63
52 issue1829: wrong indentation
64 issue1829: wrong indentation
53
65
54 $ echo '[foo]' > $HGRC
66 $ echo '[foo]' > $HGRC
General Comments 0
You need to be logged in to leave comments. Login now