write mercurial hook module on first request

This commit is contained in:
Sebastian Sdorra
2011-07-21 20:21:08 +02:00
parent bd1cdc0a88
commit 5f1c5ded4e
5 changed files with 313 additions and 2 deletions

View File

@@ -0,0 +1,17 @@
#!/usr/bin/env ${python}
import os, sys, urllib
pythonPath = "${path}"
if len(pythonPath) > 0:
pathParts = pythonPath.split(os.pathsep)
for i in range(len(pathParts)):
sys.path.insert(i, pathParts[i])
baseUrl = "${url}"
def scmhook(ui, repo, hooktype, node=None, source=None, **kwargs):
url = baseUrl + os.path.basename(repo.root) + "/" + hooktype
conn = urllib.urlopen(url);
# todo validate (if conn.code == 200:)