develwarn: handle the end of line inside the function itself
authorPierre-Yves David <pierre-yves.david@fb.com>
Sun, 12 Apr 2015 14:26:11 -0400
changeset 24748 d6caadff4779
parent 24747 bef8b17443a3
child 24749 3ad1571d4852
develwarn: handle the end of line inside the function itself The traceback version should not have a end of line at all. The non-traceback version will requires the same things soon.
mercurial/localrepo.py
mercurial/scmutil.py
tests/test-devel-warnings.t
--- a/mercurial/localrepo.py	Sun Apr 12 14:24:28 2015 -0400
+++ b/mercurial/localrepo.py	Sun Apr 12 14:26:11 2015 -0400
@@ -926,7 +926,7 @@
                 or self.ui.configbool('devel', 'check-locks')):
             l = self._lockref and self._lockref()
             if l is None or not l.held:
-                scmutil.develwarn(self.ui, 'transaction with no lock\n')
+                scmutil.develwarn(self.ui, 'transaction with no lock')
         tr = self.currenttransaction()
         if tr is not None:
             return tr.nest()
@@ -1216,7 +1216,7 @@
                 or self.ui.configbool('devel', 'check-locks')):
             l = self._lockref and self._lockref()
             if l is not None and l.held:
-                scmutil.develwarn(self.ui, '"wlock" acquired after "lock"\n')
+                scmutil.develwarn(self.ui, '"wlock" acquired after "lock"')
 
         def unlock():
             if self.dirstate.pendingparentchange():
--- a/mercurial/scmutil.py	Sun Apr 12 14:24:28 2015 -0400
+++ b/mercurial/scmutil.py	Sun Apr 12 14:26:11 2015 -0400
@@ -177,7 +177,7 @@
     if tui.tracebackflag:
         util.debugstacktrace(msg, 2)
     else:
-        tui.write_err(msg)
+        tui.write_err(msg + '\n')
 
 def filteredhash(repo, maxrev):
     """build hash of filtered revisions in the current repoview.
--- a/tests/test-devel-warnings.t	Sun Apr 12 14:24:28 2015 -0400
+++ b/tests/test-devel-warnings.t	Sun Apr 12 14:26:11 2015 -0400
@@ -54,8 +54,7 @@
   transaction with no lock
   "wlock" acquired after "lock"
   $ hg buggylocking --traceback
-  transaction with no lock
-   at:
+  transaction with no lock at:
    */hg:* in * (glob)
    */mercurial/dispatch.py:* in run (glob)
    */mercurial/dispatch.py:* in dispatch (glob)
@@ -67,8 +66,7 @@
    */mercurial/dispatch.py:* in <lambda> (glob)
    */mercurial/util.py:* in check (glob)
    $TESTTMP/buggylocking.py:* in buggylocking (glob)
-  "wlock" acquired after "lock"
-   at:
+  "wlock" acquired after "lock" at:
    */hg:* in * (glob)
    */mercurial/dispatch.py:* in run (glob)
    */mercurial/dispatch.py:* in dispatch (glob)