Patchwork [5,of,9] configitems: register the 'ui.mergemarkertemplate' config

login
register
mail settings
Submitter Boris Feld
Date July 15, 2017, 6:41 p.m.
Message ID <6a5f9dfdcb30a627d914.1500144068@FB>
Download mbox | patch
Permalink /patch/22409/
State Accepted
Headers show

Comments

Boris Feld - July 15, 2017, 6:41 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1498787096 -7200
#      Fri Jun 30 03:44:56 2017 +0200
# Node ID 6a5f9dfdcb30a627d914d4b9fdbe767231253288
# Parent  789783a6db854e810b3381d2e0b9e4252238851c
# EXP-Topic config.register.special-case
configitems: register the 'ui.mergemarkertemplate' config

Patch

diff -r 789783a6db85 -r 6a5f9dfdcb30 mercurial/configitems.py
--- a/mercurial/configitems.py	Sat Jul 15 14:14:53 2017 +0200
+++ b/mercurial/configitems.py	Fri Jun 30 03:44:56 2017 +0200
@@ -484,6 +484,14 @@ 
 coreconfigitem('ui', 'mergemarkers',
     default='basic',
 )
+coreconfigitem('ui', 'mergemarkertemplate',
+    default=('{node|short} '
+            '{ifeq(tags, "tip", "", '
+            'ifeq(tags, "", "", "{tags} "))}'
+            '{if(bookmarks, "{bookmarks} ")}'
+            '{ifeq(branch, "default", "", "{branch} ")}'
+            '- {author|user}: {desc|firstline}')
+)
 coreconfigitem('ui', 'nontty',
     default=False,
 )
diff -r 789783a6db85 -r 6a5f9dfdcb30 mercurial/filemerge.py
--- a/mercurial/filemerge.py	Sat Jul 15 14:14:53 2017 +0200
+++ b/mercurial/filemerge.py	Fri Jun 30 03:44:56 2017 +0200
@@ -555,13 +555,6 @@ 
     # 8 for the prefix of conflict marker lines (e.g. '<<<<<<< ')
     return util.ellipsis(mark, 80 - 8)
 
-_defaultconflictmarker = ('{node|short} '
-                          '{ifeq(tags, "tip", "", '
-                           'ifeq(tags, "", "", "{tags} "))}'
-                          '{if(bookmarks, "{bookmarks} ")}'
-                          '{ifeq(branch, "default", "", "{branch} ")}'
-                          '- {author|user}: {desc|firstline}')
-
 _defaultconflictlabels = ['local', 'other']
 
 def _formatlabels(repo, fcd, fco, fca, labels):
@@ -574,7 +567,7 @@ 
     ca = fca.changectx()
 
     ui = repo.ui
-    template = ui.config('ui', 'mergemarkertemplate', _defaultconflictmarker)
+    template = ui.config('ui', 'mergemarkertemplate')
     template = templater.unquotestring(template)
     tmpl = formatter.maketemplater(ui, template)