Mercurial > evolve
changeset 3347:ab5172ba3c81
stablerange: clarify sql transaction logic
This should help concurrent access.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 21 Dec 2017 03:42:54 +0100 |
parents | f4e28b781143 |
children | 895e16385a4f |
files | hgext3rd/evolve/stablerangecache.py |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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,