comparison mercurial/revlog.py @ 39155:a43ef77cab1d

revlog: bound number of snapshots in a chain To limit the number of snapshot chained, we enforce them to be smaller and smaller. This guarantee the number of snapshot in a chain will be bounded to a small number.
author Paul Morelle <paul.morelle@octobus.net>
date Wed, 07 Mar 2018 12:28:04 +0100
parents e0da43e2f71f
children b3b4bee161cf
comparison
equal deleted inserted replaced
39154:e0da43e2f71f 39155:a43ef77cab1d
2555 # 2555 #
2556 # If the number of delta in the chain gets too high. 2556 # If the number of delta in the chain gets too high.
2557 if self._maxchainlen and self._maxchainlen < deltainfo.chainlen: 2557 if self._maxchainlen and self._maxchainlen < deltainfo.chainlen:
2558 return False 2558 return False
2559 2559
2560 # bad delta from intermediate snapshot size limit
2561 #
2562 # If an intermediate snapshot size is higher than the limit. The
2563 # limit exist to prevent endless chain of intermediate delta to be
2564 # created.
2565 if (deltainfo.snapshotdepth is not None and
2566 (textlen >> deltainfo.snapshotdepth) < deltainfo.deltalen):
2567 return False
2568
2560 return True 2569 return True
2561 2570
2562 def _addrevision(self, node, rawtext, transaction, link, p1, p2, flags, 2571 def _addrevision(self, node, rawtext, transaction, link, p1, p2, flags,
2563 cachedelta, ifh, dfh, alwayscache=False, 2572 cachedelta, ifh, dfh, alwayscache=False,
2564 deltacomputer=None): 2573 deltacomputer=None):