mercurial/parser.py
changeset 28893 ee11167fe1da
parent 28892 0c135f37c6f8
child 28895 4bf9ed7a260e
equal deleted inserted replaced
28892:0c135f37c6f8 28893:ee11167fe1da
   460                 efmt = _('failed to parse the definition of %(section)s '
   460                 efmt = _('failed to parse the definition of %(section)s '
   461                          '"%(name)s": %(error)s')
   461                          '"%(name)s": %(error)s')
   462         if err:
   462         if err:
   463             err = efmt % {'section': cls._section, 'name': name, 'error': err}
   463             err = efmt % {'section': cls._section, 'name': name, 'error': err}
   464         return alias(name, tree, args, err, repl)
   464         return alias(name, tree, args, err, repl)
       
   465 
       
   466     @classmethod
       
   467     def buildmap(cls, items):
       
   468         """Parse a list of alias (name, replacement) pairs into a dict of
       
   469         alias objects"""
       
   470         aliases = {}
       
   471         for decl, defn in items:
       
   472             a = cls.build(decl, defn)
       
   473             aliases[a.name] = a
       
   474         return aliases