diff mercurial/filemerge.py @ 21864:755bf1bbe0a9

filemerge: use only the first line of the generated conflict marker for safety Before this patch, with careless configuration (missing '|firstline' filtering for '{desc}' keyword, for example), '[ui] mergemarkertemplate' can make conflict markers multiple lines. For ordinary users, advantage of allowing '[ui] mergemarkertemplate' to generate multiple lines for customizing seems to be less than advantage of disallowing it for safety. This patch uses only the first line of the conflict marker generated from '[ui] mergemarkertemplate' configuration for safety.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sun, 06 Jul 2014 02:56:41 +0900
parents 9c35f3a8cac4
children 78e56e70c70a
line wrap: on
line diff
--- a/mercurial/filemerge.py	Sun Jul 06 02:56:41 2014 +0900
+++ b/mercurial/filemerge.py	Sun Jul 06 02:56:41 2014 +0900
@@ -287,6 +287,9 @@
     label = ('%s:' % label).ljust(pad + 1)
     mark = '%s %s' % (label, templater.stringify(templateresult))
 
+    if mark:
+        mark = mark.splitlines()[0] # split for safety
+
     # The <<< marks add 8 to the length, and '...' adds three, so max
     # length of the actual marker is 69.
     maxlength = 80 - 8 - 3