Show More
@@ -1225,8 +1225,10 b' class revlog(object):' | |||
|
1225 | 1225 | base = rev |
|
1226 | 1226 | else: |
|
1227 | 1227 | base = chainbase |
|
1228 |
chainlen = self. |
|
|
1229 | return dist, l, data, base, chainbase, chainlen | |
|
1228 | chainlen, compresseddeltalen = self._chaininfo(rev) | |
|
1229 | chainlen += 1 | |
|
1230 | compresseddeltalen += l | |
|
1231 | return dist, l, data, base, chainbase, chainlen, compresseddeltalen | |
|
1230 | 1232 | |
|
1231 | 1233 | curr = len(self) |
|
1232 | 1234 | prev = curr - 1 |
@@ -1251,7 +1253,7 b' class revlog(object):' | |||
|
1251 | 1253 | d = builddelta(prev) |
|
1252 | 1254 | else: |
|
1253 | 1255 | d = builddelta(prev) |
|
1254 | dist, l, data, base, chainbase, chainlen = d | |
|
1256 | dist, l, data, base, chainbase, chainlen, compresseddeltalen = d | |
|
1255 | 1257 | |
|
1256 | 1258 | # full versions are inserted when the needed deltas |
|
1257 | 1259 | # become comparable to the uncompressed text |
@@ -1260,7 +1262,13 b' class revlog(object):' | |||
|
1260 | 1262 | cachedelta[1]) |
|
1261 | 1263 | else: |
|
1262 | 1264 | textlen = len(text) |
|
1265 | ||
|
1266 | # - 'dist' is the distance from the base revision -- bounding it limits | |
|
1267 | # the amount of I/O we need to do. | |
|
1268 | # - 'compresseddeltalen' is the sum of the total size of deltas we need | |
|
1269 | # to apply -- bounding it limits the amount of CPU we consume. | |
|
1263 | 1270 | if (d is None or dist > textlen * 2 or l > textlen or |
|
1271 | compresseddeltalen > textlen * 2 or | |
|
1264 | 1272 | (self._maxchainlen and chainlen > self._maxchainlen)): |
|
1265 | 1273 | text = buildtext() |
|
1266 | 1274 | data = self.compress(text) |
General Comments 0
You need to be logged in to leave comments.
Login now