# HG changeset patch # User Gregory Szorc # Date 2018-08-09 19:25:06 # Node ID 0b5f534df82a8dd97ea34f317e0cd0e9127b50f7 # Parent d0d197ab0646cb7114ea716c55088058f963f9de 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 diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py --- a/mercurial/changegroup.py +++ b/mercurial/changegroup.py @@ -1281,25 +1281,27 @@ class cgpacker(object): 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()