diff mercurial/filemerge.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 264b86cf2092
children 851825214aa3
line wrap: on
line diff
--- a/mercurial/filemerge.py	Wed Jun 14 20:56:34 2017 -0400
+++ b/mercurial/filemerge.py	Sat Apr 22 19:56:47 2017 +0900
@@ -534,10 +534,10 @@
     props['templ'] = template
     props['ctx'] = ctx
     props['repo'] = repo
-    templateresult = template('conflictmarker', **props)
+    templateresult = template.render(props)
 
     label = ('%s:' % label).ljust(pad + 1)
-    mark = '%s %s' % (label, templater.stringify(templateresult))
+    mark = '%s %s' % (label, templateresult)
 
     if mark:
         mark = mark.splitlines()[0] # split for safety
@@ -566,7 +566,7 @@
     ui = repo.ui
     template = ui.config('ui', 'mergemarkertemplate', _defaultconflictmarker)
     template = templater.unquotestring(template)
-    tmpl = formatter.maketemplater(ui, 'conflictmarker', template)
+    tmpl = formatter.maketemplater(ui, template)
 
     pad = max(len(l) for l in labels)