templater: drop unneeded resources from conflict-marker data
authorYuya Nishihara <yuya@tcha.org>
Fri, 22 Dec 2017 21:22:49 +0900
changeset 35482 c240657febb7
parent 35481 964510dcdc2a
child 35483 817a3d20dd01
templater: drop unneeded resources from conflict-marker data Follow-up for 32c278eb876f and f1c54d003327.
mercurial/filemerge.py
--- a/mercurial/filemerge.py	Fri Dec 22 21:12:17 2017 +0900
+++ b/mercurial/filemerge.py	Fri Dec 22 21:22:49 2017 +0900
@@ -543,7 +543,7 @@
         util.unlink(b)
         util.unlink(c)
 
-def _formatconflictmarker(repo, ctx, template, label, pad):
+def _formatconflictmarker(ctx, template, label, pad):
     """Applies the given template to the ctx, prefixed by the label.
 
     Pad is the minimum width of the label prefix, so that multiple markers
@@ -553,9 +553,7 @@
         ctx = ctx.p1()
 
     props = templatekw.keywords.copy()
-    props['templ'] = template
     props['ctx'] = ctx
-    props['repo'] = repo
     templateresult = template.render(props)
 
     label = ('%s:' % label).ljust(pad + 1)
@@ -586,10 +584,10 @@
 
     pad = max(len(l) for l in labels)
 
-    newlabels = [_formatconflictmarker(repo, cd, tmpl, labels[0], pad),
-                 _formatconflictmarker(repo, co, tmpl, labels[1], pad)]
+    newlabels = [_formatconflictmarker(cd, tmpl, labels[0], pad),
+                 _formatconflictmarker(co, tmpl, labels[1], pad)]
     if len(labels) > 2:
-        newlabels.append(_formatconflictmarker(repo, ca, tmpl, labels[2], pad))
+        newlabels.append(_formatconflictmarker(ca, tmpl, labels[2], pad))
     return newlabels
 
 def partextras(labels):