mercurial/changelog.py
changeset 28493 7796473c11b3
parent 28492 837f1c437d58
child 28494 63653147e9bb
--- a/mercurial/changelog.py	Sun Mar 06 14:30:25 2016 -0800
+++ b/mercurial/changelog.py	Sun Mar 06 14:31:06 2016 -0800
@@ -153,7 +153,7 @@
     __slots__ = (
         '_rawdateextra',
         '_rawdesc',
-        'files',
+        '_rawfiles',
         '_rawmanifest',
         '_rawuser',
     )
@@ -196,8 +196,12 @@
         nl3 = text.index('\n', nl2 + 1)
         self._rawdateextra = text[nl2 + 1:nl3]
 
-        l = text[:doublenl].split('\n')
-        self.files = l[3:]
+        # The list of files may be empty. Which means nl3 is the first of the
+        # double newline that precedes the description.
+        if nl3 == doublenl:
+            self._rawfiles = None
+        else:
+            self._rawfiles = text[nl3 + 1:doublenl]
 
         return self
 
@@ -242,6 +246,13 @@
         return decodeextra(raw)
 
     @property
+    def files(self):
+        if self._rawfiles is None:
+            return []
+
+        return self._rawfiles.split('\n')
+
+    @property
     def description(self):
         return encoding.tolocal(self._rawdesc)