evolve: when using evolve, cache files belong into the master repo
authorJoerg Sonnenberger <joerg@bec.de>
Sun, 07 Apr 2019 19:53:53 +0200
changeset 4487 d972041022cb
parent 4478 94743877e50b
child 4488 6c0992ce05f7
evolve: when using evolve, cache files belong into the master repo
CHANGELOG
hgext3rd/evolve/obsdiscovery.py
hgext3rd/evolve/stablerangecache.py
tests/test-share.t
--- a/CHANGELOG	Sat Apr 06 15:50:15 2019 +0200
+++ b/CHANGELOG	Sun Apr 07 19:53:53 2019 +0200
@@ -9,6 +9,7 @@
   * pick: add the standard `--tool` option,
   * stack: improved and speed --children flag up,
   * stack: mention all divergences too.
+  * evolve: share evolve related cache between `shares`
 
 8.4.1 - in progress
 -------------------
--- a/hgext3rd/evolve/obsdiscovery.py	Sat Apr 06 15:50:15 2019 +0200
+++ b/hgext3rd/evolve/obsdiscovery.py	Sun Apr 07 19:53:53 2019 +0200
@@ -416,12 +416,12 @@
     _schemaversion = 3
 
     _cachename = 'evo-ext-obshashrange' # used for error message
-    _filename = 'cache/evoext_obshashrange_v2.sqlite'
+    _filename = 'evoext_obshashrange_v2.sqlite'
 
     def __init__(self, repo):
         super(_obshashcache, self).__init__()
         self._vfs = repo.vfs
-        self._path = repo.vfs.join(self._filename)
+        self._path = repo.cachevfs.join(self._filename)
         self._new = set()
         self._valid = True
         self._repo = weakref.ref(repo.unfiltered())
--- a/hgext3rd/evolve/stablerangecache.py	Sat Apr 06 15:50:15 2019 +0200
+++ b/hgext3rd/evolve/stablerangecache.py	Sun Apr 07 19:53:53 2019 +0200
@@ -176,7 +176,7 @@
     def __init__(self, repo, **kwargs):
         super(stablerangesqlbase, self).__init__(**kwargs)
         self._vfs = repo.vfs
-        self._path = repo.vfs.join(self._cachefile)
+        self._path = repo.cachevfs.join(self._cachefile)
         self._cl = repo.unfiltered().changelog # (okay to keep an old one)
         self._ondisktiprev = None
         self._ondisktipnode = None
@@ -390,13 +390,13 @@
 class mergepointsql(stablerangesql, stablerange.stablerange_mergepoint):
 
     _schemaversion = 3
-    _cachefile = 'cache/evoext_stablerange_v2.sqlite'
+    _cachefile = 'evoext_stablerange_v2.sqlite'
     _cachename = 'evo-ext-stablerange-mergepoint'
 
 class sqlstablerange(stablerangesqlbase, stablerange.stablerange):
 
     _schemaversion = 1
-    _cachefile = 'cache/evoext_stablerange_v1.sqlite'
+    _cachefile = 'evoext_stablerange_v1.sqlite'
 
     def warmup(self, repo, upto=None):
         self._con # make sure the data base is loaded
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-share.t	Sun Apr 07 19:53:53 2019 +0200
@@ -0,0 +1,18 @@
+Test that share-clones use the cache in the original repository.
+
+  $ hg init share-base
+  $ cd share-base/
+  $ cat >> .hg/hgrc <<EOF
+  > [extensions]
+  > evolve=
+  > share=
+  > EOF
+  $ hg debugbuilddag .+3:branchpoint+4*branchpoint+2
+  $ cd ..
+  $ hg --config extensions.share= share -U share-base share-client
+  $ cd share-client
+  $ hg debugupdatecache
+  $ test -d .hg/cache
+  [1]
+  $ test -d ../share-base/.hg/cache
+