Submitter | phabricator |
---|---|
Date | Oct. 3, 2019, 5:56 a.m. |
Message ID | <differential-rev-PHID-DREV-4ptyp6xnybgu32xjeqn3-req@mercurial-scm.org> |
Download | mbox | patch |
Permalink | /patch/41936/ |
State | Superseded |
Headers | show |
Comments
martinvonz added inline comments. INLINE COMMENTS > changelog.py:618-624 > + 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) nit: inconsistent way of calling the `changelogrevision` constructor between these two call sites REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D6951/new/ REVISION DETAIL https://phab.mercurial-scm.org/D6951 To: marmoute, #hg-reviewers Cc: martinvonz, mercurial-devel
marmoute added inline comments. INLINE COMMENTS > martinvonz wrote in changelog.py:618-624 > nit: inconsistent way of calling the `changelogrevision` constructor between these two call sites Is a followup good enough for you ? REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D6951/new/ REVISION DETAIL https://phab.mercurial-scm.org/D6951 To: marmoute, #hg-reviewers Cc: martinvonz, mercurial-devel
martinvonz added inline comments. INLINE COMMENTS > marmoute wrote in changelog.py:618-624 > Is a followup good enough for you ? Yes, even leaving it inconsistent is good enough for me :) I don't care that much REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D6951/new/ REVISION DETAIL https://phab.mercurial-scm.org/D6951 To: marmoute, #hg-reviewers Cc: martinvonz, mercurial-devel
Patch
diff --git a/mercurial/changelog.py b/mercurial/changelog.py --- a/mercurial/changelog.py +++ b/mercurial/changelog.py @@ -245,9 +245,10 @@ __slots__ = ( r'_offsets', r'_text', + r'_sidedata', ) - def __new__(cls, text): + def __new__(cls, text, sidedata): if not text: return _changelogrevision(extra=_defaultextra) @@ -279,6 +280,7 @@ self._offsets = (nl1, nl2, nl3, doublenl) self._text = text + self._sidedata = sidedata return self @@ -582,7 +584,7 @@ ``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, @@ -594,7 +596,8 @@ 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): """