# HG changeset patch # User Mads Kiilerich # Date 1421378800 -3600 # Node ID 7c877cbf30d6feef6ce0f9e825bd908f254e6262 # Parent 80752c655320e9300a66c77cc9b2bc34bf70e533 util: strip trailing newline from debugstacktrace message This makes the function more convenient to use as drop-in replacement for ui.write & co. diff -r 80752c655320 -r 7c877cbf30d6 mercurial/util.py --- 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() diff -r 80752c655320 -r 7c877cbf30d6 tests/test-debugcommands.t --- 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 ...