# HG changeset patch # User Pierre-Yves David # Date 1670325031 -3600 # 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 -r d57b966cdeb1 -r acdb9a15137c mercurial/revlogutils/deltas.py --- a/mercurial/revlogutils/deltas.py Wed Dec 07 20:05:19 2022 +0100 +++ b/mercurial/revlogutils/deltas.py Tue Dec 06 12:10:31 2022 +0100 @@ -684,6 +684,15 @@ 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