mercurial/pure/parsers.py
changeset 43533 642433629e20
parent 43531 dcf9826c8d8c
child 43534 0c659fc20207
--- a/mercurial/pure/parsers.py	Fri Nov 08 10:01:10 2019 +0100
+++ b/mercurial/pure/parsers.py	Sat Nov 09 05:54:22 2019 +0100
@@ -55,6 +55,12 @@
             nodemap[n] = r
         return nodemap
 
+    def _stripnodes(self, start):
+        if 'nodemap' in vars(self):
+            for r in range(start, len(self)):
+                n = self[r][7]
+                del self.nodemap[n]
+
     def clearcaches(self):
         self.__dict__.pop('nodemap', None)
 
@@ -103,6 +109,7 @@
             raise ValueError(b"deleting slices only supports a:-1 with step 1")
         i = i.start
         self._check_index(i)
+        self._stripnodes(i)
         if i < self._lgt:
             self._data = self._data[: i * indexsize]
             self._lgt = i
@@ -140,6 +147,7 @@
             raise ValueError(b"deleting slices only supports a:-1 with step 1")
         i = i.start
         self._check_index(i)
+        self._stripnodes(i)
         if i < self._lgt:
             self._offsets = self._offsets[:i]
             self._lgt = i