# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1509193225 -19800 # Node ID f56a30b844aa91eecd4e31b1fbc291d9d24973b3 # Parent c157bb0120a9e7f7213970ad60f6071c8e9f2a69 rebase: use fm.formatlist() and fm.formatdict() to support user template Thanks to Yuya for suggesting this in D1173. Differential Revision: https://phab.mercurial-scm.org/D1293 diff -r c157bb0120a9 -r f56a30b844aa hgext/rebase.py --- a/hgext/rebase.py Thu Nov 09 20:06:30 2017 +0530 +++ b/hgext/rebase.py Sat Oct 28 17:50:25 2017 +0530 @@ -21,7 +21,6 @@ from mercurial.i18n import _ from mercurial.node import ( - hex, nullid, nullrev, short, @@ -1563,8 +1562,12 @@ replacements[oldnode] = succs scmutil.cleanupnodes(repo, replacements, 'rebase', moves) if fm: - nodechanges = {hex(oldn): [hex(n) for n in newn] - for oldn, newn in replacements.iteritems()} + hf = fm.hexfunc + fl = fm.formatlist + fd = fm.formatdict + nodechanges = fd({hf(oldn): fl([hf(n) for n in newn], name='node') + for oldn, newn in replacements.iteritems()}, + key="oldnode", value="newnodes") fm.data(nodechanges=nodechanges) def pullrebase(orig, ui, repo, *args, **opts): diff -r c157bb0120a9 -r f56a30b844aa tests/test-rebase-templates.t --- a/tests/test-rebase-templates.t Thu Nov 09 20:06:30 2017 +0530 +++ b/tests/test-rebase-templates.t Sat Oct 28 17:50:25 2017 +0530 @@ -54,5 +54,4 @@ $ hg rebase -s 6 -d 4 -q -T "{nodechanges % '{oldnode}:{newnodes % ' {node} '}'}" - d9d6773efc831c274eace04bc13e8e6412517139: f48cd65c6dc3d2acb55da54402a5b029546e546f (no-eol) (false !) - d9d6773efc831c274eace04bc13e8e6412517139 (no-eol) + d9d6773efc831c274eace04bc13e8e6412517139: f48cd65c6dc3d2acb55da54402a5b029546e546f (no-eol)