mercurial/revlogutils/deltas.py
changeset 39503 5aef5afa8654
parent 39502 e4d4361d0bcd
child 39504 05a165dc4f55
--- a/mercurial/revlogutils/deltas.py	Fri Sep 07 11:17:35 2018 -0400
+++ b/mercurial/revlogutils/deltas.py	Fri Sep 07 11:17:36 2018 -0400
@@ -658,6 +658,19 @@
             if base == nullrev:
                 break
             good = yield (base,)
+        # refine snapshot up
+        #
+        # XXX the _findsnapshots call can be expensive and is "duplicated" with
+        # the one done in `_rawgroups`. Once we start working on performance,
+        # we should make the two logics share this computation.
+        snapshots = collections.defaultdict(list)
+        _findsnapshots(revlog, snapshots, good + 1)
+        previous = None
+        while good != previous:
+            previous = good
+            children = tuple(sorted(c for c in snapshots[good]))
+            good = yield children
+
     # we have found nothing
     yield None