# HG changeset patch # User Pierre-Yves David # Date 1535358015 -7200 # Node ID 3d51dc72d8841b7dfc4db8e4c7aeca90e5c08c03 # Parent d468db69f9a0cf06da84aded8e7e8c0049b0ffed 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 d468db69f9a0 -r 3d51dc72d884 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 @@ -603,17 +603,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