changeset 2240:ecb993892c61

stablerange: warm cache before using it server side We make sure the cache is fully up to date before starting to use it. Updating all value is more efficient and this give us a single point where we update and write on disk. Hopefully the cache have been kept up to date as we go anyway.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Fri, 24 Mar 2017 15:57:54 +0100
parents f4f6ff874c40
children 88aace74b190
files hgext3rd/evolve/obsdiscovery.py hgext3rd/evolve/stablerange.py
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/obsdiscovery.py	Fri Mar 24 15:57:08 2017 +0100
+++ b/hgext3rd/evolve/obsdiscovery.py	Fri Mar 24 15:57:54 2017 +0100
@@ -361,6 +361,7 @@
 @bundle2.parthandler('_donotusemeever_evoext_obshashrange_1', ())
 def _processqueryrange(op, inpart):
     assert op.reply is not None
+    op.repo.stablerange.warmup(op.repo)
     replies = []
     data = inpart.read(24)
     while data:
--- a/hgext3rd/evolve/stablerange.py	Fri Mar 24 15:57:08 2017 +0100
+++ b/hgext3rd/evolve/stablerange.py	Fri Mar 24 15:57:54 2017 +0100
@@ -687,7 +687,8 @@
                               FOREIGN KEY (suprev, supidx) REFERENCES range(rev, idx),
                               FOREIGN KEY (subrev, subidx) REFERENCES range(rev, idx)
     );""",
-    "CREATE INDEX subrange_index ON subranges (suprev, supidx);",
+    "CREATE INDEX subranges_index ON subranges (suprev, supidx);",
+    "CREATE INDEX range_index ON range (rev, idx);",
     "CREATE INDEX depth_index ON depth (rev);"
 ]
 _newmeta = "INSERT INTO meta (schemaversion, tiprev, tipnode) VALUES (?,?,?);"