Mercurial > hg
comparison hgext/split.py @ 45856:8357e0e81bb7
split: disable color while rendering template for use in commit message
Differential Revision: https://phab.mercurial-scm.org/D9322
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 13 Nov 2020 09:41:49 -0800 |
parents | 84ce9ffc95ad |
children | 568c05d8f3d2 |
comparison
equal
deleted
inserted
replaced
45855:c10683da6889 | 45856:8357e0e81bb7 |
---|---|
140 while incomplete(repo): | 140 while incomplete(repo): |
141 if committed: | 141 if committed: |
142 header = _( | 142 header = _( |
143 b'HG: Splitting %s. So far it has been split into:\n' | 143 b'HG: Splitting %s. So far it has been split into:\n' |
144 ) % short(ctx.node()) | 144 ) % short(ctx.node()) |
145 for c in committed: | 145 # We don't want color codes in the commit message template, so |
146 summary = cmdutil.format_changeset_summary(ui, c, b'split') | 146 # disable the label() template function while we render it. |
147 header += _(b'HG: - %s\n') % summary | 147 with ui.configoverride( |
148 {(b'templatealias', b'label(l,x)'): b"x"}, b'split' | |
149 ): | |
150 for c in committed: | |
151 summary = cmdutil.format_changeset_summary(ui, c, b'split') | |
152 header += _(b'HG: - %s\n') % summary | |
148 header += _( | 153 header += _( |
149 b'HG: Write commit message for the next split changeset.\n' | 154 b'HG: Write commit message for the next split changeset.\n' |
150 ) | 155 ) |
151 else: | 156 else: |
152 header = _( | 157 header = _( |