diff mercurial/debugcommands.py @ 32873:2ecce24dfcd3

templater: add simple interface for unnamed template (API) This provides a simpler API for callers which don't need full templating stack. Instead of storing the given template as the name specified by topic, use '' as the default template to be rendered.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 22 Apr 2017 19:56:47 +0900
parents 50586a0a946f
children bdf4227614e2
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Wed Jun 14 20:56:34 2017 -0400
+++ b/mercurial/debugcommands.py	Sat Apr 22 19:56:47 2017 +0900
@@ -2121,9 +2121,9 @@
             ui.note(("* expanded:\n"), templater.prettyformat(newtree), '\n')
 
     if revs is None:
-        k = 'debugtemplate'
-        t = formatter.maketemplater(ui, k, tmpl)
-        ui.write(templater.stringify(t(k, ui=ui, **props)))
+        t = formatter.maketemplater(ui, tmpl)
+        props['ui'] = ui
+        ui.write(t.render(props))
     else:
         displayer = cmdutil.makelogtemplater(ui, repo, tmpl)
         for r in revs: