comparison mercurial/revlogutils/deltas.py @ 51049:e80e2d614c9d

revlog: remove legacy usage of `_maxchainlen` All core code is now getting the setting from the DeltaConfig object.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 10 Oct 2023 11:05:54 +0200
parents f636103c4d67
children 96f521df2508
comparison
equal deleted inserted replaced
51048:21ef03239f43 51049:e80e2d614c9d
639 return False 639 return False
640 640
641 # Bad delta from chain length: 641 # Bad delta from chain length:
642 # 642 #
643 # If the number of delta in the chain gets too high. 643 # If the number of delta in the chain gets too high.
644 if revlog._maxchainlen and revlog._maxchainlen < deltainfo.chainlen: 644 if (
645 revlog.delta_config.max_chain_len
646 and revlog.delta_config.max_chain_len < deltainfo.chainlen
647 ):
645 return False 648 return False
646 649
647 # bad delta from intermediate snapshot size limit 650 # bad delta from intermediate snapshot size limit
648 # 651 #
649 # If an intermediate snapshot size is higher than the limit. The 652 # If an intermediate snapshot size is higher than the limit. The
769 # The delta building process will compute the chaininfo in all 772 # The delta building process will compute the chaininfo in all
770 # case, since that computation is cached, it is fine to access it 773 # case, since that computation is cached, it is fine to access it
771 # here too. 774 # here too.
772 chainlen, chainsize = revlog._chaininfo(rev) 775 chainlen, chainsize = revlog._chaininfo(rev)
773 # if chain will be too long, skip base 776 # if chain will be too long, skip base
774 if revlog._maxchainlen and chainlen >= revlog._maxchainlen: 777 if (
778 revlog.delta_config.max_chain_len
779 and chainlen >= revlog.delta_config.max_chain_len
780 ):
775 tested.add(rev) 781 tested.add(rev)
776 continue 782 continue
777 # if chain already have too much data, skip base 783 # if chain already have too much data, skip base
778 if deltas_limit < chainsize: 784 if deltas_limit < chainsize:
779 tested.add(rev) 785 tested.add(rev)