changegroup: invert conditional and dedent
authorGregory Szorc <gregory.szorc@gmail.com>
Thu, 09 Aug 2018 12:25:06 -0700
changeset 39020 0b5f534df82a
parent 39019 d0d197ab0646
child 39022 b95538a21613
changegroup: invert conditional and dedent I don't like else-less blocks that are indented for no reason. Differential Revision: https://phab.mercurial-scm.org/D4217
mercurial/changegroup.py
--- a/mercurial/changegroup.py	Thu Aug 09 09:40:29 2018 -0700
+++ b/mercurial/changegroup.py	Thu Aug 09 12:25:06 2018 -0700
@@ -1281,25 +1281,27 @@
             filenodes = [n for n in linkrevnodes
                          if flr(frev(n)) not in commonrevs]
 
-            if filenodes:
-                if self._ellipses:
-                    revs = _sortnodesellipsis(filerevlog, filenodes,
-                                              cl, lookupfilelog)
-                else:
-                    revs = _sortnodesnormal(filerevlog, filenodes,
-                                            self._reorder)
+            if not filenodes:
+                continue
 
-                progress.update(i + 1, item=fname)
+            if self._ellipses:
+                revs = _sortnodesellipsis(filerevlog, filenodes,
+                                          cl, lookupfilelog)
+            else:
+                revs = _sortnodesnormal(filerevlog, filenodes,
+                                        self._reorder)
 
-                deltas = deltagroup(
-                    self._repo, revs, filerevlog, False, lookupfilelog,
-                    self._forcedeltaparentprev,
-                    ellipses=self._ellipses,
-                    clrevtolocalrev=clrevtolocalrev,
-                    fullclnodes=self._fullclnodes,
-                    precomputedellipsis=self._precomputedellipsis)
+            progress.update(i + 1, item=fname)
 
-                yield fname, deltas
+            deltas = deltagroup(
+                self._repo, revs, filerevlog, False, lookupfilelog,
+                self._forcedeltaparentprev,
+                ellipses=self._ellipses,
+                clrevtolocalrev=clrevtolocalrev,
+                fullclnodes=self._fullclnodes,
+                precomputedellipsis=self._precomputedellipsis)
+
+            yield fname, deltas
 
         progress.complete()