Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/parser.py @ 29059:8eba4cdcfd81
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.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 17 Apr 2016 12:31:06 +0900 |
parents | dbed4c4f48ae |
children | e5b794063fd4 |
comparison
equal
deleted
inserted
replaced
29058:dbed4c4f48ae | 29059:8eba4cdcfd81 |
---|---|
445 def build(cls, decl, defn): | 445 def build(cls, decl, defn): |
446 """Parse an alias declaration and definition into an alias object""" | 446 """Parse an alias declaration and definition into an alias object""" |
447 repl = efmt = None | 447 repl = efmt = None |
448 name, args, err = cls._builddecl(decl) | 448 name, args, err = cls._builddecl(decl) |
449 if err: | 449 if err: |
450 efmt = _('failed to parse the declaration of %(section)s ' | 450 efmt = _('bad declaration of %(section)s "%(name)s": %(error)s') |
451 '"%(name)s": %(error)s') | |
452 else: | 451 else: |
453 try: | 452 try: |
454 repl = cls._builddefn(defn, args) | 453 repl = cls._builddefn(defn, args) |
455 except error.ParseError as inst: | 454 except error.ParseError as inst: |
456 err = parseerrordetail(inst) | 455 err = parseerrordetail(inst) |
457 efmt = _('failed to parse the definition of %(section)s ' | 456 efmt = _('bad definition of %(section)s "%(name)s": %(error)s') |
458 '"%(name)s": %(error)s') | |
459 if err: | 457 if err: |
460 err = efmt % {'section': cls._section, 'name': name, 'error': err} | 458 err = efmt % {'section': cls._section, 'name': name, 'error': err} |
461 return alias(name, args, err, repl) | 459 return alias(name, args, err, repl) |
462 | 460 |
463 @classmethod | 461 @classmethod |