manifest: don't store None in fulltextcache
authorMartin von Zweigbergk <martinvonz@google.com>
Mon, 17 Oct 2016 22:51:22 -0700
changeset 30209 9d06b65c5df2
parent 30208 87a7c0d403ff
child 30210 5e4f16874a9f
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.
mercurial/manifest.py
--- a/mercurial/manifest.py	Tue Oct 18 02:09:08 2016 +0200
+++ b/mercurial/manifest.py	Mon Oct 17 22:51:22 2016 -0700
@@ -1210,7 +1210,8 @@
                 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 @@
             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):