changeset 47382:d6a52783d2ba

revlog: implement sidedata without using _revisiondata When they was introduced sidedata where grouped with the actual revision data and unpacking one came with the other. Sidedata moved be stored "independently" and it no longer make sense to retrieve both at the same time unconditionnaly. We start with changeset the implementation of the `revlog.sidedata` command to no longer use `self._revisiondata`. More users need to be migrated to direct usage of this `revlog.sidedata` method. This will be done in the coming changesets. Differential Revision: https://phab.mercurial-scm.org/D10780
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 27 May 2021 03:21:53 +0200
parents 8aa3968c6d44
children 659a452ee263
files mercurial/revlog.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlog.py	Fri May 28 23:44:58 2021 +0200
+++ b/mercurial/revlog.py	Thu May 27 03:21:53 2021 +0200
@@ -1976,7 +1976,12 @@
         mapping object will likely be used in the future for a more
         efficient/lazy code.
         """
-        return self._revisiondata(nodeorrev, _df)[1]
+        # deal with <nodeorrev> argument type
+        if isinstance(nodeorrev, int):
+            rev = nodeorrev
+        else:
+            rev = self.rev(nodeorrev)
+        return self._sidedata(rev)
 
     def _revisiondata(self, nodeorrev, _df=None, raw=False):
         # deal with <nodeorrev> argument type