# HG changeset patch # User Pierre-Yves David # Date 1704378936 -3600 # Node ID 176d530f59afd05dcc1699ed70cfd0cb5bf7a950 # Parent 1ea56b10dd4a1fadc83ddddc82ab5bbf96cc6245 delta-find: move delta size check earlier in is_good_delta_info This will clarify future patches by regrouping related logic before larger movement. diff -r 1ea56b10dd4a -r 176d530f59af mercurial/revlogutils/deltas.py --- a/mercurial/revlogutils/deltas.py Thu Jan 04 15:04:10 2024 +0100 +++ b/mercurial/revlogutils/deltas.py Thu Jan 04 15:35:36 2024 +0100 @@ -1057,6 +1057,13 @@ or not self.revlog.delta_config.general_delta ) + # Bad delta from new delta size: + # + # If the delta size is larger than the target text, storing the delta + # will be inefficient. + if self.revinfo.textlen < deltainfo.deltalen: + return False + # - 'deltainfo.distance' is the distance from the base revision -- # bounding it limits the amount of I/O we need to do. # - 'deltainfo.compresseddeltalen' is the sum of the total size of @@ -1085,13 +1092,6 @@ ): return False - # Bad delta from new delta size: - # - # If the delta size is larger than the target text, storing the delta - # will be inefficient. - if textlen < deltainfo.deltalen: - return False - # Bad delta from cumulated payload size: # # If the sum of delta get larger than K * target text length.