caches: extract some config reading in 'shouldwarmcache'
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 05 Jan 2018 04:26:51 +0100
changeset 3367 c26dc74b828d
parent 3366 83b372eceb81
child 3368 7310f3ef6dee
caches: extract some config reading in 'shouldwarmcache'
hgext3rd/evolve/utility.py
--- a/hgext3rd/evolve/utility.py	Fri Jan 05 03:35:07 2018 +0100
+++ b/hgext3rd/evolve/utility.py	Fri Jan 05 04:26:51 2018 +0100
@@ -39,9 +39,11 @@
 
 def shouldwarmcache(repo, tr):
     configbool = repo.ui.configbool
+    warm = configbool('experimental', 'obshashrange.warm-cache', True)
+
     if not configbool('experimental', 'obshashrange', False):
         return False
-    if not configbool('experimental', 'obshashrange.warm-cache', True):
+    if not warm:
         return False
     maxrevs = repo.ui.configint('experimental', 'obshashrange.max-revs', None)
     if maxrevs is not None and maxrevs < len(repo.unfiltered()):