D6809: revlog: return sidedata map from `_revisiondata`
marmoute (Pierre-Yves David)
phabricator at mercurial-scm.org
Mon Sep 9 21:23:50 UTC 2019
marmoute updated this revision to Diff 16475.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D6809?vs=16414&id=16475
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D6809/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D6809
AFFECTED FILES
mercurial/revlog.py
CHANGE DETAILS
diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1614,7 +1614,7 @@
msg = ('revlog.revision(..., raw=True) is deprecated, '
'use revlog.rawdata(...)')
util.nouideprecwarn(msg, '5.2', stacklevel=2)
- return self._revisiondata(nodeorrev, _df, raw=raw)
+ return self._revisiondata(nodeorrev, _df, raw=raw)[0]
def sidedata(self, nodeorrev, _df=None):
"""a map of extra data related to the changeset but not part of the hash
@@ -1637,7 +1637,7 @@
# fast path the special `nullid` rev
if node == nullid:
- return ""
+ return "", {}
# The text as stored inside the revlog. Might be the revision or might
# need to be processed to retrieve the revision.
@@ -1648,7 +1648,7 @@
if raw and validated:
# if we don't want to process the raw text and that raw
# text is cached, we can exit early.
- return rawtext
+ return rawtext, {}
if rev is None:
rev = self.rev(node)
# the revlog's flag for this revision
@@ -1657,8 +1657,9 @@
if validated and flags == REVIDX_DEFAULT_FLAGS:
# no extra flags set, no flag processor runs, text = rawtext
- return rawtext
-
+ return rawtext, {}
+
+ sidedata = {}
if raw:
validatehash = self._processflagsraw(rawtext, flags)
text = rawtext
@@ -1669,7 +1670,7 @@
if not validated:
self._revisioncache = (node, rev, rawtext)
- return text
+ return text, sidedata
def _rawtext(self, node, rev, _df=None):
"""return the possibly unvalidated rawtext for a revision
@@ -1719,7 +1720,7 @@
_df - an existing file handle to read from. (internal-only)
"""
- return self._revisiondata(nodeorrev, _df, raw=True)
+ return self._revisiondata(nodeorrev, _df, raw=True)[0]
def hash(self, text, p1, p2):
"""Compute a node hash.
To: marmoute, yuja, durin42, indygreg, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list