obshashrange: clear in-memory cache alongside the sqlite one stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 17 Aug 2018 12:06:43 +0200
branchstable
changeset 3962 ebf6556b9650
parent 3960 ce50e788d88c
child 3963 d2e9a03fb3f7
obshashrange: clear in-memory cache alongside the sqlite one Clearing on disk data in nice, but we also need to remove in memory one or we'll get incorrect results.
hgext3rd/evolve/obsdiscovery.py
--- a/hgext3rd/evolve/obsdiscovery.py	Fri Aug 17 01:04:49 2018 +0200
+++ b/hgext3rd/evolve/obsdiscovery.py	Fri Aug 17 12:06:43 2018 +0200
@@ -475,9 +475,12 @@
                     # so we need to reset more broadly than we would like.
                     if repo.stablerange._con is None:
                         con.execute(_reset)
+                        self._data.clear()
                     else:
                         ranges = repo.stablerange.contains(repo, affected)
                         con.executemany(_delete, ranges)
+                        for r in ranges:
+                            self._data.pop(r, None)
 
                 # rewarm key revisions
                 #