# HG changeset patch # User Pierre-Yves David # Date 2022-12-06 11:10:31 # Node ID acdb9a15137cb5bc41457222857a3a80e17084fd # Parent d57b966cdeb1d5ab2f2ed2500dc74547c073951d bundle: when forcing acceptance of incoming delta also accept snapshot Snapshot where never considered reusable and the unbundling side always tried to find a delta from them. In the `forced` mode this is counter-productive because it will either connect two delta-tree that should not be connected or it will spend potentially a lot of time because creating a full snapshot anyway. So in this mode, we accept the full snapshot as is. This changeset is benchmarked with its children so please do not split them apart when landing. diff --git a/mercurial/revlogutils/deltas.py b/mercurial/revlogutils/deltas.py --- a/mercurial/revlogutils/deltas.py +++ b/mercurial/revlogutils/deltas.py @@ -684,6 +684,15 @@ def _candidategroups( yield None return + if ( + cachedelta is not None + and nullrev == cachedelta[0] + and cachedelta[2] == DELTA_BASE_REUSE_FORCE + ): + # instruction are to forcibly do a full snapshot + yield None + return + deltalength = revlog.length deltaparent = revlog.deltaparent sparse = revlog._sparserevlog