Show More
@@ -1171,32 +1171,36 b' class revlog(object):' | |||
|
1171 | 1171 | |
|
1172 | 1172 | curr = len(self) |
|
1173 | 1173 | prev = curr - 1 |
|
1174 |
base = |
|
|
1174 | base = curr | |
|
1175 | 1175 | offset = self.end(prev) |
|
1176 | 1176 | flags = 0 |
|
1177 | 1177 | d = None |
|
1178 | 1178 | |
|
1179 | if curr: | |
|
1179 | if self._parentdelta: | |
|
1180 | deltarev, deltanode = self.rev(p1), p1 | |
|
1181 | flags = REVIDX_PARENTDELTA | |
|
1182 | else: | |
|
1183 | deltarev, deltanode = prev, self.node(prev) | |
|
1184 | ||
|
1185 | # should we try to build a delta? | |
|
1186 | if deltarev != nullrev: | |
|
1180 | 1187 | # can we use the cached delta? |
|
1181 | 1188 | if cachedelta: |
|
1182 | 1189 | cacherev, d = cachedelta |
|
1183 |
if cacherev != |
|
|
1190 | if cacherev != deltarev: | |
|
1184 | 1191 | d = None |
|
1185 |
if |
|
|
1186 |
|
|
|
1187 | ptext = self.revision(p1) | |
|
1188 | flags = REVIDX_PARENTDELTA | |
|
1189 | else: | |
|
1190 | ptext = self.revision(self.node(prev)) | |
|
1192 | if d is None: | |
|
1193 | ptext = self.revision(deltanode) | |
|
1191 | 1194 | d = mdiff.textdiff(ptext, text) |
|
1192 | 1195 | data = compress(d) |
|
1193 | 1196 | l = len(data[1]) + len(data[0]) |
|
1197 | base = self.base(deltarev) | |
|
1194 | 1198 | dist = l + offset - self.start(base) |
|
1195 | 1199 | |
|
1196 | 1200 | # full versions are inserted when the needed deltas |
|
1197 | 1201 | # become comparable to the uncompressed text |
|
1198 | 1202 | # or the base revision is punched |
|
1199 |
if ( |
|
|
1203 | if (d is None or dist > len(text) * 2 or | |
|
1200 | 1204 | (self.flags(base) & REVIDX_PUNCHED_FLAG)): |
|
1201 | 1205 | data = compress(text) |
|
1202 | 1206 | l = len(data[1]) + len(data[0]) |
General Comments 0
You need to be logged in to leave comments.
Login now