Mercurial > public > mercurial-scm > hg
comparison mercurial/revlogutils/deltas.py @ 49776:acdb9a15137c
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.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 06 Dec 2022 12:10:31 +0100 |
parents | d57b966cdeb1 |
children | ca1522fe4ec8 |
comparison
equal
deleted
inserted
replaced
49775:d57b966cdeb1 | 49776:acdb9a15137c |
---|---|
679 This top level function focus on emitting groups with unique and worthwhile | 679 This top level function focus on emitting groups with unique and worthwhile |
680 content. See _raw_candidate_groups for details about the group order. | 680 content. See _raw_candidate_groups for details about the group order. |
681 """ | 681 """ |
682 # should we try to build a delta? | 682 # should we try to build a delta? |
683 if not (len(revlog) and revlog._storedeltachains): | 683 if not (len(revlog) and revlog._storedeltachains): |
684 yield None | |
685 return | |
686 | |
687 if ( | |
688 cachedelta is not None | |
689 and nullrev == cachedelta[0] | |
690 and cachedelta[2] == DELTA_BASE_REUSE_FORCE | |
691 ): | |
692 # instruction are to forcibly do a full snapshot | |
684 yield None | 693 yield None |
685 return | 694 return |
686 | 695 |
687 deltalength = revlog.length | 696 deltalength = revlog.length |
688 deltaparent = revlog.deltaparent | 697 deltaparent = revlog.deltaparent |