rebase: use tuple as `replacement` keys
authorBoris Feld <boris.feld@octobus.net>
Wed, 26 Sep 2018 23:51:11 +0200
changeset 39918 a8318c9cb2ad
parent 39917 a8ccd9523d40
child 39919 0428feb1f0d7
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.
hgext/rebase.py
--- 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)