# HG changeset patch # User Martin von Zweigbergk # Date 2016-10-18 05:51:22 # Node ID 9d06b65c5df2ccc6714745e9607b0ce5403971de # Parent 87a7c0d403ff29dcae2a41e0516c75bbd9f6a5a8 manifest: don't store None in fulltextcache When we read a value from fulltextcache, we expect it to be an array, so we should not store None in it. Found while working on narrowhg. diff --git a/mercurial/manifest.py b/mercurial/manifest.py --- a/mercurial/manifest.py +++ b/mercurial/manifest.py @@ -1210,7 +1210,8 @@ class manifestrevlog(revlog.revlog): n = self.addrevision(text, transaction, link, p1, p2) arraytext = array.array('c', text) - self.fulltextcache[n] = arraytext + if arraytext is not None: + self.fulltextcache[n] = arraytext return n @@ -1506,7 +1507,8 @@ class manifest(manifestrevlog): m = self._newmanifest(text) arraytext = array.array('c', text) self._mancache[node] = m - self.fulltextcache[node] = arraytext + if arraytext is not None: + self.fulltextcache[node] = arraytext return m def readshallow(self, node):