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
--- 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()