diff hgext/rebase.py @ 39918:a8318c9cb2ad

rebase: use tuple as `replacement` keys Now that `cleanupnodes` support tuples as key, we update the rebase code to use them. No changes in the replacement tracked are introduced yet.
author Boris Feld <boris.feld@octobus.net>
date Wed, 26 Sep 2018 23:51:11 +0200
parents a8ccd9523d40
children 0428feb1f0d7
line wrap: on
line diff
--- a/hgext/rebase.py	Thu Sep 27 00:15:21 2018 +0200
+++ b/hgext/rebase.py	Wed Sep 26 23:51:11 2018 +0200
@@ -1777,15 +1777,16 @@
                 else:
                     succs = (newnode,)
                 if succs is not None:
-                    replacements[oldnode] = succs
+                    replacements[(oldnode,)] = succs
     scmutil.cleanupnodes(repo, replacements, 'rebase', moves, backup=backup)
     if fm:
         hf = fm.hexfunc
         fl = fm.formatlist
         fd = fm.formatdict
         changes = {}
-        for oldn, newn in replacements.iteritems():
-            changes[hf(oldn)] = fl([hf(n) for n in newn], name='node')
+        for oldns, newn in replacements.iteritems():
+            for oldn in oldns:
+                changes[hf(oldn)] = fl([hf(n) for n in newn], name='node')
         nodechanges = fd(changes, key="oldnode", value="newnodes")
         fm.data(nodechanges=nodechanges)