changegroup: invert conditional and dedent
authorGregory Szorc <gregory.szorc@gmail.com>
Tue, 07 Aug 2018 15:13:25 -0700
changeset 39043 d56a6b78de3b
parent 39042 e11d07cc125c
child 39044 5959ef78d834
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
mercurial/changegroup.py
--- 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