diff -r 0fc8b066928a -r 0883413e09bc mercurial/config.py --- a/mercurial/config.py Thu Oct 22 09:58:05 2020 -0700 +++ b/mercurial/config.py Thu Oct 22 10:57:11 2020 -0700 @@ -200,7 +200,10 @@ self._unset.append((section, name)) continue - raise error.ParseError(l.rstrip(), (b"%s:%d" % (src, line))) + message = l.rstrip() + if l.startswith(b' '): + message = b"unexpected leading whitespace: %s" % message + raise error.ParseError(message, (b"%s:%d" % (src, line))) def read(self, path, fp=None, sections=None, remap=None): if not fp: