diff mercurial/revlog.py @ 23285:6cc1f388ac80

revlog: store fulltext when compressed delta is bigger than it This is a very silly case and not particularly likely to happen in the wild, but it turns out we can hit it in a couple of places. As we tune the storage parameters we're likely to hit more such cases. The affected test cases all have smaller revlogs now.
author Siddharth Agarwal <sid0@fb.com>
date Tue, 11 Nov 2014 21:41:12 -0800
parents 8d47c212b0dd
children 40e0067899d4
line wrap: on
line diff
--- a/mercurial/revlog.py	Tue Nov 11 21:39:56 2014 -0800
+++ b/mercurial/revlog.py	Tue Nov 11 21:41:12 2014 -0800
@@ -1254,7 +1254,7 @@
                                         cachedelta[1])
         else:
             textlen = len(text)
-        if (d is None or dist > textlen * 2 or
+        if (d is None or dist > textlen * 2 or l > textlen or
             (self._maxchainlen and chainlen > self._maxchainlen)):
             text = buildtext()
             data = self.compress(text)