##// END OF EJS Templates
revlog: add a `sidedata` parameters to addrevision...
marmoute -
r43256:33532939 default
parent child Browse files
Show More
@@ -129,10 +129,13 b' class remotefilelog(flagutil.flagprocess'
129 return data
129 return data
130
130
131 def addrevision(self, text, transaction, linknode, p1, p2, cachedelta=None,
131 def addrevision(self, text, transaction, linknode, p1, p2, cachedelta=None,
132 node=None, flags=revlog.REVIDX_DEFAULT_FLAGS):
132 node=None, flags=revlog.REVIDX_DEFAULT_FLAGS,
133 sidedata=None):
133 # text passed to "addrevision" includes hg filelog metadata header
134 # text passed to "addrevision" includes hg filelog metadata header
134 if node is None:
135 if node is None:
135 node = storageutil.hashrevisionsha1(text, p1, p2)
136 node = storageutil.hashrevisionsha1(text, p1, p2)
137 if sidedata is None:
138 sidedata = {}
136
139
137 meta, metaoffset = storageutil.parsemeta(text)
140 meta, metaoffset = storageutil.parsemeta(text)
138 rawtext, validatehash = self._processflagswrite(text, flags)
141 rawtext, validatehash = self._processflagswrite(text, flags)
@@ -1816,7 +1816,8 b' class revlog(flagutil.flagprocessorsmixi'
1816 """
1816 """
1817
1817
1818 def addrevision(self, text, transaction, link, p1, p2, cachedelta=None,
1818 def addrevision(self, text, transaction, link, p1, p2, cachedelta=None,
1819 node=None, flags=REVIDX_DEFAULT_FLAGS, deltacomputer=None):
1819 node=None, flags=REVIDX_DEFAULT_FLAGS, deltacomputer=None,
1820 sidedata=None):
1820 """add a revision to the log
1821 """add a revision to the log
1821
1822
1822 text - the revision data to add
1823 text - the revision data to add
@@ -1835,6 +1836,9 b' class revlog(flagutil.flagprocessorsmixi'
1835 raise error.RevlogError(_("attempted to add linkrev -1 to %s")
1836 raise error.RevlogError(_("attempted to add linkrev -1 to %s")
1836 % self.indexfile)
1837 % self.indexfile)
1837
1838
1839 if sidedata is None:
1840 sidedata = {}
1841
1838 if flags:
1842 if flags:
1839 node = node or self.hash(text, p1, p2)
1843 node = node or self.hash(text, p1, p2)
1840
1844
General Comments 0
You need to be logged in to leave comments. Login now