mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 07:55:47 +01:00
Merged in matt_harbison/scm-manager/1.x (pull request #43)
Load global Mercurial configuration in 4.1+ and minor hook tweaks
This commit is contained in:
@@ -36,7 +36,11 @@ from mercurial.hgweb import hgweb, wsgicgi
|
|||||||
|
|
||||||
demandimport.enable()
|
demandimport.enable()
|
||||||
|
|
||||||
u = uimod.ui()
|
try:
|
||||||
|
u = uimod.ui.load()
|
||||||
|
except AttributeError:
|
||||||
|
# For installations earlier than Mercurial 4.1
|
||||||
|
u = uimod.ui()
|
||||||
|
|
||||||
# pass SCM_HTTP_POST_ARGS to enable experimental httppostargs protocol of mercurial
|
# pass SCM_HTTP_POST_ARGS to enable experimental httppostargs protocol of mercurial
|
||||||
# SCM_HTTP_POST_ARGS is set by HgCGIServlet
|
# SCM_HTTP_POST_ARGS is set by HgCGIServlet
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ def printMessages(ui, msgs):
|
|||||||
for line in msgs:
|
for line in msgs:
|
||||||
if line.startswith("_e") or line.startswith("_n"):
|
if line.startswith("_e") or line.startswith("_n"):
|
||||||
line = line[2:];
|
line = line[2:];
|
||||||
ui.warn(line);
|
ui.warn('%s\n' % line.rstrip())
|
||||||
|
|
||||||
def callHookUrl(ui, repo, hooktype, node):
|
def callHookUrl(ui, repo, hooktype, node):
|
||||||
abort = True
|
abort = True
|
||||||
@@ -78,8 +78,10 @@ def callHookUrl(ui, repo, hooktype, node):
|
|||||||
printMessages(ui, msg.splitlines(True))
|
printMessages(ui, msg.splitlines(True))
|
||||||
else:
|
else:
|
||||||
ui.warn( "ERROR: scm-hook failed with an unknown error\n" )
|
ui.warn( "ERROR: scm-hook failed with an unknown error\n" )
|
||||||
|
ui.traceback()
|
||||||
except ValueError:
|
except ValueError:
|
||||||
ui.warn( "scm-hook failed with an exception\n" )
|
ui.warn( "scm-hook failed with an exception\n" )
|
||||||
|
ui.traceback()
|
||||||
return abort
|
return abort
|
||||||
|
|
||||||
def callback(ui, repo, hooktype, node=None, source=None, pending=None, **kwargs):
|
def callback(ui, repo, hooktype, node=None, source=None, pending=None, **kwargs):
|
||||||
|
|||||||
Reference in New Issue
Block a user