changeset 31517:468bc8a1863d

debugtemplate: pass ui to templater so label() works Follows up 3356bf61fa25.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 18 Mar 2017 19:59:47 +0900
parents 527a247f114f
children 43d6ef658874
files mercurial/debugcommands.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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)