revlog: move part of "addrevision" to "addrawrevision"
authorJun Wu <quark@fb.com>
Tue, 09 May 2017 21:27:06 -0700
changeset 32244 3de4c61b5087
parent 32243 07da778f3b58
child 32245 3a755652ce3a
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.
mercurial/revlog.py
--- a/mercurial/revlog.py	Tue May 09 20:23:21 2017 -0700
+++ b/mercurial/revlog.py	Tue May 09 21:27:06 2017 -0700
@@ -1502,6 +1502,15 @@
         if validatehash:
             self.checkhash(rawtext, node, p1=p1, p2=p2)
 
+        return self.addrawrevision(rawtext, transaction, link, p1, p2, node,
+                                   flags, cachedelta=cachedelta)
+
+    def addrawrevision(self, rawtext, transaction, link, p1, p2, node, flags,
+                       cachedelta=None):
+        """add a raw revision with known flags, node and parents
+        useful when reusing a revision not stored in this revlog (ex: received
+        over wire, or read from an external bundle).
+        """
         dfh = None
         if not self._inline:
             dfh = self.opener(self.datafile, "a+")