changeset 39020:0b5f534df82a

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
author Gregory Szorc <gregory.szorc@gmail.com>
date Thu, 09 Aug 2018 12:25:06 -0700
parents d0d197ab0646
children b95538a21613
files mercurial/changegroup.py
diffstat 1 files changed, 18 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- 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()