# HG changeset patch # User Pierre-Yves David # Date 2022-11-06 22:55:55 # Node ID 40e24d82b5133a6ac689e14667ce7d6dcd4a482e # Parent b670eb3dd6c911c99b435980ed1e1dddc2c00efa delta-find: make sure we only use newer full snapshot as candidate The current code does not needs to protect against this, as there are no older snapshot in the current cache. However as we are getting ready to reuse this cache from one revision to another, we need the code to protect itself about what's coming. diff --git a/mercurial/revlogutils/deltas.py b/mercurial/revlogutils/deltas.py --- a/mercurial/revlogutils/deltas.py +++ b/mercurial/revlogutils/deltas.py @@ -977,7 +977,8 @@ def _rawgroups(revlog, p1, p2, cachedelt # revisions instead of starting our own. Without such re-use, # topological branches would keep reopening new full chains. Creating # more and more snapshot as the repository grow. - yield tuple(snapshot_cache.snapshots[nullrev]) + full = [r for r in snapshot_cache.snapshots[nullrev] if snapfloor <= r] + yield tuple(sorted(full)) if not sparse: # other approach failed try against prev to hopefully save us a