filemerge: rename _formatconflictmarker() since it formats a label
authorMartin von Zweigbergk <martinvonz@google.com>
Fri, 19 Nov 2021 18:14:25 -0800
changeset 48395 1eeec02cd919
parent 48394 d5a91701f7dc
child 48396 6ce9ccfcac23
filemerge: rename _formatconflictmarker() since it formats a label `_formatconflictmarker()`'s name made me think that it would create something like `<<<<<<<` and maybe some more stuff after it, but it's actually just the label that comes after on the same line. So let's rename it to `_formatlabel()`. That's better aligned with the variables the result is assigned it. Differential Revision: https://phab.mercurial-scm.org/D11801
mercurial/filemerge.py
--- a/mercurial/filemerge.py	Tue Nov 23 20:04:22 2021 +0100
+++ b/mercurial/filemerge.py	Fri Nov 19 18:14:25 2021 -0800
@@ -846,7 +846,7 @@
         return True, r, False
 
 
-def _formatconflictmarker(ctx, template, label, pad):
+def _formatlabel(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
@@ -893,11 +893,11 @@
     pad = max(len(l) for l in labels)
 
     newlabels = [
-        _formatconflictmarker(cd, tmpl, labels[0], pad),
-        _formatconflictmarker(co, tmpl, labels[1], pad),
+        _formatlabel(cd, tmpl, labels[0], pad),
+        _formatlabel(co, tmpl, labels[1], pad),
     ]
     if len(labels) > 2:
-        newlabels.append(_formatconflictmarker(ca, tmpl, labels[2], pad))
+        newlabels.append(_formatlabel(ca, tmpl, labels[2], pad))
     return newlabels