##// END OF EJS Templates
revlog: bound based on the length of the compressed deltas...
Siddharth Agarwal -
r23287:426d7f90 default
parent child Browse files
Show More
@@ -1225,8 +1225,10 b' class revlog(object):'
1225 base = rev
1225 base = rev
1226 else:
1226 else:
1227 base = chainbase
1227 base = chainbase
1228 chainlen = self.chainlen(rev) + 1
1228 chainlen, compresseddeltalen = self._chaininfo(rev)
1229 return dist, l, data, base, chainbase, chainlen
1229 chainlen += 1
1230 compresseddeltalen += l
1231 return dist, l, data, base, chainbase, chainlen, compresseddeltalen
1230
1232
1231 curr = len(self)
1233 curr = len(self)
1232 prev = curr - 1
1234 prev = curr - 1
@@ -1251,7 +1253,7 b' class revlog(object):'
1251 d = builddelta(prev)
1253 d = builddelta(prev)
1252 else:
1254 else:
1253 d = builddelta(prev)
1255 d = builddelta(prev)
1254 dist, l, data, base, chainbase, chainlen = d
1256 dist, l, data, base, chainbase, chainlen, compresseddeltalen = d
1255
1257
1256 # full versions are inserted when the needed deltas
1258 # full versions are inserted when the needed deltas
1257 # become comparable to the uncompressed text
1259 # become comparable to the uncompressed text
@@ -1260,7 +1262,13 b' class revlog(object):'
1260 cachedelta[1])
1262 cachedelta[1])
1261 else:
1263 else:
1262 textlen = len(text)
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 if (d is None or dist > textlen * 2 or l > textlen or
1270 if (d is None or dist > textlen * 2 or l > textlen or
1271 compresseddeltalen > textlen * 2 or
1264 (self._maxchainlen and chainlen > self._maxchainlen)):
1272 (self._maxchainlen and chainlen > self._maxchainlen)):
1265 text = buildtext()
1273 text = buildtext()
1266 data = self.compress(text)
1274 data = self.compress(text)
General Comments 0
You need to be logged in to leave comments. Login now