comparison mercurial/revlog.py @ 32244:3de4c61b5087

revlog: move part of "addrevision" to "addrawrevision" "addrawrevision" will be the public API to reuse revision rawdata elsewhere. It will be used by a future patch.
author Jun Wu <quark@fb.com>
date Tue, 09 May 2017 21:27:06 -0700
parents 75e93d95aae6
children 539cbe0f8fa3
comparison
equal deleted inserted replaced
32243:07da778f3b58 32244:3de4c61b5087
1500 return node 1500 return node
1501 1501
1502 if validatehash: 1502 if validatehash:
1503 self.checkhash(rawtext, node, p1=p1, p2=p2) 1503 self.checkhash(rawtext, node, p1=p1, p2=p2)
1504 1504
1505 return self.addrawrevision(rawtext, transaction, link, p1, p2, node,
1506 flags, cachedelta=cachedelta)
1507
1508 def addrawrevision(self, rawtext, transaction, link, p1, p2, node, flags,
1509 cachedelta=None):
1510 """add a raw revision with known flags, node and parents
1511 useful when reusing a revision not stored in this revlog (ex: received
1512 over wire, or read from an external bundle).
1513 """
1505 dfh = None 1514 dfh = None
1506 if not self._inline: 1515 if not self._inline:
1507 dfh = self.opener(self.datafile, "a+") 1516 dfh = self.opener(self.datafile, "a+")
1508 ifh = self.opener(self.indexfile, "a+", checkambig=self._checkambig) 1517 ifh = self.opener(self.indexfile, "a+", checkambig=self._checkambig)
1509 try: 1518 try: