# HG changeset patch # User Yuya Nishihara # Date 1460863866 -32400 # Node ID 8eba4cdcfd810d80785c94d770a442c5bd1f9d0f # Parent dbed4c4f48aef674b5891daf320701983ab80f1c parser: shorten prefix of alias parsing errors These messages seemed to be a bit long. We should try making them fit to 80-col console. diff -r dbed4c4f48ae -r 8eba4cdcfd81 mercurial/parser.py --- a/mercurial/parser.py Sun Apr 17 12:20:57 2016 +0900 +++ b/mercurial/parser.py Sun Apr 17 12:31:06 2016 +0900 @@ -447,15 +447,13 @@ repl = efmt = None name, args, err = cls._builddecl(decl) if err: - efmt = _('failed to parse the declaration of %(section)s ' - '"%(name)s": %(error)s') + efmt = _('bad declaration of %(section)s "%(name)s": %(error)s') else: try: repl = cls._builddefn(defn, args) except error.ParseError as inst: err = parseerrordetail(inst) - efmt = _('failed to parse the definition of %(section)s ' - '"%(name)s": %(error)s') + efmt = _('bad definition of %(section)s "%(name)s": %(error)s') if err: err = efmt % {'section': cls._section, 'name': name, 'error': err} return alias(name, args, err, repl) diff -r dbed4c4f48ae -r 8eba4cdcfd81 tests/test-command-template.t --- a/tests/test-command-template.t Sun Apr 17 12:20:57 2016 +0900 +++ b/tests/test-command-template.t Sun Apr 17 12:31:06 2016 +0900 @@ -3768,10 +3768,10 @@ $ hg debugtemplate --config templatealias.bad='x(' -v '{bad}' (template ('symbol', 'bad')) - abort: failed to parse the definition of template alias "bad": at 2: not a prefix: end + abort: bad definition of template alias "bad": at 2: not a prefix: end [255] $ hg log --config templatealias.bad='x(' -T '{bad}' - abort: failed to parse the definition of template alias "bad": at 2: not a prefix: end + abort: bad definition of template alias "bad": at 2: not a prefix: end [255] $ cd .. diff -r dbed4c4f48ae -r 8eba4cdcfd81 tests/test-revset.t --- a/tests/test-revset.t Sun Apr 17 12:20:57 2016 +0900 +++ b/tests/test-revset.t Sun Apr 17 12:31:06 2016 +0900 @@ -1967,12 +1967,12 @@ (func ('symbol', 'unknownref') ('symbol', '0')) - abort: failed to parse the definition of revset alias "unknownref": invalid symbol '$2' + abort: bad definition of revset alias "unknownref": invalid symbol '$2' [255] $ hg debugrevspec --debug --config revsetalias.anotherbadone='branch(' "tip" ('symbol', 'tip') - warning: failed to parse the definition of revset alias "anotherbadone": at 7: not a prefix: end + warning: bad definition of revset alias "anotherbadone": at 7: not a prefix: end * set: 9 @@ -1985,7 +1985,7 @@ $ hg debugrevspec --debug --config revsetalias.'bad name'='tip' "tip" ('symbol', 'tip') - warning: failed to parse the declaration of revset alias "bad name": at 4: invalid token + warning: bad declaration of revset alias "bad name": at 4: invalid token * set: 9