changeset 41981:a920a9e1795a

store: error out if fncache does not ends with a newline If fncache does not ends with a newline, chunk will not be fully consumed. It should be a bug somewhere or the fncache is corrupted if that happens. Let's error out in such cases. Differential Revision: https://phab.mercurial-scm.org/D6148
author Pulkit Goyal <pulkit@yandex-team.ru>
date Mon, 18 Mar 2019 16:56:24 +0300
parents 6cad258e1348
children f8c5225b9054
files mercurial/store.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/store.py	Mon Mar 18 14:57:43 2019 +0300
+++ b/mercurial/store.py	Mon Mar 18 16:56:24 2019 +0300
@@ -481,6 +481,8 @@
                 # chunksize, so let's keep iterating
                 pass
 
+        if chunk:
+            raise error.Abort(_("fncache does not ends with a newline"))
         self._checkentries(fp)
         fp.close()