##// END OF EJS Templates
revlog: split and document good delta conditional...
Boris Feld -
r39119:152ae0f8 default
parent child Browse files
Show More
@@ -2473,9 +2473,30 b' class revlog(object):'
2473 # certain size. Be also apply this tradeoff here and relax span
2473 # certain size. Be also apply this tradeoff here and relax span
2474 # constraint for small enought content.
2474 # constraint for small enought content.
2475 maxdist = self._srmingapsize
2475 maxdist = self._srmingapsize
2476 if (distance > maxdist or deltainfo.deltalen > textlen or
2476
2477 deltainfo.compresseddeltalen > textlen * 2 or
2477 # Bad delta from read span:
2478 (self._maxchainlen and deltainfo.chainlen > self._maxchainlen)):
2478 #
2479 # If the span of data read is larger than the maximum allowed.
2480 if maxdist < distance:
2481 return False
2482
2483 # Bad delta from new delta size:
2484 #
2485 # If the delta size is larger than the target text, storing the
2486 # delta will be inefficient.
2487 if textlen < deltainfo.deltalen:
2488 return False
2489
2490 # Bad delta from cumulated payload size:
2491 #
2492 # If the sum of delta get larger than K * target text length.
2493 if textlen * 2 < deltainfo.compresseddeltalen:
2494 return False
2495
2496 # Bad delta from chain length:
2497 #
2498 # If the number of delta in the chain gets too high.
2499 if self._maxchainlen and self._maxchainlen < deltainfo.chainlen:
2479 return False
2500 return False
2480
2501
2481 return True
2502 return True
General Comments 0
You need to be logged in to leave comments. Login now