266 """ |
266 """ |
267 |
267 |
268 __slots__ = ( |
268 __slots__ = ( |
269 r'_offsets', |
269 r'_offsets', |
270 r'_text', |
270 r'_text', |
|
271 r'_sidedata', |
271 ) |
272 ) |
272 |
273 |
273 def __new__(cls, text): |
274 def __new__(cls, text, sidedata): |
274 if not text: |
275 if not text: |
275 return _changelogrevision(extra=_defaultextra) |
276 return _changelogrevision(extra=_defaultextra) |
276 |
277 |
277 self = super(changelogrevision, cls).__new__(cls) |
278 self = super(changelogrevision, cls).__new__(cls) |
278 # We could return here and implement the following as an __init__. |
279 # We could return here and implement the following as an __init__. |
611 |
613 |
612 Unless you need to access all fields, consider calling |
614 Unless you need to access all fields, consider calling |
613 ``changelogrevision`` instead, as it is faster for partial object |
615 ``changelogrevision`` instead, as it is faster for partial object |
614 access. |
616 access. |
615 """ |
617 """ |
616 c = changelogrevision(self.revision(node)) |
618 c = changelogrevision(*self._revisiondata(node)) |
617 return (c.manifest, c.user, c.date, c.files, c.description, c.extra) |
619 return (c.manifest, c.user, c.date, c.files, c.description, c.extra) |
618 |
620 |
619 def changelogrevision(self, nodeorrev): |
621 def changelogrevision(self, nodeorrev): |
620 """Obtain a ``changelogrevision`` for a node or revision.""" |
622 """Obtain a ``changelogrevision`` for a node or revision.""" |
621 return changelogrevision(self.revision(nodeorrev)) |
623 text, sidedata = self._revisiondata(nodeorrev) |
|
624 return changelogrevision(text, sidedata) |
622 |
625 |
623 def readfiles(self, node): |
626 def readfiles(self, node): |
624 """ |
627 """ |
625 short version of read that only returns the files modified by the cset |
628 short version of read that only returns the files modified by the cset |
626 """ |
629 """ |