mercurial/ui.py
changeset 27275 f2cd240f2f7c
parent 27274 82910fdc216f
child 27408 2916ebaef312
--- a/mercurial/ui.py	Sat Dec 05 23:05:33 2015 -0800
+++ b/mercurial/ui.py	Sat Dec 05 23:05:49 2015 -0800
@@ -1060,6 +1060,16 @@
             self.write_err('%s at: %s:%s (%s)\n'
                            % ((msg,) + calframe[stacklevel][1:4]))
 
+    def deprecwarn(self, msg, version):
+        """issue a deprecation warning
+
+        - msg: message explaining what is deprecated and how to upgrade,
+        - version: last version where the API will be supported,
+        """
+        msg += ("\n(compatibility will be dropped after Mercurial-%s,"
+                " update your code.)") % version
+        self.develwarn(msg, stacklevel=2)
+
 class paths(dict):
     """Represents a collection of paths and their configs.