obshashrange: always check in base cachekey against the recorded one stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 27 Aug 2018 10:20:15 +0200
branchstable
changeset 4021 bebba5a5c82d
parent 4020 47b00d3b8ea2
child 4022 082b59126099
obshashrange: always check in base cachekey against the recorded one Ignoring the check in the none case is just disaster waiting to happens.
hgext3rd/evolve/obsdiscovery.py
--- a/hgext3rd/evolve/obsdiscovery.py	Mon Aug 27 10:16:12 2018 +0200
+++ b/hgext3rd/evolve/obsdiscovery.py	Mon Aug 27 10:20:15 2018 +0200
@@ -598,17 +598,15 @@
                 con.execute(_newmeta, self._fullcachekey)
         else:
             con = self._con
-            if self._ondiskcachekey is not None:
-                meta = con.execute(_querymeta).fetchone()
-                if meta[1:] != self._ondiskcachekey:
-                    # drifting is currently an issue because this means another
-                    # process might have already added the cache line we are about
-                    # to add. This will confuse sqlite
-                    msg = _('obshashrange cache: skipping write, '
-                            'database drifted under my feet\n')
-                    data = (meta[2], meta[1], self._ondiskcachekey[0], self._ondiskcachekey[1])
-                    repo.ui.warn(msg)
-                    return
+            meta = con.execute(_querymeta).fetchone()
+            if meta[1:] != self._ondiskcachekey:
+                # drifting is currently an issue because this means another
+                # process might have already added the cache line we are about
+                # to add. This will confuse sqlite
+                msg = _('obshashrange cache: skipping write, '
+                        'database drifted under my feet\n')
+                repo.ui.warn(msg)
+                return
         data = ((rangeid[0], rangeid[1], self.get(rangeid)) for rangeid in self._new)
         con.executemany(_updateobshash, data)
         cachekey = self._fullcachekey