Patchwork D10780: revlog: implement sidedata without using _revisiondata

login
register
mail settings
Submitter phabricator
Date May 28, 2021, 10:57 p.m.
Message ID <differential-rev-PHID-DREV-bekwio2czx3oyhfv2tzl-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49101/
State Superseded
Headers show

Comments

phabricator - May 28, 2021, 10:57 p.m.
marmoute created this revision.
Herald added a reviewer: indygreg.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10780

AFFECTED FILES
  mercurial/revlog.py

CHANGE DETAILS




To: marmoute, indygreg, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -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