--- a/src/mercurialserver/config.py Fri Nov 13 14:58:55 2009 +0000
+++ b/src/mercurialserver/config.py Fri Nov 13 16:39:34 2009 +0000
@@ -1,7 +1,9 @@
# Copyright 2008-2009 LShift Ltd
import sys
+import os
import os.path
+import pwd
import ConfigParser
globalconfig = None
@@ -36,9 +38,11 @@
def getEnv(): return _getConf().items("env")
# Work out where we are, don't use config.
-def setExePath():
+def initExe():
global _exePath
_exePath = os.path.dirname(os.path.abspath(sys.argv[0]))
+ # Fix $HOME in case of "sudo -u hg refresh-auth"
+ os.environ['HOME'] = pwd.getpwuid(os.geteuid()).pw_dir
def getExePath():
return _exePath