comparison mercurial/commands.py @ 28912:867d6ba2353d

templater: add parsing and expansion rules to process "templatealias" section The debugtemplate command is updated to show expanded tree, but still the template engine doesn't support alias expansion. That's why the test says "parse error" for now.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 27 Mar 2016 20:31:56 +0900
parents eb017d52899d
children f97a0bcfd7a1
comparison
equal deleted inserted replaced
28911:35da19348143 28912:867d6ba2353d
3669 props[k] = v 3669 props[k] = v
3670 except ValueError: 3670 except ValueError:
3671 raise error.Abort(_('malformed keyword definition: %s') % d) 3671 raise error.Abort(_('malformed keyword definition: %s') % d)
3672 3672
3673 if ui.verbose: 3673 if ui.verbose:
3674 aliases = ui.configitems('templatealias')
3674 tree = templater.parse(tmpl) 3675 tree = templater.parse(tmpl)
3675 ui.note(templater.prettyformat(tree), '\n') 3676 ui.note(templater.prettyformat(tree), '\n')
3677 newtree = templater.expandaliases(tree, aliases)
3678 if newtree != tree:
3679 ui.note("* expanded:\n", templater.prettyformat(newtree), '\n')
3676 3680
3677 mapfile = None 3681 mapfile = None
3678 if revs is None: 3682 if revs is None:
3679 k = 'debugtemplate' 3683 k = 'debugtemplate'
3680 t = templater.templater(mapfile) 3684 t = templater.templater(mapfile)