util: strip trailing newline from debugstacktrace message
authorMads Kiilerich <madski@unity3d.com>
Fri, 16 Jan 2015 04:26:40 +0100
changeset 31314 7c877cbf30d6
parent 31313 80752c655320
child 31315 78ac7061f840
util: strip trailing newline from debugstacktrace message This makes the function more convenient to use as drop-in replacement for ui.write & co.
mercurial/util.py
tests/test-debugcommands.t
--- a/mercurial/util.py	Fri Jan 16 04:26:40 2015 +0100
+++ b/mercurial/util.py	Fri Jan 16 04:26:40 2015 +0100
@@ -2871,7 +2871,7 @@
     '''
     if otherf:
         otherf.flush()
-    f.write('%s at:\n' % msg)
+    f.write('%s at:\n' % msg.rstrip())
     for line in getstackframes(skip + 1):
         f.write(line)
     f.flush()
--- a/tests/test-debugcommands.t	Fri Jan 16 04:26:40 2015 +0100
+++ b/tests/test-debugcommands.t	Fri Jan 16 04:26:40 2015 +0100
@@ -129,8 +129,7 @@
   stacktrace at:
    debugstacktrace.py:10 in * (glob)
    debugstacktrace.py:3  in f
-  hello from g
-   at:
+  hello from g at:
    debugstacktrace.py:10 in * (glob)
    debugstacktrace.py:4  in f
   hi ...