# HG changeset patch # User Pierre-Yves David # Date 1570419411 14400 # Node ID 037a8759eda16303aa3ce6513ce556d2c696f2a2 # Parent beed7ce6168130d5d9bd115a8350f3d7d58a02cd sidedatacopies: get and store sidedata in the changelogrevision object The object provide a simple way to access changelog entry, we need it to also bear the sidedata value. Since the sidedata are retrieved at the same time as the revision, we can do that without extra cost. Differential Revision: https://phab.mercurial-scm.org/D6951 diff -r beed7ce61681 -r 037a8759eda1 mercurial/changelog.py --- a/mercurial/changelog.py Sun Oct 06 23:36:51 2019 -0400 +++ b/mercurial/changelog.py Sun Oct 06 23:36:51 2019 -0400 @@ -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): """