--- a/src/hg-ssh Fri Nov 13 14:33:52 2009 +0000
+++ b/src/hg-ssh Fri Nov 13 14:42:46 2009 +0000
@@ -77,7 +77,7 @@
fail("hg-ssh wrongly called, is authorized_keys corrupt? (%s)"
% sys.argv)
-for k,v in config.getEnv().iteritems():
+for k,v in config.getEnv():
os.environ[k] = v
os.chdir(config.getReposPath())
--- a/src/mercurialserver/config.py Fri Nov 13 14:33:52 2009 +0000
+++ b/src/mercurialserver/config.py Fri Nov 13 14:42:46 2009 +0000
@@ -2,14 +2,14 @@
import sys
import os.path
-import mercurial.config
+import ConfigParser
globalconfig = None
def _getConf():
global globalconfig
if globalconfig is None:
- globalconfig = mercurial.config.config()
+ globalconfig = ConfigParser.RawConfigParser()
globalconfig.read(os.path.expanduser("~/.mercurial-server"))
return globalconfig
@@ -21,11 +21,11 @@
return False
def _getPath(name):
- return os.path.expanduser(_getConf()["paths"][name])
+ return os.path.expanduser(_getConf().get("paths", name))
def _getPaths(name):
return [os.path.expanduser(p)
- for p in _getConf()["paths"][name].split(":")]
+ for p in _getConf().get("paths", name).split(":")]
def getReposPath(): return _getPath("repos")
def getAuthorizedKeysPath(): return _getPath("authorized_keys")
@@ -33,7 +33,7 @@
def getKeysPaths(): return _getPaths("keys")
def getAccessPaths(): return _getPaths("access")
-def getEnv(): return _getConf()["env"]
+def getEnv(): return _getConf().items("env")
# Work out where we are, don't use config.
def setExePath():