Patchwork D1293: rebase: use fm.formatlist() and fm.formatdict() to support user template

login
register
mail settings
Submitter phabricator
Date Nov. 22, 2017, 1:38 p.m.
Message ID <661a97fe859154d035a952c71b003814@localhost.localdomain>
Download mbox | patch
Permalink /patch/25720/
State Not Applicable
Headers show

Comments

phabricator - Nov. 22, 2017, 1:38 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGf56a30b844aa: rebase: use fm.formatlist() and fm.formatdict() to support user template (authored by pulkit, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D1293?vs=3725&id=3767#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1293?vs=3725&id=3767

REVISION DETAIL
  https://phab.mercurial-scm.org/D1293

AFFECTED FILES
  hgext/rebase.py
  tests/test-rebase-templates.t

CHANGE DETAILS




To: pulkit, #hg-reviewers, yuja
Cc: yuja, mercurial-devel

Patch

diff --git a/tests/test-rebase-templates.t b/tests/test-rebase-templates.t
--- a/tests/test-rebase-templates.t
+++ b/tests/test-rebase-templates.t
@@ -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)
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -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):