Show More
@@ -1140,7 +1140,8 b' class revlog(object):' | |||
|
1140 | 1140 | # raise RevlogError(_("already have %s") % hex(node[:4])) |
|
1141 | 1141 | chain = node |
|
1142 | 1142 | continue |
|
1143 |
delta = chunk |
|
|
1143 | delta = buffer(chunk, 80) | |
|
1144 | del chunk | |
|
1144 | 1145 | |
|
1145 | 1146 | for p in (p1, p2): |
|
1146 | 1147 | if not p in self.nodemap: |
@@ -1159,17 +1160,22 b' class revlog(object):' | |||
|
1159 | 1160 | # current size. |
|
1160 | 1161 | |
|
1161 | 1162 | if chain == prev: |
|
1162 |
|
|
|
1163 |
cdelta = |
|
|
1163 | cdelta = compress(delta) | |
|
1164 | cdeltalen = len(cdelta[0]) + len(cdelta[1]) | |
|
1164 | 1165 | textlen = mdiff.patchedsize(textlen, delta) |
|
1165 | 1166 | |
|
1166 |
if chain != prev or (end - start + |
|
|
1167 | if chain != prev or (end - start + cdeltalen) > textlen * 2: | |
|
1167 | 1168 | # flush our writes here so we can read it in revision |
|
1168 | 1169 | if dfh: |
|
1169 | 1170 | dfh.flush() |
|
1170 | 1171 | ifh.flush() |
|
1171 | 1172 | text = self.revision(chain) |
|
1173 | if len(text) == 0: | |
|
1174 | # skip over trivial delta header | |
|
1175 | text = buffer(delta, 12) | |
|
1176 | else: | |
|
1172 | 1177 | text = mdiff.patches(text, [delta]) |
|
1178 | del delta | |
|
1173 | 1179 | chk = self._addrevision(text, transaction, link, p1, p2, None, |
|
1174 | 1180 | ifh, dfh) |
|
1175 | 1181 | if not dfh and not self._inline: |
@@ -1181,20 +1187,22 b' class revlog(object):' | |||
|
1181 | 1187 | raise RevlogError(_("consistency error adding group")) |
|
1182 | 1188 | textlen = len(text) |
|
1183 | 1189 | else: |
|
1184 |
e = (offset_type(end, 0), |
|
|
1190 | e = (offset_type(end, 0), cdeltalen, textlen, base, | |
|
1185 | 1191 | link, self.rev(p1), self.rev(p2), node) |
|
1186 | 1192 | self.index.insert(-1, e) |
|
1187 | 1193 | self.nodemap[node] = r |
|
1188 | 1194 | entry = self._io.packentry(e, self.node, self.version, r) |
|
1189 | 1195 | if self._inline: |
|
1190 | 1196 | ifh.write(entry) |
|
1191 | ifh.write(cdelta) | |
|
1197 | ifh.write(cdelta[0]) | |
|
1198 | ifh.write(cdelta[1]) | |
|
1192 | 1199 | self.checkinlinesize(transaction, ifh) |
|
1193 | 1200 | if not self._inline: |
|
1194 | 1201 | dfh = self.opener(self.datafile, "a") |
|
1195 | 1202 | ifh = self.opener(self.indexfile, "a") |
|
1196 | 1203 | else: |
|
1197 | dfh.write(cdelta) | |
|
1204 | dfh.write(cdelta[0]) | |
|
1205 | dfh.write(cdelta[1]) | |
|
1198 | 1206 | ifh.write(entry) |
|
1199 | 1207 | |
|
1200 | 1208 | t, r, chain, prev = r, r + 1, node, node |
General Comments 0
You need to be logged in to leave comments.
Login now