changeset 34153:8860100908eb

configitems: register the 'convert.cvsps.cache' config The convert extensions has code a bit all around, but it seems simpler to use a central declaration of options at the root first.
author Boris Feld <boris.feld@octobus.net>
date Fri, 30 Jun 2017 03:32:53 +0200
parents 21c2df59a1da
children 50f1c2d98db0
files hgext/convert/__init__.py hgext/convert/cvs.py
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/__init__.py	Wed Sep 13 20:39:01 2017 -0700
+++ b/hgext/convert/__init__.py	Fri Jun 30 03:32:53 2017 +0200
@@ -28,6 +28,13 @@
 # leave the attribute unspecified.
 testedwith = 'ships-with-hg-core'
 
+configtable = {}
+configitem = registrar.configitem(configtable)
+
+configitem('convert', 'cvsps.cache',
+    default=True,
+)
+
 # Commands definition was moved elsewhere to ease demandload job.
 
 @command('convert',
--- a/hgext/convert/cvs.py	Wed Sep 13 20:39:01 2017 -0700
+++ b/hgext/convert/cvs.py	Fri Jun 30 03:32:53 2017 +0200
@@ -76,7 +76,7 @@
             id = None
 
             cache = 'update'
-            if not self.ui.configbool('convert', 'cvsps.cache', True):
+            if not self.ui.configbool('convert', 'cvsps.cache'):
                 cache = None
             db = cvsps.createlog(self.ui, cache=cache)
             db = cvsps.createchangeset(self.ui, db,