# HG changeset patch # User Pierre-Yves David # Date 1535358015 -7200 # Node ID bebba5a5c82d84955c0cf7e03bb526c6c632e38c # Parent 47b00d3b8ea23fcb614e067d1488571472f56450 obshashrange: always check in base cachekey against the recorded one Ignoring the check in the none case is just disaster waiting to happens. diff -r 47b00d3b8ea2 -r bebba5a5c82d hgext3rd/evolve/obsdiscovery.py --- a/hgext3rd/evolve/obsdiscovery.py Mon Aug 27 10:16:12 2018 +0200 +++ b/hgext3rd/evolve/obsdiscovery.py Mon Aug 27 10:20:15 2018 +0200 @@ -598,17 +598,15 @@ con.execute(_newmeta, self._fullcachekey) else: con = self._con - if self._ondiskcachekey is not None: - meta = con.execute(_querymeta).fetchone() - if meta[1:] != self._ondiskcachekey: - # drifting is currently an issue because this means another - # process might have already added the cache line we are about - # to add. This will confuse sqlite - msg = _('obshashrange cache: skipping write, ' - 'database drifted under my feet\n') - data = (meta[2], meta[1], self._ondiskcachekey[0], self._ondiskcachekey[1]) - repo.ui.warn(msg) - return + meta = con.execute(_querymeta).fetchone() + if meta[1:] != self._ondiskcachekey: + # drifting is currently an issue because this means another + # process might have already added the cache line we are about + # to add. This will confuse sqlite + msg = _('obshashrange cache: skipping write, ' + 'database drifted under my feet\n') + repo.ui.warn(msg) + return data = ((rangeid[0], rangeid[1], self.get(rangeid)) for rangeid in self._new) con.executemany(_updateobshash, data) cachekey = self._fullcachekey