D6148: store: error out if fncache does not ends with a newline

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Mon Mar 18 09:57:12 EDT 2019


pulkit created this revision.
Herald added subscribers: mercurial-devel, mjpieters.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6148

AFFECTED FILES
  mercurial/store.py

CHANGE DETAILS

diff --git a/mercurial/store.py b/mercurial/store.py
--- a/mercurial/store.py
+++ b/mercurial/store.py
@@ -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()
 



To: pulkit, #hg-reviewers
Cc: mjpieters, mercurial-devel


More information about the Mercurial-devel mailing list