comparison hgext/rebase.py @ 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 7198cdbbbde1
children a8318c9cb2ad
comparison
equal deleted inserted replaced
39916:1857f50a9643 39917:a8ccd9523d40
1781 scmutil.cleanupnodes(repo, replacements, 'rebase', moves, backup=backup) 1781 scmutil.cleanupnodes(repo, replacements, 'rebase', moves, backup=backup)
1782 if fm: 1782 if fm:
1783 hf = fm.hexfunc 1783 hf = fm.hexfunc
1784 fl = fm.formatlist 1784 fl = fm.formatlist
1785 fd = fm.formatdict 1785 fd = fm.formatdict
1786 nodechanges = fd({hf(oldn): fl([hf(n) for n in newn], name='node') 1786 changes = {}
1787 for oldn, newn in replacements.iteritems()}, 1787 for oldn, newn in replacements.iteritems():
1788 key="oldnode", value="newnodes") 1788 changes[hf(oldn)] = fl([hf(n) for n in newn], name='node')
1789 nodechanges = fd(changes, key="oldnode", value="newnodes")
1789 fm.data(nodechanges=nodechanges) 1790 fm.data(nodechanges=nodechanges)
1790 1791
1791 def pullrebase(orig, ui, repo, *args, **opts): 1792 def pullrebase(orig, ui, repo, *args, **opts):
1792 'Call rebase after pull if the latter has been invoked with --rebase' 1793 'Call rebase after pull if the latter has been invoked with --rebase'
1793 ret = None 1794 ret = None