Patchwork [07,of,11] revlog: move part of "addrevision" to "addrawrevision"

login
register
mail settings
Submitter Jun Wu
Date May 10, 2017, 8:34 a.m.
Message ID <eb7b96bc42d08670983d.1494405266@x1c>
Download mbox | patch
Permalink /patch/20553/
State Accepted
Headers show

Comments

Jun Wu - May 10, 2017, 8:34 a.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1494390426 25200
#      Tue May 09 21:27:06 2017 -0700
# Node ID eb7b96bc42d08670983d5d75635198f62c3459a8
# Parent  963d6fa49835ce66db6961ca31b02241c979cb99
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r eb7b96bc42d0
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.

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1503,4 +1503,13 @@  class revlog(object):
             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: