comparison mercurial/filemerge.py @ 33523:11025c4f1016

configitems: register the 'ui.mergemarkertemplate' config
author Boris Feld <boris.feld@octobus.net>
date Fri, 30 Jun 2017 03:44:56 +0200
parents 0407a51b9d8c
children 50c44dee741a
comparison
equal deleted inserted replaced
33522:62b29ca72d1a 33523:11025c4f1016
553 mark = mark.splitlines()[0] # split for safety 553 mark = mark.splitlines()[0] # split for safety
554 554
555 # 8 for the prefix of conflict marker lines (e.g. '<<<<<<< ') 555 # 8 for the prefix of conflict marker lines (e.g. '<<<<<<< ')
556 return util.ellipsis(mark, 80 - 8) 556 return util.ellipsis(mark, 80 - 8)
557 557
558 _defaultconflictmarker = ('{node|short} '
559 '{ifeq(tags, "tip", "", '
560 'ifeq(tags, "", "", "{tags} "))}'
561 '{if(bookmarks, "{bookmarks} ")}'
562 '{ifeq(branch, "default", "", "{branch} ")}'
563 '- {author|user}: {desc|firstline}')
564
565 _defaultconflictlabels = ['local', 'other'] 558 _defaultconflictlabels = ['local', 'other']
566 559
567 def _formatlabels(repo, fcd, fco, fca, labels): 560 def _formatlabels(repo, fcd, fco, fca, labels):
568 """Formats the given labels using the conflict marker template. 561 """Formats the given labels using the conflict marker template.
569 562
572 cd = fcd.changectx() 565 cd = fcd.changectx()
573 co = fco.changectx() 566 co = fco.changectx()
574 ca = fca.changectx() 567 ca = fca.changectx()
575 568
576 ui = repo.ui 569 ui = repo.ui
577 template = ui.config('ui', 'mergemarkertemplate', _defaultconflictmarker) 570 template = ui.config('ui', 'mergemarkertemplate')
578 template = templater.unquotestring(template) 571 template = templater.unquotestring(template)
579 tmpl = formatter.maketemplater(ui, template) 572 tmpl = formatter.maketemplater(ui, template)
580 573
581 pad = max(len(l) for l in labels) 574 pad = max(len(l) for l in labels)
582 575