changeset 33241:21b568820a3c

configitems: register the 'factotum.executable' config
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 30 Jun 2017 03:42:12 +0200
parents 91c1e7c974c2
children 037c5c937602
files hgext/factotum.py
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/factotum.py	Fri Jun 30 03:42:26 2017 +0200
+++ b/hgext/factotum.py	Fri Jun 30 03:42:12 2017 +0200
@@ -52,6 +52,7 @@
 from mercurial import (
     error,
     httpconnection,
+    registrar,
     url,
     util,
 )
@@ -63,6 +64,13 @@
 
 _executable = _mountpoint = _service = None
 
+configtable = {}
+configitem = registrar.configitem(configtable)
+
+configitem('factotum', 'executable',
+    default='/bin/auth/factotum',
+)
+
 def auth_getkey(self, params):
     if not self.ui.interactive():
         raise error.Abort(_('factotum not interactive'))
@@ -127,7 +135,7 @@
 
 def uisetup(ui):
     global _executable
-    _executable = ui.config('factotum', 'executable', '/bin/auth/factotum')
+    _executable = ui.config('factotum', 'executable')
     global _mountpoint
     _mountpoint = ui.config('factotum', 'mountpoint', '/mnt/factotum')
     global _service