[PATCH 2 of 4] templater: drop unneeded resources from conflict-marker data

Yuya Nishihara yuya at tcha.org
Fri Dec 22 09:08:28 EST 2017


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1513945369 -32400
#      Fri Dec 22 21:22:49 2017 +0900
# Node ID a9a8f3642ca47198d44e65781cb328131137d69f
# Parent  a311f085ddf3e7d64d741a0e6f98c8f461d22fb1
templater: drop unneeded resources from conflict-marker data

Follow-up for 32c278eb876f and f1c54d003327.

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -543,7 +543,7 @@ def _xmerge(repo, mynode, orig, fcd, fco
         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 @@ def _formatconflictmarker(repo, ctx, tem
         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 @@ def _formatlabels(repo, fcd, fco, fca, l
 
     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):


More information about the Mercurial-devel mailing list