obshashrange: keep value fetched from sql in memory
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 16 May 2017 11:41:36 +0200
changeset 2374 6308a8c04cce
parent 2373 2a1aad0fd8bf
child 2375 8e42b33ea051
obshashrange: keep value fetched from sql in memory This will reduce the number of roundtrip to the data base we need.
hgext3rd/evolve/obsdiscovery.py
--- a/hgext3rd/evolve/obsdiscovery.py	Tue May 16 11:37:45 2017 +0200
+++ b/hgext3rd/evolve/obsdiscovery.py	Tue May 16 11:41:36 2017 +0200
@@ -456,6 +456,7 @@
             obshash = self._con.execute(_queryobshash, nrange).fetchone()
             if obshash is not None:
                 value = obshash[0]
+            self._data[rangeid] = value
         return value
 
     def __setitem__(self, rangeid, obshash):