This instance will be upgraded to Heptapod 0.21.0rc3 on 2021-04-23 at 10:30 UTC+2 (a few minutes of down time)

Commit a2eacc09 authored by Martin von Zweigbergk's avatar Martin von Zweigbergk

histedit: disable color while rendering template for use in plan

Differential Revision: https://phab.mercurial-scm.org/D9324
parent ec6ba70be853
......@@ -525,7 +525,11 @@ class histeditaction(object):
"""
ctx = self.repo[self.node]
ui = self.repo.ui
with ui.configoverride({}, b'histedit'):
# We don't want color codes in the commit message template, so
# disable the label() template function while we render it.
with ui.configoverride(
{(b'templatealias', b'label(l,x)'): b"x"}, b'histedit'
):
summary = cmdutil.rendertemplate(
ctx, ui.config(b'histedit', b'summary-template')
)
......
......@@ -107,10 +107,10 @@ test customization of revision summary
colors in the custom template don't show up in the editor
$ HGEDITOR=cat hg histedit 177f92b77385 --color=debug \
> --config histedit.summary-template='I am rev {label("rev", rev)}'
pick 177f92b77385 I am rev [rev|2]
pick 055a42cdd887 I am rev [rev|3]
pick e860deea161a I am rev [rev|4]
pick 652413bf663e I am rev [rev|5]
pick 177f92b77385 I am rev 2
pick 055a42cdd887 I am rev 3
pick e860deea161a I am rev 4
pick 652413bf663e I am rev 5
# Edit history between 177f92b77385 and 652413bf663e
#
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment