Move more into hg-ssh
authorPaul Crowley <paul@lshift.net>
Fri, 06 Mar 2009 12:27:16 +0000
changeset 70 abb9ed8972e0
parent 69 e31646deafc8
child 71 1120f78f81da
Move more into hg-ssh
install
src/hg-ssh
src/init/conf/hg-ssh-wrapper
src/mercurialserver/paths.py
--- 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 \
--- 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)
--- 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
--- /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"