##// END OF EJS Templates
filemerge: use only the first line of the generated conflict marker for safety...
FUJIWARA Katsunori -
r21864:755bf1bb default
parent child Browse files
Show More
@@ -287,6 +287,9 def _formatconflictmarker(repo, ctx, tem
287 label = ('%s:' % label).ljust(pad + 1)
287 label = ('%s:' % label).ljust(pad + 1)
288 mark = '%s %s' % (label, templater.stringify(templateresult))
288 mark = '%s %s' % (label, templater.stringify(templateresult))
289
289
290 if mark:
291 mark = mark.splitlines()[0] # split for safety
292
290 # The <<< marks add 8 to the length, and '...' adds three, so max
293 # The <<< marks add 8 to the length, and '...' adds three, so max
291 # length of the actual marker is 69.
294 # length of the actual marker is 69.
292 maxlength = 80 - 8 - 3
295 maxlength = 80 - 8 - 3
@@ -52,6 +52,26 Verify custom conflict markers
52 something
52 something
53 >>>>>>> other: test 1
53 >>>>>>> other: test 1
54
54
55 Verify line splitting of custom conflict marker which causes multiple lines
56
57 $ hg up -q --clean .
58 $ cat >> .hg/hgrc <<EOF
59 > [ui]
60 > mergemarkertemplate={author} {rev}\nfoo\nbar\nbaz
61 > EOF
62
63 $ hg -q merge 1
64 warning: conflicts during merge.
65 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
66 [1]
67
68 $ cat a
69 <<<<<<< local: test 2
70 something else
71 =======
72 something
73 >>>>>>> other: test 1
74
55 Verify basic conflict markers
75 Verify basic conflict markers
56
76
57 $ hg up -q --clean .
77 $ hg up -q --clean .
General Comments 0
You need to be logged in to leave comments. Login now