# HG changeset patch # User Boris Feld # Date 1538000121 -7200 # Node ID a8ccd9523d4087614b89af1852f0a9a30242f3a9 # Parent 1857f50a964386063be82be1a0b3a92f242fedd7 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. diff -r 1857f50a9643 -r a8ccd9523d40 hgext/rebase.py --- 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):