mercurial/revlog.py
changeset 25822 00e3f909907f
parent 25660 328739ea70c3
child 25891 c73fada78589
equal deleted inserted replaced
25821:d68544b69736 25822:00e3f909907f
  1377             ifh.write(entry)
  1377             ifh.write(entry)
  1378             ifh.write(data[0])
  1378             ifh.write(data[0])
  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
  1392         content = []
  1395         content = []
  1393         node = None
  1396         node = None
  1457                     flags |= REVIDX_ISCENSORED
  1460                     flags |= REVIDX_ISCENSORED
  1458 
  1461 
  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
  1465                     ifh.close()
  1476                     ifh.close()
  1466                     dfh = self.opener(self.datafile, "a")
  1477                     dfh = self.opener(self.datafile, "a")