changeset 2362:22c35d07ddb3

obshashrange: properly drop the current connection on clear
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 12 May 2017 20:49:27 +0200
parents 5c5f982b98f7
children 2ceb122fcc33
files hgext3rd/evolve/obsdiscovery.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/obsdiscovery.py	Fri May 12 20:40:00 2017 +0200
+++ b/hgext3rd/evolve/obsdiscovery.py	Fri May 12 20:49:27 2017 +0200
@@ -430,12 +430,14 @@
 
     def clear(self, reset=False):
         self._valid = False
-        super(_obshashcache, self).clear(reset=reset)
         if reset:
             con = self._con
             if con is not None:
                 con.execute(_reset)
+        super(_obshashcache, self).clear(reset=reset)
         self._new.clear()
+        if not reset and '_con' in vars(self):
+            del self._con
 
     def get(self, rangeid):
         # revision should be covered by out tiprev