Mercurial > public > mercurial-scm > hg
comparison mercurial/revlog.py @ 39156:b3b4bee161cf
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.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Mon, 23 Jul 2018 16:21:58 +0200 |
parents | a43ef77cab1d |
children | a98e926b2f5b |
comparison
equal
deleted
inserted
replaced
39155:a43ef77cab1d | 39156:b3b4bee161cf |
---|---|
2564 # created. | 2564 # created. |
2565 if (deltainfo.snapshotdepth is not None and | 2565 if (deltainfo.snapshotdepth is not None and |
2566 (textlen >> deltainfo.snapshotdepth) < deltainfo.deltalen): | 2566 (textlen >> deltainfo.snapshotdepth) < deltainfo.deltalen): |
2567 return False | 2567 return False |
2568 | 2568 |
2569 # bad delta if new intermediate snapshot is larger than the previous | |
2570 # snapshot | |
2571 if (deltainfo.snapshotdepth | |
2572 and self.length(deltainfo.base) < deltainfo.deltalen): | |
2573 return False | |
2574 | |
2569 return True | 2575 return True |
2570 | 2576 |
2571 def _addrevision(self, node, rawtext, transaction, link, p1, p2, flags, | 2577 def _addrevision(self, node, rawtext, transaction, link, p1, p2, flags, |
2572 cachedelta, ifh, dfh, alwayscache=False, | 2578 cachedelta, ifh, dfh, alwayscache=False, |
2573 deltacomputer=None): | 2579 deltacomputer=None): |