snapshot: turn _refinedgroups into a coroutine
authorBoris Feld <boris.feld@octobus.net>
Fri, 07 Sep 2018 11:17:34 -0400
changeset 39500 cc85ebb68ff9
parent 39499 51cec7fb672e
child 39501 993d7e2c8b79
snapshot: turn _refinedgroups into a coroutine We are now almost ready to start adding refining logic.
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:34 2018 -0400
@@ -589,7 +589,7 @@
     tested = set([nullrev])
     candidates = _refinedgroups(revlog, p1, p2, cachedelta)
     while True:
-        temptative = next(candidates)
+        temptative = candidates.send(good)
         if temptative is None:
             break
         group = []
@@ -618,8 +618,6 @@
             #      impacting performances. Some bounding or slicing mecanism
             #      would help to reduce this impact.
             good = yield tuple(group)
-        if good is not None:
-            break
     yield None
 
 def _findsnapshots(revlog, cache, start_rev):