mercurial/revlogutils/deltas.py
changeset 51339 410afe5b13fc
parent 51338 176d530f59af
child 51340 5c0693553cb6
equal deleted inserted replaced
51338:176d530f59af 51339:410afe5b13fc
  1064         if self.revinfo.textlen < deltainfo.deltalen:
  1064         if self.revinfo.textlen < deltainfo.deltalen:
  1065             return False
  1065             return False
  1066 
  1066 
  1067         # - 'deltainfo.distance' is the distance from the base revision --
  1067         # - 'deltainfo.distance' is the distance from the base revision --
  1068         #   bounding it limits the amount of I/O we need to do.
  1068         #   bounding it limits the amount of I/O we need to do.
  1069         # - 'deltainfo.compresseddeltalen' is the sum of the total size of
       
  1070         #   deltas we need to apply -- bounding it limits the amount of CPU
       
  1071         #   we consume.
       
  1072 
  1069 
  1073         textlen = self.revinfo.textlen
  1070         textlen = self.revinfo.textlen
  1074         defaultmax = textlen * 4
  1071         defaultmax = textlen * 4
  1075         maxdist = self.revlog.delta_config.max_deltachain_span
  1072         maxdist = self.revlog.delta_config.max_deltachain_span
  1076         if not maxdist:
  1073         if not maxdist:
  1092         ):
  1089         ):
  1093             return False
  1090             return False
  1094 
  1091 
  1095         # Bad delta from cumulated payload size:
  1092         # Bad delta from cumulated payload size:
  1096         #
  1093         #
       
  1094         # - 'deltainfo.compresseddeltalen' is the sum of the total size of
       
  1095         #   deltas we need to apply -- bounding it limits the amount of CPU
       
  1096         #   we consume.
       
  1097         max_chain_data = self.revinfo.textlen * LIMIT_DELTA2TEXT
  1097         #   If the sum of delta get larger than K * target text length.
  1098         #   If the sum of delta get larger than K * target text length.
  1098         if textlen * LIMIT_DELTA2TEXT < deltainfo.compresseddeltalen:
  1099         if max_chain_data < deltainfo.compresseddeltalen:
  1099             return False
  1100             return False
  1100 
  1101 
  1101         # Bad delta from chain length:
  1102         # Bad delta from chain length:
  1102         #
  1103         #
  1103         #   If the number of delta in the chain gets too high.
  1104         #   If the number of delta in the chain gets too high.