Mercurial > public > mercurial-scm > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
23284:8d47c212b0dd | 23285:6cc1f388ac80 |
---|---|
1252 if text is None: | 1252 if text is None: |
1253 textlen = mdiff.patchedsize(self.rawsize(cachedelta[0]), | 1253 textlen = mdiff.patchedsize(self.rawsize(cachedelta[0]), |
1254 cachedelta[1]) | 1254 cachedelta[1]) |
1255 else: | 1255 else: |
1256 textlen = len(text) | 1256 textlen = len(text) |
1257 if (d is None or dist > textlen * 2 or | 1257 if (d is None or dist > textlen * 2 or l > textlen or |
1258 (self._maxchainlen and chainlen > self._maxchainlen)): | 1258 (self._maxchainlen and chainlen > self._maxchainlen)): |
1259 text = buildtext() | 1259 text = buildtext() |
1260 data = self.compress(text) | 1260 data = self.compress(text) |
1261 l = len(data[1]) + len(data[0]) | 1261 l = len(data[1]) + len(data[0]) |
1262 base = chainbase = curr | 1262 base = chainbase = curr |