Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/revlogutils/deltas.py @ 49794:40e24d82b513
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.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sun, 06 Nov 2022 17:55:55 -0500 |
parents | b670eb3dd6c9 |
children | c261a628e525 |
comparison
equal
deleted
inserted
replaced
49793:b670eb3dd6c9 | 49794:40e24d82b513 |
---|---|
975 # | 975 # |
976 # It give a chance to reuse a delta chain unrelated to the current | 976 # It give a chance to reuse a delta chain unrelated to the current |
977 # revisions instead of starting our own. Without such re-use, | 977 # revisions instead of starting our own. Without such re-use, |
978 # topological branches would keep reopening new full chains. Creating | 978 # topological branches would keep reopening new full chains. Creating |
979 # more and more snapshot as the repository grow. | 979 # more and more snapshot as the repository grow. |
980 yield tuple(snapshot_cache.snapshots[nullrev]) | 980 full = [r for r in snapshot_cache.snapshots[nullrev] if snapfloor <= r] |
981 yield tuple(sorted(full)) | |
981 | 982 |
982 if not sparse: | 983 if not sparse: |
983 # other approach failed try against prev to hopefully save us a | 984 # other approach failed try against prev to hopefully save us a |
984 # fulltext. | 985 # fulltext. |
985 yield (prev,) | 986 yield (prev,) |