changeset 30209:9d06b65c5df2

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.
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 17 Oct 2016 22:51:22 -0700
parents 87a7c0d403ff
children 5e4f16874a9f
files mercurial/manifest.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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):