mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 15:05:44 +01:00
added a challenge for mercurial hooks
This commit is contained in:
@@ -17,11 +17,13 @@ if len(pythonPath) > 0:
|
||||
sys.path.insert(i, pathParts[i])
|
||||
|
||||
baseUrl = "${url}"
|
||||
challenge = "${challenge}"
|
||||
|
||||
def callback(ui, repo, hooktype, node=None, source=None, **kwargs):
|
||||
if node != None:
|
||||
url = baseUrl + os.path.basename(repo.root) + "/" + hooktype + "?node=" + node
|
||||
conn = urllib.urlopen(url);
|
||||
url = baseUrl + os.path.basename(repo.root) + "/" + hooktype
|
||||
data = urllib.urlencode({'node': node, 'challenge': challenge})
|
||||
conn = urllib.urlopen(url, data);
|
||||
if conn.code == 200:
|
||||
print( "scm-hook executed successfully" )
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user