stablerangecache: sanity check subranges
authorJoerg Sonnenberger <joerg@bec.de>
Sun, 03 May 2020 01:45:04 +0200
changeset 5322 498dc888ff40
parent 5321 aca826b5bd4d
child 5323 417503ef667d
stablerangecache: sanity check subranges Try to detect invalid conditions on insert as would result in deep recursions and final aborts much later. This has been observed on two different machines and the check makes it hopefully possible to find the origin of the problem.
hgext3rd/evolve/stablerangecache.py
--- a/hgext3rd/evolve/stablerangecache.py	Sun May 03 20:11:37 2020 +0800
+++ b/hgext3rd/evolve/stablerangecache.py	Sun May 03 01:45:04 2020 +0200
@@ -234,6 +234,7 @@
 
     def _setsub(self, rangeid, value):
         assert rangeid not in self._unsavedsubranges
+        assert 0 <= rangeid[1] <= rangeid[0], rangeid
         self._unsavedsubranges[rangeid] = value
         super(stablerangesqlbase, self)._setsub(rangeid, value)