# HG changeset patch # User Boris Feld # Date 1536333453 14400 # Node ID 51cec7fb672e0ddd923fa26b5de83f86be334335 # Parent 04b75f3a3f2ae2bcc3bee76bd571e8cc1e87539f snapshot: also use None as a stop value for `_refinegroup` This is yet another small step toward turning `_refinegroups` into a co-routine. diff -r 04b75f3a3f2a -r 51cec7fb672e mercurial/revlogutils/deltas.py --- a/mercurial/revlogutils/deltas.py Fri Sep 07 11:17:33 2018 -0400 +++ b/mercurial/revlogutils/deltas.py Fri Sep 07 11:17:33 2018 -0400 @@ -587,7 +587,11 @@ deltas_limit = textlen * LIMIT_DELTA2TEXT tested = set([nullrev]) - for temptative in _refinedgroups(revlog, p1, p2, cachedelta): + candidates = _refinedgroups(revlog, p1, p2, cachedelta) + while True: + temptative = next(candidates) + if temptative is None: + break group = [] for rev in temptative: # skip over empty delta (no need to include them in a chain) @@ -632,6 +636,8 @@ good = yield candidates if good is not None: break + # we have found nothing + yield None def _rawgroups(revlog, p1, p2, cachedelta): """Provides group of revision to be tested as delta base