# HG changeset patch # User Mads Kiilerich <mad...@unity3d.com> # Date 1421378800 -3600 # Fri Jan 16 04:26:40 2015 +0100 # Node ID dbf53b1ab67f06fcf13736c1bd91f8472a851be5 # Parent 56ee8fd0a885a7ba4f4da5dbe85d8844bb45df5b util: strip trailing newline from debugstacktrace message
This makes the function more convenient to use as drop-in replacement for ui.write & co. diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -2871,7 +2871,7 @@ def debugstacktrace(msg='stacktrace', sk ''' 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 --git a/tests/test-debugcommands.t b/tests/test-debugcommands.t --- a/tests/test-debugcommands.t +++ b/tests/test-debugcommands.t @@ -129,8 +129,7 @@ Test internal debugstacktrace command 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 ... _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel