diff --git a/mercurial/changelog.py b/mercurial/changelog.py --- a/mercurial/changelog.py +++ b/mercurial/changelog.py @@ -152,7 +152,7 @@ class changelogrevision(object): __slots__ = ( 'date', - 'description', + '_rawdesc', 'extra', 'files', 'manifest', @@ -185,9 +185,10 @@ class changelogrevision(object): # # changelog v0 doesn't use extra - last = text.index("\n\n") - self.description = encoding.tolocal(text[last + 2:]) - l = text[:last].split('\n') + doublenl = text.index('\n\n') + self._rawdesc = text[doublenl + 2:] + + l = text[:doublenl].split('\n') self.manifest = bin(l[0]) self.user = encoding.tolocal(l[1]) @@ -209,6 +210,10 @@ class changelogrevision(object): return self + @property + def description(self): + return encoding.tolocal(self._rawdesc) + class changelog(revlog.revlog): def __init__(self, opener): revlog.revlog.__init__(self, opener, "00changelog.i")