Show More
@@ -1379,13 +1379,16 b' class revlog(object):' | |||||
1379 | ifh.write(data[1]) |
|
1379 | ifh.write(data[1]) | |
1380 | self.checkinlinesize(transaction, ifh) |
|
1380 | self.checkinlinesize(transaction, ifh) | |
1381 |
|
1381 | |||
1382 | def addgroup(self, bundle, linkmapper, transaction): |
|
1382 | def addgroup(self, bundle, linkmapper, transaction, addrevisioncb=None): | |
1383 | """ |
|
1383 | """ | |
1384 | add a delta group |
|
1384 | add a delta group | |
1385 |
|
1385 | |||
1386 | given a set of deltas, add them to the revision log. the |
|
1386 | given a set of deltas, add them to the revision log. the | |
1387 | first delta is against its parent, which should be in our |
|
1387 | first delta is against its parent, which should be in our | |
1388 | log, the rest are against the previous delta. |
|
1388 | log, the rest are against the previous delta. | |
|
1389 | ||||
|
1390 | If ``addrevisioncb`` is defined, it will be called with arguments of | |||
|
1391 | this revlog and the node that was added. | |||
1389 | """ |
|
1392 | """ | |
1390 |
|
1393 | |||
1391 | # track the base of the current delta log |
|
1394 | # track the base of the current delta log | |
@@ -1459,6 +1462,14 b' class revlog(object):' | |||||
1459 | chain = self._addrevision(node, None, transaction, link, |
|
1462 | chain = self._addrevision(node, None, transaction, link, | |
1460 | p1, p2, flags, (baserev, delta), |
|
1463 | p1, p2, flags, (baserev, delta), | |
1461 | ifh, dfh) |
|
1464 | ifh, dfh) | |
|
1465 | ||||
|
1466 | if addrevisioncb: | |||
|
1467 | # Data for added revision can't be read unless flushed | |||
|
1468 | # because _loadchunk always opensa new file handle and | |||
|
1469 | # there is no guarantee data was actually written yet. | |||
|
1470 | flush() | |||
|
1471 | addrevisioncb(self, chain) | |||
|
1472 | ||||
1462 | if not dfh and not self._inline: |
|
1473 | if not dfh and not self._inline: | |
1463 | # addrevision switched from inline to conventional |
|
1474 | # addrevision switched from inline to conventional | |
1464 | # reopen the index |
|
1475 | # reopen the index |
General Comments 0
You need to be logged in to leave comments.
Login now