revlog: ensure intermediate snapshot have decreasing size
If the intermediate snapshot is bigger than the previous one, there is likely
a better snapshot to be made at a different level.
--- a/mercurial/revlog.py Wed Mar 07 12:28:04 2018 +0100
+++ b/mercurial/revlog.py Mon Jul 23 16:21:58 2018 +0200
@@ -2566,6 +2566,12 @@
(textlen >> deltainfo.snapshotdepth) < deltainfo.deltalen):
return False
+ # bad delta if new intermediate snapshot is larger than the previous
+ # snapshot
+ if (deltainfo.snapshotdepth
+ and self.length(deltainfo.base) < deltainfo.deltalen):
+ return False
+
return True
def _addrevision(self, node, rawtext, transaction, link, p1, p2, flags,