# HG changeset patch # User Pierre-Yves David # Date 2017-06-30 01:42:12 # Node ID 21b568820a3cb38dc3a6cfa93c2923cca0284959 # Parent 91c1e7c974c286611016e5f2324709620e1f26a9 configitems: register the 'factotum.executable' config diff --git a/hgext/factotum.py b/hgext/factotum.py --- a/hgext/factotum.py +++ b/hgext/factotum.py @@ -52,6 +52,7 @@ from mercurial.i18n import _ from mercurial import ( error, httpconnection, + registrar, url, util, ) @@ -63,6 +64,13 @@ ERRMAX = 128 _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 find_user_password(self, realm, auth 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