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.
This commit is contained in:
Matt Harbison
2018-06-22 16:42:05 -04:00
parent 2d103b7f95
commit 405dd67275

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