( )⚙ D9241 config: move message about leading spaces in config to config.py

This is an archive of the discontinued Mercurial Phabricator instance.

config: move message about leading spaces in config to config.py
ClosedPublic

Authored by martinvonz on Oct 22 2020, 2:17 PM.

Details

Summary

When the config parser raises a ParseError, it uses the line that
failed to parse as the error message. It doesn't currently tell the
user anything about why it failed to parse. b13b99d39a46 (config:
highlight parse error caused by leading spaces (issue3214),
2014-03-16) added a checked based on the error *message* having
leading spaces. That has worked fine because only the config parser
uses the line itself as error message (I think the revset and fileset
parsers use more user-friendly proper messages). It still feels like a
hack. Let's make the config parser give a useful message about leading
whitespace instead. We should ideally follow up with more useful
messages for other parse errors in config files.

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

martinvonz created this revision.Oct 22 2020, 2:17 PM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.