# HG changeset patch # User Pierre-Yves David # Date 1495024818 -7200 # Node ID 1b3a797c458621f299515a725c06f45d13032980 # Parent 2a194fe1a557a9f497e8094f85192020b8ec2dae obshashrange: cleanup 'valid' life cycle - reset is only called when we detect a strip, the on disk data are invalid, - after a reset, we should not keep using the data base connection, - after a write, the on disk data are valid. diff --git a/hgext3rd/evolve/obsdiscovery.py b/hgext3rd/evolve/obsdiscovery.py --- a/hgext3rd/evolve/obsdiscovery.py +++ b/hgext3rd/evolve/obsdiscovery.py @@ -437,7 +437,9 @@ super(_obshashcache, self).clear(reset=reset) self._data.clear() self._new.clear() - if not reset and '_con' in vars(self): + if reset: + self._valid = False + if '_con' in vars(self): del self._con def get(self, rangeid): @@ -592,6 +594,7 @@ con.commit() self._new.clear() self._ondiskcachekey = self._cachekey + self._valid = True @eh.wrapfunction(obsolete.obsstore, '_addmarkers') def _addmarkers(orig, obsstore, *args, **kwargs):