# HG changeset patch # User Martin von Zweigbergk # Date 1605551406 28800 # Node ID ec6ba70be853ebba75938c94d985bd79fe22e93b # Parent 8357e0e81bb7950eaf9a33624c073f32e1a1d713 tests: show how `hg histedit` can put color codes in histedit plan Differential Revision: https://phab.mercurial-scm.org/D9323 diff -r 8357e0e81bb7 -r ec6ba70be853 hgext/histedit.py --- a/hgext/histedit.py Fri Nov 13 09:41:49 2020 -0800 +++ b/hgext/histedit.py Mon Nov 16 10:30:06 2020 -0800 @@ -525,9 +525,10 @@ """ ctx = self.repo[self.node] ui = self.repo.ui - summary = cmdutil.rendertemplate( - ctx, ui.config(b'histedit', b'summary-template') - ) + with ui.configoverride({}, b'histedit'): + summary = cmdutil.rendertemplate( + ctx, ui.config(b'histedit', b'summary-template') + ) summary = summary.splitlines()[0] line = b'%s %s %s' % (self.verb, ctx, summary) # trim to 75 columns by default so it's not stupidly wide in my editor diff -r 8357e0e81bb7 -r ec6ba70be853 tests/test-histedit-commute.t --- a/tests/test-histedit-commute.t Fri Nov 13 09:41:49 2020 -0800 +++ b/tests/test-histedit-commute.t Mon Nov 16 10:30:06 2020 -0800 @@ -104,6 +104,32 @@ # +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] + + # Edit history between 177f92b77385 and 652413bf663e + # + # Commits are listed from least to most recent + # + # You can reorder changesets by reordering the lines + # + # Commands: + # + # e, edit = use commit, but stop for amending + # m, mess = edit commit message without changing commit content + # p, pick = use commit + # b, base = checkout changeset and apply further changesets from there + # d, drop = remove commit from history + # f, fold = use commit, but combine it with the one above + # r, roll = like fold, but discard this commit's description and date + # + + edit the history (use a hacky editor to check histedit-last-edit.txt backup)