changeset 2459:5e6fc802bc8a stable

obshashrange: add an option to disable local cache warming The cache still a bit too volatile an costly to update. This offer a way for developer working copy to only compute it when used.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 21 May 2017 13:55:09 +0200
parents 62e4f9ff352b
children 64cc0b059073
files README hgext3rd/evolve/obsdiscovery.py tests/test-discovery-obshashrange.t
diffstat 3 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/README	Sat May 20 03:31:42 2017 +0200
+++ b/README	Sun May 21 13:55:09 2017 +0200
@@ -118,6 +118,8 @@
  - prune: fix a crash related to color handling,
  - next: fix a crash related to color handling,
  - cache: reduce the warming load in case of reset,
+ - cache: add a 'experimental.obshashcache.warm-cache' option to allow
+   disabling post transaction cache warming.
 
 6.2.0 -- 2017-05-18
 -------------------
--- a/hgext3rd/evolve/obsdiscovery.py	Sat May 20 03:31:42 2017 +0200
+++ b/hgext3rd/evolve/obsdiscovery.py	Sun May 21 13:55:09 2017 +0200
@@ -677,7 +677,12 @@
                 repo = reporef()
                 if repo is None:
                     return
-                if not repo.ui.configbool('experimental', 'obshashrange', False):
+                hasobshashrange = repo.ui.configbool('experimental',
+                                                     'obshashrange', False)
+                hascachewarm = repo.ui.configbool('experimental',
+                                                  'obshashrange.warm-cache',
+                                                  True)
+                if not (hasobshashrange and hascachewarm):
                     return
                 repo = repo.unfiltered()
                 # As pointed in 'obscache.update', we could have the changelog
--- a/tests/test-discovery-obshashrange.t	Sat May 20 03:31:42 2017 +0200
+++ b/tests/test-discovery-obshashrange.t	Sun May 21 13:55:09 2017 +0200
@@ -76,7 +76,7 @@
   $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa `getid 'desc(r1)'`
   $ hg debugobsolete bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb `getid 'desc(r2)'`
   $ hg debugobsolete cccccccccccccccccccccccccccccccccccccccc `getid 'desc(r4)'`
-  $ hg debugobsolete dddddddddddddddddddddddddddddddddddddddd `getid 'desc(r5)'`
+  $ hg debugobsolete dddddddddddddddddddddddddddddddddddddddd `getid 'desc(r5)'` --config experimental.obshashrange.warm-cache=0
   $ hg debugobsolete eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee `getid 'desc(r7)'`
   $ hg debugobsolete
   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 66f7d451a68b85ed82ff5fcc254daf50c74144bd 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
@@ -109,14 +109,12 @@
   * @0000000000000000000000000000000000000000 (*)> debugobsolete cccccccccccccccccccccccccccccccccccccccc bebd167eb94d257ace0e814aeb98e6972ed2970d exited 0 after *.?? seconds (glob)
   * @0000000000000000000000000000000000000000 (*)> debugobsolete dddddddddddddddddddddddddddddddddddddddd c8d03c1b5e94af74b772900c58259d2e08917735 (glob)
   * @0000000000000000000000000000000000000000 (*)> alias 'debugobsolete' expands to 'debugobsolete -d '0 0'' (glob)
-  * @0000000000000000000000000000000000000000 (*)> obshashcache reset - new markers affect cached ranges (glob)
-  * @0000000000000000000000000000000000000000 (*)> updated evo-ext-obshashrange in *.???? seconds (0r, 1o) (glob)
   * @0000000000000000000000000000000000000000 (*)> updated evo-ext-obscache in *.???? seconds (0r, 1o) (glob)
-  * @0000000000000000000000000000000000000000 (*)> debugobsolete dddddddddddddddddddddddddddddddddddddddd c8d03c1b5e94af74b772900c58259d2e08917735 exited 0 after *.?? seconds (glob)
+  * @0000000000000000000000000000000000000000 (*)> debugobsolete dddddddddddddddddddddddddddddddddddddddd c8d03c1b5e94af74b772900c58259d2e08917735 --config 'experimental.obshashrange.warm-cache=0' exited 0 after *.?? seconds (glob)
   * @0000000000000000000000000000000000000000 (*)> debugobsolete eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee 4de32a90b66cd083ebf3c00b41277aa7abca51dd (glob)
   * @0000000000000000000000000000000000000000 (*)> alias 'debugobsolete' expands to 'debugobsolete -d '0 0'' (glob)
   * @0000000000000000000000000000000000000000 (*)> obshashcache reset - new markers affect cached ranges (glob)
-  * @0000000000000000000000000000000000000000 (*)> updated evo-ext-obshashrange in *.???? seconds (0r, 1o) (glob)
+  * @0000000000000000000000000000000000000000 (*)> updated evo-ext-obshashrange in *.???? seconds (0r, 2o) (glob)
   * @0000000000000000000000000000000000000000 (*)> updated evo-ext-obscache in *.???? seconds (0r, 1o) (glob)
   * @0000000000000000000000000000000000000000 (*)> debugobsolete eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee 4de32a90b66cd083ebf3c00b41277aa7abca51dd exited 0 after *.?? seconds (glob)
   * @0000000000000000000000000000000000000000 (*)> debugobsolete (glob)