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:
Sebastian Sdorra
2019-01-24 20:35:42 +00:00
2 changed files with 8 additions and 2 deletions

View File

@@ -36,6 +36,10 @@ from mercurial.hgweb import hgweb, wsgicgi
demandimport.enable()
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

View File

@@ -46,7 +46,7 @@ def printMessages(ui, msgs):
for line in msgs:
if line.startswith("_e") or line.startswith("_n"):
line = line[2:];
ui.warn(line);
ui.warn('%s\n' % line.rstrip())
def callHookUrl(ui, repo, hooktype, node):
abort = True
@@ -78,8 +78,10 @@ def callHookUrl(ui, repo, hooktype, node):
printMessages(ui, msg.splitlines(True))
else:
ui.warn( "ERROR: scm-hook failed with an unknown error\n" )
ui.traceback()
except ValueError:
ui.warn( "scm-hook failed with an exception\n" )
ui.traceback()
return abort
def callback(ui, repo, hooktype, node=None, source=None, pending=None, **kwargs):