diff mercurial/scmutil.py @ 24747:bef8b17443a3

develwarn: refactor the developer warning logic The logic is currently duplicated and we plan to make it a bit smarter. So we move it into a function first to make the update more robust and simple.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Sun, 12 Apr 2015 14:24:28 -0400
parents ee751d47cf2c
children d6caadff4779
line wrap: on
line diff
--- a/mercurial/scmutil.py	Wed Apr 15 01:20:48 2015 -0400
+++ b/mercurial/scmutil.py	Sun Apr 12 14:24:28 2015 -0400
@@ -172,6 +172,13 @@
         self._loweredfiles.add(fl)
         self._newfiles.add(f)
 
+def develwarn(tui, msg):
+    """issue a developer warning message"""
+    if tui.tracebackflag:
+        util.debugstacktrace(msg, 2)
+    else:
+        tui.write_err(msg)
+
 def filteredhash(repo, maxrev):
     """build hash of filtered revisions in the current repoview.