debugtemplate: pass ui to templater so label() works
Follows up
3356bf61fa25.
--- a/mercurial/debugcommands.py Sun Mar 19 11:42:17 2017 -0700
+++ b/mercurial/debugcommands.py Sat Mar 18 19:59:47 2017 +0900
@@ -2019,7 +2019,7 @@
for d in opts['define']:
try:
k, v = (e.strip() for e in d.split('=', 1))
- if not k:
+ if not k or k == 'ui':
raise ValueError
props[k] = v
except ValueError:
@@ -2037,7 +2037,7 @@
if revs is None:
k = 'debugtemplate'
t = formatter.maketemplater(ui, k, tmpl)
- ui.write(templater.stringify(t(k, **props)))
+ ui.write(templater.stringify(t(k, ui=ui, **props)))
else:
displayer = cmdutil.changeset_templater(ui, repo, None, opts, tmpl,
mapfile, buffered=False)