snapshot: also use None as a stop value for `_refinegroup`
This is yet another small step toward turning `_refinegroups` into a co-routine.
--- 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