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.
--- a/hgext3rd/evolve/obsdiscovery.py Wed May 17 12:27:13 2017 +0200
+++ b/hgext3rd/evolve/obsdiscovery.py Wed May 17 14:40:18 2017 +0200
@@ -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):