mercurial/revlog.py
changeset 30744 e12c0fa1f65b
parent 30743 2df983125d37
child 30745 c1b7b2285522
equal deleted inserted replaced
30743:2df983125d37 30744:e12c0fa1f65b
  1326 
  1326 
  1327         tr.replace(self.indexfile, trindex * self._io.size)
  1327         tr.replace(self.indexfile, trindex * self._io.size)
  1328         self._chunkclear()
  1328         self._chunkclear()
  1329 
  1329 
  1330     def addrevision(self, text, transaction, link, p1, p2, cachedelta=None,
  1330     def addrevision(self, text, transaction, link, p1, p2, cachedelta=None,
  1331                     node=None):
  1331                     node=None, flags=REVIDX_DEFAULT_FLAGS):
  1332         """add a revision to the log
  1332         """add a revision to the log
  1333 
  1333 
  1334         text - the revision data to add
  1334         text - the revision data to add
  1335         transaction - the transaction object used for rollback
  1335         transaction - the transaction object used for rollback
  1336         link - the linkrev data to add
  1336         link - the linkrev data to add
  1337         p1, p2 - the parent nodeids of the revision
  1337         p1, p2 - the parent nodeids of the revision
  1338         cachedelta - an optional precomputed delta
  1338         cachedelta - an optional precomputed delta
  1339         node - nodeid of revision; typically node is not specified, and it is
  1339         node - nodeid of revision; typically node is not specified, and it is
  1340             computed by default as hash(text, p1, p2), however subclasses might
  1340             computed by default as hash(text, p1, p2), however subclasses might
  1341             use different hashing method (and override checkhash() in such case)
  1341             use different hashing method (and override checkhash() in such case)
       
  1342         flags - the known flags to set on the revision
  1342         """
  1343         """
  1343         if link == nullrev:
  1344         if link == nullrev:
  1344             raise RevlogError(_("attempted to add linkrev -1 to %s")
  1345             raise RevlogError(_("attempted to add linkrev -1 to %s")
  1345                               % self.indexfile)
  1346                               % self.indexfile)
  1346 
  1347 
  1357         if not self._inline:
  1358         if not self._inline:
  1358             dfh = self.opener(self.datafile, "a+")
  1359             dfh = self.opener(self.datafile, "a+")
  1359         ifh = self.opener(self.indexfile, "a+", checkambig=self._checkambig)
  1360         ifh = self.opener(self.indexfile, "a+", checkambig=self._checkambig)
  1360         try:
  1361         try:
  1361             return self._addrevision(node, text, transaction, link, p1, p2,
  1362             return self._addrevision(node, text, transaction, link, p1, p2,
  1362                                      REVIDX_DEFAULT_FLAGS, cachedelta, ifh, dfh)
  1363                                      flags, cachedelta, ifh, dfh)
  1363         finally:
  1364         finally:
  1364             if dfh:
  1365             if dfh:
  1365                 dfh.close()
  1366                 dfh.close()
  1366             ifh.close()
  1367             ifh.close()
  1367 
  1368