Patchwork D6951: sidedatacopies: get and store sidedata in the changelogrevision object

login
register
mail settings
Submitter phabricator
Date Oct. 8, 2019, 12:38 a.m.
Message ID <6e7f86bcb0f930f32c5c12f03709c39f@localhost.localdomain>
Download mbox | patch
Permalink /patch/42084/
State Not Applicable
Headers show

Comments

phabricator - Oct. 8, 2019, 12:38 a.m.
marmoute updated this revision to Diff 16952.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6951?vs=16783&id=16952

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6951/new/

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

AFFECTED FILES
  mercurial/changelog.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/changelog.py b/mercurial/changelog.py
--- a/mercurial/changelog.py
+++ b/mercurial/changelog.py
@@ -268,9 +268,10 @@ 
     __slots__ = (
         r'_offsets',
         r'_text',
+        r'_sidedata',
     )
 
-    def __new__(cls, text):
+    def __new__(cls, text, sidedata):
         if not text:
             return _changelogrevision(extra=_defaultextra)
 
@@ -302,6 +303,7 @@ 
 
         self._offsets = (nl1, nl2, nl3, doublenl)
         self._text = text
+        self._sidedata = sidedata
 
         return self
 
@@ -613,12 +615,13 @@ 
         ``changelogrevision`` instead, as it is faster for partial object
         access.
         """
-        c = changelogrevision(self.revision(node))
+        c = changelogrevision(*self._revisiondata(node))
         return (c.manifest, c.user, c.date, c.files, c.description, c.extra)
 
     def changelogrevision(self, nodeorrev):
         """Obtain a ``changelogrevision`` for a node or revision."""
-        return changelogrevision(self.revision(nodeorrev))
+        text, sidedata = self._revisiondata(nodeorrev)
+        return changelogrevision(text, sidedata)
 
     def readfiles(self, node):
         """