Mercurial > hg
view mercurial/templates/map-cmdline.status @ 45777:0883413e09bc
config: move message about leading spaces in config to config.py
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.
Differential Revision: https://phab.mercurial-scm.org/D9241
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 22 Oct 2020 10:57:11 -0700 |
parents | f9a98075a37e |
children |
line wrap: on
line source
%include map-cmdline.default [templates] # Override base templates changeset = '{cset}{branches}{bookmarks}{tags}{parents}{luser}{ldate}{summary}{lfiles}\n' changeset_verbose = '{cset}{branches}{bookmarks}{tags}{parents}{luser}{ldate}{description}{lfiles}\n' changeset_debug = '{fullcset}{branches}{bookmarks}{tags}{lphase}{parents}{manifest}{luser}{ldate}{extras}{description}{lfiles}\n' # Override the file templates lfiles = '{if(files, label('ui.note log.files', 'files:\n'))}{lfile_mods}{lfile_adds}{lfile_dels}' lfile_adds = '{file_adds % "{lfile_add}{lfile_src}"}' lfile_mods = '{file_mods % "{lfile_mod}{lfile_src}"}' lfile_add = '{label("status.added", "A {file}\n")}' lfile_mod = '{label("status.modified", "M {file}\n")}' lfile_src = '{ifcontains(file, file_copies_switch, label("status.copied", " {get(file_copies_switch, file)}\n"))}' lfile_dels = '{file_dels % "{label('status.removed', 'R {file}\n')}"}'