stablerange: clarify sql transaction logic
This should help concurrent access.
--- a/hgext3rd/evolve/stablerangecache.py Thu Dec 21 03:30:13 2017 +0100
+++ b/hgext3rd/evolve/stablerangecache.py Thu Dec 21 03:42:54 2017 +0100
@@ -193,6 +193,7 @@
con = self._db()
if con is None:
return
+ con.execute('BEGIN IMMEDIATE;')
with con:
for req in _sqliteschema:
con.execute(req)
@@ -204,6 +205,7 @@
con.execute(_newmeta, meta)
else:
con = self._con
+ con.execute('BEGIN IMMEDIATE;')
meta = con.execute(_querymeta).fetchone()
if meta[2] != self._ondisktipnode or meta[1] != self._ondisktiprev:
# drifting is currently an issue because this means another
@@ -215,6 +217,7 @@
data = (meta[2], meta[1], self._ondisktiprev, self._ondisktipnode)
repo.ui.warn(msg)
repo.ui.warn(hint % data)
+ con.execute('ROLLBACK;')
return
meta = [self._tiprev,
self._tipnode,