diff mercurial/cmdutil.py @ 32382:d47d7d3bd07b

extensions: show deprecation warning for the use of cmdutil.command Since this is a fundamental API for extensions, we set 1-year period until actually removing it.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 09 Jan 2016 23:24:52 +0900
parents 46ba2cdda476
children 7b3c27af90c2
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Sat May 13 15:41:50 2017 +0900
+++ b/mercurial/cmdutil.py	Sat Jan 09 23:24:52 2016 +0900
@@ -3335,7 +3335,10 @@
         if f in copied:
             repo.dirstate.copy(copied[f], f)
 
-command = registrar.command
+class command(registrar.command):
+    def _doregister(self, func, name, *args, **kwargs):
+        func._deprecatedregistrar = True  # flag for deprecwarn in extensions.py
+        return super(command, self)._doregister(func, name, *args, **kwargs)
 
 # a list of (ui, repo, otherpeer, opts, missing) functions called by
 # commands.outgoing.  "missing" is "missing" of the result of