# HG changeset patch # User Paul Crowley # Date 1258123366 0 # Node ID 584df0f2e5c7bf9ba434accfe7e5993ee2b98b55 # Parent 7374d014787561ec1a9daaf58f4853358b37c4d3 Use ConfigParser istead of mercurial.config diff -r 7374d0147875 -r 584df0f2e5c7 src/hg-ssh --- 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()) diff -r 7374d0147875 -r 584df0f2e5c7 src/mercurialserver/config.py --- 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():