##// END OF EJS Templates
revlog: addgroup re-adds punched revisions for missing parents...
Vishakh H -
r12000:33610758 default
parent child Browse files
Show More
@@ -1154,7 +1154,8 b' class revlog(object):'
1154 def _addrevision(self, text, transaction, link, p1, p2,
1154 def _addrevision(self, text, transaction, link, p1, p2,
1155 cachedelta, ifh, dfh):
1155 cachedelta, ifh, dfh):
1156 node = hash(text, p1, p2)
1156 node = hash(text, p1, p2)
1157 if node in self.nodemap:
1157 if (node in self.nodemap and
1158 (not self.flags(self.rev(node)) & REVIDX_PUNCHED_FLAG)):
1158 return node
1159 return node
1159
1160
1160 curr = len(self)
1161 curr = len(self)
@@ -1305,7 +1306,8 b' class revlog(object):'
1305 for chunk in revs:
1306 for chunk in revs:
1306 node, p1, p2, cs = struct.unpack("20s20s20s20s", chunk[:80])
1307 node, p1, p2, cs = struct.unpack("20s20s20s20s", chunk[:80])
1307 link = linkmapper(cs)
1308 link = linkmapper(cs)
1308 if node in self.nodemap:
1309 if (node in self.nodemap and
1310 (not self.flags(self.rev(node)) & REVIDX_PUNCHED_FLAG)):
1309 # this can happen if two branches make the same change
1311 # this can happen if two branches make the same change
1310 chain = node
1312 chain = node
1311 continue
1313 continue
@@ -1314,7 +1316,21 b' class revlog(object):'
1314
1316
1315 for p in (p1, p2):
1317 for p in (p1, p2):
1316 if not p in self.nodemap:
1318 if not p in self.nodemap:
1317 raise LookupError(p, self.indexfile, _('unknown parent'))
1319 if self._shallow:
1320 # add null entries for missing parents
1321 if base == nullrev:
1322 base = len(self)
1323 e = (offset_type(end, REVIDX_PUNCHED_FLAG),
1324 0, 0, base, nullrev, nullrev, nullrev, p)
1325 self.index.insert(-1, e)
1326 self.nodemap[p] = r
1327 entry = self._io.packentry(e, self.node,
1328 self.version, r)
1329 ifh.write(entry)
1330 t, r = r, r + 1
1331 else:
1332 raise LookupError(p, self.indexfile,
1333 _('unknown parent'))
1318
1334
1319 if not chain:
1335 if not chain:
1320 # retrieve the parent revision of the delta chain
1336 # retrieve the parent revision of the delta chain
@@ -1341,6 +1357,7 b' class revlog(object):'
1341 text = self.revision(chain)
1357 text = self.revision(chain)
1342 if len(text) == 0:
1358 if len(text) == 0:
1343 # skip over trivial delta header
1359 # skip over trivial delta header
1360 # text == '' in the case of nullrev or punched revision
1344 text = buffer(delta, 12)
1361 text = buffer(delta, 12)
1345 else:
1362 else:
1346 text = mdiff.patches(text, [delta])
1363 text = mdiff.patches(text, [delta])
General Comments 0
You need to be logged in to leave comments. Login now