##// END OF EJS Templates
filemerge: allow the formatting of three labels instead of two...
Pierre-Yves David -
r22026:69665427 default
parent child Browse files
Show More
@@ -312,23 +312,27 b' def _formatconflictmarker(repo, ctx, tem'
312
312
313 _defaultconflictlabels = ['local', 'other']
313 _defaultconflictlabels = ['local', 'other']
314
314
315 def _formatlabels(repo, fcd, fco, labels):
315 def _formatlabels(repo, fcd, fco, fca, labels):
316 """Formats the given labels using the conflict marker template.
316 """Formats the given labels using the conflict marker template.
317
317
318 Returns a list of formatted labels.
318 Returns a list of formatted labels.
319 """
319 """
320 cd = fcd.changectx()
320 cd = fcd.changectx()
321 co = fco.changectx()
321 co = fco.changectx()
322 ca = fca.changectx()
322
323
323 ui = repo.ui
324 ui = repo.ui
324 template = ui.config('ui', 'mergemarkertemplate', _defaultconflictmarker)
325 template = ui.config('ui', 'mergemarkertemplate', _defaultconflictmarker)
325 template = templater.parsestring(template, quoted=False)
326 template = templater.parsestring(template, quoted=False)
326 tmpl = templater.templater(None, cache={'conflictmarker': template})
327 tmpl = templater.templater(None, cache={'conflictmarker': template})
327
328
328 pad = max(len(labels[0]), len(labels[1]))
329 pad = max(len(l) for l in labels)
329
330
330 return [_formatconflictmarker(repo, cd, tmpl, labels[0], pad),
331 newlabels = [_formatconflictmarker(repo, cd, tmpl, labels[0], pad),
331 _formatconflictmarker(repo, co, tmpl, labels[1], pad)]
332 _formatconflictmarker(repo, co, tmpl, labels[1], pad)]
333 if len(labels) > 2:
334 newlabels.append(_formatconflictmarker(repo, ca, tmpl, labels[2], pad))
335 return newlabels
332
336
333 def filemerge(repo, mynode, orig, fcd, fco, fca, labels=None):
337 def filemerge(repo, mynode, orig, fcd, fco, fca, labels=None):
334 """perform a 3-way merge in the working directory
338 """perform a 3-way merge in the working directory
@@ -391,7 +395,7 b' def filemerge(repo, mynode, orig, fcd, f'
391 if not labels:
395 if not labels:
392 labels = _defaultconflictlabels
396 labels = _defaultconflictlabels
393 if markerstyle != 'basic':
397 if markerstyle != 'basic':
394 labels = _formatlabels(repo, fcd, fco, labels)
398 labels = _formatlabels(repo, fcd, fco, fca, labels)
395
399
396 needcheck, r = func(repo, mynode, orig, fcd, fco, fca, toolconf,
400 needcheck, r = func(repo, mynode, orig, fcd, fco, fca, toolconf,
397 (a, b, c, back), labels=labels)
401 (a, b, c, back), labels=labels)
General Comments 0
You need to be logged in to leave comments. Login now