# HG changeset patch # User Paul Crowley # Date 1236342436 0 # Node ID abb9ed8972e0c7161bf94b4f4ab6814382607a62 # Parent e31646deafc8b06e3eeda8b2a2d3f5fcb6ed910c Move more into hg-ssh diff -r e31646deafc8 -r abb9ed8972e0 install --- a/install Fri Mar 06 12:13:58 2009 +0000 +++ b/install Fri Mar 06 12:27:16 2009 +0000 @@ -9,6 +9,7 @@ install -o root -g root -d /usr/local/lib/mercurial-server/mercurialserver install -o root -g root -t /usr/local/lib/mercurial-server/mercurialserver -m 644 \ src/mercurialserver/__init__.py \ + src/mercurialserver/paths.py \ src/mercurialserver/changes.py \ src/mercurialserver/access.py \ src/mercurialserver/servelog.py \ diff -r e31646deafc8 -r abb9ed8972e0 src/hg-ssh --- a/src/hg-ssh Fri Mar 06 12:13:58 2009 +0000 +++ b/src/hg-ssh Fri Mar 06 12:27:16 2009 +0000 @@ -34,7 +34,7 @@ from mercurial import dispatch import sys, os -from mercurialserver import ruleset +from mercurialserver import ruleset, paths def fail(message): #logfile.write("Fail: %s\n" % message) @@ -73,6 +73,10 @@ remote_user = sys.argv[1] os.environ['REMOTE_USER'] = remote_user +os.environ['HG_ACCESS_RULES_PATH'] = ( + paths.getEtcPath() + "/access.conf" + ":" + + os.getcwd() + "/hgadmin/access.conf") + rules = ruleset.rules_from_env() rules.set(user = getpath(remote_user)) rules.set(branch = None, file = None) diff -r e31646deafc8 -r abb9ed8972e0 src/init/conf/hg-ssh-wrapper --- a/src/init/conf/hg-ssh-wrapper Fri Mar 06 12:13:58 2009 +0000 +++ b/src/init/conf/hg-ssh-wrapper Fri Mar 06 12:27:16 2009 +0000 @@ -21,6 +21,4 @@ export HGRCPATH cd repos -HG_ACCESS_RULES_PATH=/etc/mercurial-server/access.conf:$(pwd)/hgadmin/access.conf -export HG_ACCESS_RULES_PATH exec /usr/local/lib/mercurial-server/hg-ssh $1 diff -r e31646deafc8 -r abb9ed8972e0 src/mercurialserver/paths.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/mercurialserver/paths.py Fri Mar 06 12:27:16 2009 +0000 @@ -0,0 +1,6 @@ +# Copyright 2008-2009 LShift Ltd + +# Crude but it will do + +def getEtcPath(): + return "/etc/mercurial-server"