# HG changeset patch # User Denis Laxalde # Date 1571307042 -7200 # Node ID d201a637c9717030c265dcb150bd63eafe8cfad1 # Parent 8c0fe77f47c5956681238b79dc15093c92e79395 py3: encode underlying error message during parse error of %include diff -r 8c0fe77f47c5 -r d201a637c971 mercurial/config.py --- a/mercurial/config.py Fri Oct 11 18:08:50 2019 +0100 +++ b/mercurial/config.py Thu Oct 17 12:10:42 2019 +0200 @@ -13,6 +13,7 @@ from .i18n import _ from .pycompat import getattr from . import ( + encoding, error, pycompat, util, @@ -173,7 +174,7 @@ if inst.errno != errno.ENOENT: raise error.ParseError( _(b"cannot include %s (%s)") - % (inc, inst.strerror), + % (inc, encoding.strtolocal(inst.strerror)), b"%s:%d" % (src, line), ) continue diff -r 8c0fe77f47c5 -r d201a637c971 tests/test-hgrc.t --- a/tests/test-hgrc.t Fri Oct 11 18:08:50 2019 +0100 +++ b/tests/test-hgrc.t Thu Oct 17 12:10:42 2019 +0200 @@ -49,6 +49,18 @@ paths.default=$TESTTMP/foo%bar $ cd .. +Check %include + + $ echo '[section]' > $TESTTMP/included + $ echo 'option = value' >> $TESTTMP/included + $ echo '%include $TESTTMP/included' >> $HGRC + $ hg showconfig section + section.option=value + $ chmod u-r $TESTTMP/included + $ hg showconfig section + hg: parse error at $TESTTMP/hgrc:2: cannot include $TESTTMP/included (Permission denied) + [255] + issue1829: wrong indentation $ echo '[foo]' > $HGRC