mercurial/revlogutils/deltas.py
changeset 51341 176d530f59af
parent 51340 1ea56b10dd4a
child 51342 410afe5b13fc
--- 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.