diff mercurial/formatter.py @ 28384:3356bf61fa25

formatter: make labels work with templated output To describe the bug this fix is addressing, one can do ``$ hg status -T "{label('red', path)}\n" --color=debug`` and observe that the label is not applied before my fix and applied with it.
author Kostia Balytskyi <ikostia@fb.com>
date Tue, 08 Mar 2016 04:08:33 -0800
parents 56b2bcea2529
children bf35644b9f3a
line wrap: on
line diff
--- a/mercurial/formatter.py	Tue Mar 08 14:32:03 2016 +0000
+++ b/mercurial/formatter.py	Tue Mar 08 04:08:33 2016 -0800
@@ -153,7 +153,7 @@
         self._topic = topic
         self._t = gettemplater(ui, topic, opts.get('template', ''))
     def _showitem(self):
-        g = self._t(self._topic, **self._item)
+        g = self._t(self._topic, ui=self._ui, **self._item)
         self._ui.write(templater.stringify(g))
 
 def lookuptemplate(ui, topic, tmpl):