changeset 39917:a8ccd9523d40

rebase: expand a long "one-liner" When a one-liner gets 3 lines longs, it lose its expressivity benefits. We expand it into a simple for loop. This makes future changes of the code in that area clearer.
author Boris Feld <boris.feld@octobus.net>
date Thu, 27 Sep 2018 00:15:21 +0200
parents 1857f50a9643
children a8318c9cb2ad
files hgext/rebase.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/rebase.py	Wed Sep 26 21:28:21 2018 +0200
+++ b/hgext/rebase.py	Thu Sep 27 00:15:21 2018 +0200
@@ -1783,9 +1783,10 @@
         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")
+        changes = {}
+        for oldn, newn in replacements.iteritems():
+            changes[hf(oldn)] = fl([hf(n) for n in newn], name='node')
+        nodechanges = fd(changes, key="oldnode", value="newnodes")
         fm.data(nodechanges=nodechanges)
 
 def pullrebase(orig, ui, repo, *args, **opts):