diff hgext/factotum.py @ 16463:cef755f86d5c stable

factotum: rename mount and path configuration entries The factotum extension used mount and path entries which were too generic. These have been replaced by mountpoint and executable (respectively) to match existing conventions.
author Steven Stallion <sstallion@gmail.com>
date Tue, 17 Apr 2012 21:12:37 -0700
parents f5dd179bfa4a
children cbb916e2d7c5
line wrap: on
line diff
--- a/hgext/factotum.py	Wed Apr 18 11:46:23 2012 -0500
+++ b/hgext/factotum.py	Tue Apr 17 21:12:37 2012 -0700
@@ -35,13 +35,13 @@
 default, these entries are::
 
   [factotum]
-  mount = /mnt/factotum
-  path = /bin/auth/factotum
+  executable = /bin/auth/factotum
+  mountpoint = /mnt/factotum
   service = hg
 
-The mount entry defines the mount point for the factotum file service. The
-path entry defines the full path to the factotum binary. Lastly, the service
-entry controls the service name used when reading keys.
+The executable entry defines the full path to the factotum binary. The
+mountpoint entry defines the path to the factotum file service. Lastly, the
+service entry controls the service name used when reading keys.
 
 '''
 
@@ -58,12 +58,12 @@
     if 'user=' not in params:
         params = '%s user?' % params
     params = '%s !password?' % params
-    os.system("%s -g '%s'" % (_path, params))
+    os.system("%s -g '%s'" % (_executable, params))
 
 def auth_getuserpasswd(self, getkey, params):
     params = 'proto=pass %s' % params
     while True:
-        fd = os.open('%s/rpc' % _mount, os.O_RDWR)
+        fd = os.open('%s/rpc' % _mountpoint, os.O_RDWR)
         try:
             try:
                 os.write(fd, 'start %s' % params)
@@ -112,9 +112,9 @@
     return (user, passwd)
 
 def uisetup(ui):
-    global _mount
-    _mount = ui.config('factotum', 'mount', '/mnt/factotum')
-    global _path
-    _path = ui.config('factotum', 'path', '/bin/auth/factotum')
+    global _executable
+    _executable = ui.config('factotum', 'executable', '/bin/auth/factotum')
+    global _mountpoint
+    _mountpoint = ui.config('factotum', 'mountpoint', '/mnt/factotum')
     global _service
     _service = ui.config('factotum', 'service', 'hg')