changegroup: invert conditional and dedent
I don't like seeing code that visually resembles the pyramid of
doom.
Differential Revision: https://phab.mercurial-scm.org/D4197
--- a/mercurial/changegroup.py Tue Aug 07 15:10:38 2018 -0700
+++ b/mercurial/changegroup.py Tue Aug 07 15:13:25 2018 -0700
@@ -1048,20 +1048,24 @@
dir, nodes = tmfnodes.popitem()
store = dirlog(dir)
prunednodes = self._prune(store, nodes, commonrevs)
- if not dir or prunednodes:
- lookupfn = makelookupmflinknode(dir, nodes)
+
+ if dir and not prunednodes:
+ continue
+
+ lookupfn = makelookupmflinknode(dir, nodes)
- if self._ellipses:
- revs = _sortnodesellipsis(store, prunednodes, cl,
- lookupfn)
- else:
- revs = _sortnodesnormal(store, prunednodes,
- self._reorder)
+ if self._ellipses:
+ revs = _sortnodesellipsis(store, prunednodes, cl,
+ lookupfn)
+ else:
+ revs = _sortnodesnormal(store, prunednodes,
+ self._reorder)
- for x in self._packmanifests(dir, store, revs, lookupfn,
- clrevtolocalrev):
- size += len(x)
- yield x
+ for x in self._packmanifests(dir, store, revs, lookupfn,
+ clrevtolocalrev):
+ size += len(x)
+ yield x
+
self._verbosenote(_('%8.i (manifests)\n') % size)
yield self._manifestsend