parser: shorten prefix of alias parsing errors
authorYuya Nishihara <yuya@tcha.org>
Sun, 17 Apr 2016 12:31:06 +0900
changeset 29059 8eba4cdcfd81
parent 29058 dbed4c4f48ae
child 29060 db74d95299af
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.
mercurial/parser.py
tests/test-command-template.t
tests/test-revset.t
--- 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)
--- 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 ..
--- 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:
   <baseset [9]>
   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:
   <baseset [9]>
   9