rename python hook

This commit is contained in:
Sebastian Sdorra
2011-07-21 20:37:12 +02:00
parent 5f1c5ded4e
commit b1606535a6
2 changed files with 9 additions and 2 deletions

View File

@@ -147,7 +147,7 @@ public class HgHookScriptFilter extends HttpFilter
IOUtil.mkdirs(cgiDirectory);
File hgHookScript = new File(cgiDirectory, "hg-hook.py");
File hgHookScript = new File(cgiDirectory, "scmhooks.py");
if (logger.isDebugEnabled())
{

View File

@@ -1,5 +1,12 @@
#!/usr/bin/env ${python}
#
# registration .hg/hgrc:
#
# [hooks]
# incoming = python:scmhooks.callback
#
import os, sys, urllib
pythonPath = "${path}"
@@ -11,7 +18,7 @@ if len(pythonPath) > 0:
baseUrl = "${url}"
def scmhook(ui, repo, hooktype, node=None, source=None, **kwargs):
def callback(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:)