From 405dd672754ddd80ca9a7972eb9460aaf1fb67cf Mon Sep 17 00:00:00 2001 From: Matt Harbison Date: Fri, 22 Jun 2018 16:42:05 -0400 Subject: [PATCH] ensure each message line printed in the Mercurial hook gets a trailing newline I noticed that the exception printed in the previous commit started on the same line as the print for the `str(e)` case right before it. Since this also prints the content of urllib2.URLError.read(), it seems better to remove any existing newline and re-add it, than to just assume the `str(e)` case was the only problem. --- .../src/main/resources/sonia/scm/python/scmhooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scm-plugins/scm-hg-plugin/src/main/resources/sonia/scm/python/scmhooks.py b/scm-plugins/scm-hg-plugin/src/main/resources/sonia/scm/python/scmhooks.py index 73b5bfe083..d4999cf2fd 100644 --- a/scm-plugins/scm-hg-plugin/src/main/resources/sonia/scm/python/scmhooks.py +++ b/scm-plugins/scm-hg-plugin/src/main/resources/sonia/scm/python/scmhooks.py @@ -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