##// END OF EJS Templates
config: rename ui.mergemarkertemplate to command-templates.mergemarker...
Martin von Zweigbergk -
r46352:40411ad2 default
parent child Browse files
Show More
@@ -232,6 +232,19 b' coreconfigitem('
232 232 coreconfigitem(
233 233 b'command-templates', b'log', default=None, alias=[(b'ui', b'logtemplate')],
234 234 )
235 coreconfigitem(
236 b'command-templates',
237 b'mergemarker',
238 default=(
239 b'{node|short} '
240 b'{ifeq(tags, "tip", "", '
241 b'ifeq(tags, "", "", "{tags} "))}'
242 b'{if(bookmarks, "{bookmarks} ")}'
243 b'{ifeq(branch, "default", "", "{branch} ")}'
244 b'- {author|user}: {desc|firstline}'
245 ),
246 alias=[(b'ui', b'mergemarkertemplate')],
247 )
235 248 _registerdiffopts(section=b'commands', configprefix=b'commit.interactive.')
236 249 coreconfigitem(
237 250 b'commands', b'commit.post-status', default=False,
@@ -948,7 +961,7 b' coreconfigitem('
948 961 coreconfigitem(
949 962 b'merge-tools',
950 963 br'.*\.mergemarkertemplate$',
951 default=dynamicdefault, # take from ui.mergemarkertemplate
964 default=dynamicdefault, # take from command-templates.mergemarker
952 965 generic=True,
953 966 priority=-1,
954 967 )
@@ -1318,18 +1331,6 b' coreconfigitem('
1318 1331 b'ui', b'mergemarkers', default=b'basic',
1319 1332 )
1320 1333 coreconfigitem(
1321 b'ui',
1322 b'mergemarkertemplate',
1323 default=(
1324 b'{node|short} '
1325 b'{ifeq(tags, "tip", "", '
1326 b'ifeq(tags, "", "", "{tags} "))}'
1327 b'{if(bookmarks, "{bookmarks} ")}'
1328 b'{ifeq(branch, "default", "", "{branch} ")}'
1329 b'- {author|user}: {desc|firstline}'
1330 ),
1331 )
1332 coreconfigitem(
1333 1334 b'ui', b'message-output', default=b'stdio',
1334 1335 )
1335 1336 coreconfigitem(
@@ -831,7 +831,7 b' def _formatlabels(repo, fcd, fco, fca, l'
831 831 ca = fca.changectx()
832 832
833 833 ui = repo.ui
834 template = ui.config(b'ui', b'mergemarkertemplate')
834 template = ui.config(b'command-templates', b'mergemarker')
835 835 if tool is not None:
836 836 template = _toolstr(ui, tool, b'mergemarkertemplate', template)
837 837 template = templater.unquotestring(template)
@@ -1100,7 +1100,7 b' def _filemerge(premerge, repo, wctx, myn'
1100 1100 labeltool = None
1101 1101 if markerstyle != b'basic':
1102 1102 # respect 'tool's mergemarkertemplate (which defaults to
1103 # ui.mergemarkertemplate)
1103 # command-templates.mergemarker)
1104 1104 labeltool = tool
1105 1105 if internalmarkerstyle != b'basic' or markerstyle != b'basic':
1106 1106 premergelabels = _formatlabels(
@@ -1549,11 +1549,11 b' Supported arguments:'
1549 1549 (default: ``basic``)
1550 1550
1551 1551 ``mergemarkertemplate``
1552 This setting can be used to override ``mergemarkertemplate`` from the ``[ui]``
1553 section on a per-tool basis; this applies to the ``$label``-prefixed variables
1554 and to the conflict markers that are generated if ``premerge`` is ``keep` or
1555 ``keep-merge3``. See the corresponding variable in ``[ui]`` for more
1556 information.
1552 This setting can be used to override ``mergemarker`` from the
1553 ``[command-templates]`` section on a per-tool basis; this applies to the
1554 ``$label``-prefixed variables and to the conflict markers that are generated
1555 if ``premerge`` is ``keep` or ``keep-merge3``. See the corresponding variable
1556 in ``[ui]`` for more information.
1557 1557
1558 1558 .. container:: windows
1559 1559
@@ -2370,29 +2370,14 b' User interface controls.'
2370 2370 For configuring merge tools see the ``[merge-tools]`` section.
2371 2371
2372 2372 ``mergemarkers``
2373 Sets the merge conflict marker label styling. The ``detailed``
2374 style uses the ``mergemarkertemplate`` setting to style the labels.
2373 Sets the merge conflict marker label styling. The ``detailed`` style
2374 uses the ``command-templates.mergemarker`` setting to style the labels.
2375 2375 The ``basic`` style just uses 'local' and 'other' as the marker label.
2376 2376 One of ``basic`` or ``detailed``.
2377 2377 (default: ``basic``)
2378 2378
2379 2379 ``mergemarkertemplate``
2380 The template used to print the commit description next to each conflict
2381 marker during merge conflicts. See :hg:`help templates` for the template
2382 format.
2383
2384 Defaults to showing the hash, tags, branches, bookmarks, author, and
2385 the first line of the commit description.
2386
2387 If you use non-ASCII characters in names for tags, branches, bookmarks,
2388 authors, and/or commit descriptions, you must pay attention to encodings of
2389 managed files. At template expansion, non-ASCII characters use the encoding
2390 specified by the ``--encoding`` global option, ``HGENCODING`` or other
2391 environment variables that govern your locale. If the encoding of the merge
2392 markers is different from the encoding of the merged files,
2393 serious problems may occur.
2394
2395 Can be overridden per-merge-tool, see the ``[merge-tools]`` section.
2380 (DEPRECATED) Use ``command-templates.mergemarker`` instead.
2396 2381
2397 2382 ``message-output``
2398 2383 Where to write status and error messages. (default: ``stdio``)
@@ -2572,6 +2557,24 b' Templates used for customizing the outpu'
2572 2557 ``log``
2573 2558 Template string for commands that print changesets.
2574 2559
2560 ``mergemarker``
2561 The template used to print the commit description next to each conflict
2562 marker during merge conflicts. See :hg:`help templates` for the template
2563 format.
2564
2565 Defaults to showing the hash, tags, branches, bookmarks, author, and
2566 the first line of the commit description.
2567
2568 If you use non-ASCII characters in names for tags, branches, bookmarks,
2569 authors, and/or commit descriptions, you must pay attention to encodings of
2570 managed files. At template expansion, non-ASCII characters use the encoding
2571 specified by the ``--encoding`` global option, ``HGENCODING`` or other
2572 environment variables that govern your locale. If the encoding of the merge
2573 markers is different from the encoding of the merged files,
2574 serious problems may occur.
2575
2576 Can be overridden per-merge-tool, see the ``[merge-tools]`` section.
2577
2575 2578
2576 2579 ``web``
2577 2580 -------
@@ -102,6 +102,35 b' Verify custom conflict markers'
102 102
103 103 $ hg up -q --clean .
104 104 $ cat <<EOF >> .hg/hgrc
105 > [command-templates]
106 > mergemarker = '{author} {rev}'
107 > EOF
108
109 $ hg merge 1
110 merging a
111 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
112 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
113 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
114 [1]
115
116 $ cat a
117 Small Mathematical Series.
118 1
119 2
120 3
121 <<<<<<< working copy: test 2
122 6
123 8
124 =======
125 4
126 5
127 >>>>>>> merge rev: test 1
128 Hop we are done.
129
130 Verify custom conflict markers with legacy config name
131
132 $ hg up -q --clean .
133 $ cat <<EOF >> .hg/hgrc
105 134 > [ui]
106 135 > mergemarkertemplate = '{author} {rev}'
107 136 > EOF
@@ -131,8 +160,8 b' Verify line splitting of custom conflict'
131 160
132 161 $ hg up -q --clean .
133 162 $ cat >> .hg/hgrc <<EOF
134 > [ui]
135 > mergemarkertemplate={author} {rev}\nfoo\nbar\nbaz
163 > [command-templates]
164 > mergemarker={author} {rev}\nfoo\nbar\nbaz
136 165 > EOF
137 166
138 167 $ hg -q merge 1
@@ -170,8 +199,8 b' Verify line trimming of custom conflict '
170 199 $ hg --encoding utf-8 commit --logfile logfile
171 200
172 201 $ cat >> .hg/hgrc <<EOF
173 > [ui]
174 > mergemarkertemplate={desc|firstline}
202 > [command-templates]
203 > mergemarker={desc|firstline}
175 204 > EOF
176 205
177 206 $ hg -q --encoding utf-8 merge 1
General Comments 0
You need to be logged in to leave comments. Login now