comparison mercurial/cmdutil.py @ 28955:78759f78a44e

templater: factor out function that creates templater from string template This function will host loading of template aliases. It is not defined at templater, but at formatter, since formatter is the module handling ui stuff in front of templater.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 10 Apr 2016 17:23:09 +0900
parents f97a0bcfd7a1
children 790c076cd4a2
comparison
equal deleted inserted replaced
28954:f97a0bcfd7a1 28955:78759f78a44e
1490 assert not (tmpl and mapfile) 1490 assert not (tmpl and mapfile)
1491 if mapfile: 1491 if mapfile:
1492 self.t = templater.templater.frommapfile(mapfile, filters=filters, 1492 self.t = templater.templater.frommapfile(mapfile, filters=filters,
1493 cache=defaulttempl) 1493 cache=defaulttempl)
1494 else: 1494 else:
1495 self.t = templater.templater(filters=filters, cache=defaulttempl) 1495 self.t = formatter.maketemplater(ui, 'changeset', tmpl,
1496 if tmpl: 1496 filters=filters,
1497 self.t.cache['changeset'] = tmpl 1497 cache=defaulttempl)
1498 1498
1499 self.cache = {} 1499 self.cache = {}
1500 1500
1501 # find correct templates for current mode 1501 # find correct templates for current mode
1502 tmplmodes = [ 1502 tmplmodes = [