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.
--- a/mercurial/revlog.py Fri Jul 20 14:32:56 2018 +0200
+++ b/mercurial/revlog.py Wed Mar 07 12:28:04 2018 +0100
@@ -2557,6 +2557,15 @@
if self._maxchainlen and self._maxchainlen < deltainfo.chainlen:
return False
+ # bad delta from intermediate snapshot size limit
+ #
+ # If an intermediate snapshot size is higher than the limit. The
+ # limit exist to prevent endless chain of intermediate delta to be
+ # created.
+ if (deltainfo.snapshotdepth is not None and
+ (textlen >> deltainfo.snapshotdepth) < deltainfo.deltalen):
+ return False
+
return True
def _addrevision(self, node, rawtext, transaction, link, p1, p2, flags,