mercurial/changelog.py
changeset 43143 037a8759eda1
parent 43142 beed7ce61681
child 43145 4296cc3c4ae1
equal deleted inserted replaced
43142:beed7ce61681 43143:037a8759eda1
   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__.
   300         else:
   301         else:
   301             doublenl = text.index(b'\n\n', nl3 + 1)
   302             doublenl = text.index(b'\n\n', nl3 + 1)
   302 
   303 
   303         self._offsets = (nl1, nl2, nl3, doublenl)
   304         self._offsets = (nl1, nl2, nl3, doublenl)
   304         self._text = text
   305         self._text = text
       
   306         self._sidedata = sidedata
   305 
   307 
   306         return self
   308         return self
   307 
   309 
   308     @property
   310     @property
   309     def manifest(self):
   311     def manifest(self):
   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         """