Patchwork [2,of,5] cmdutil: drop support for legacy command registration

login
register
mail settings
Submitter Augie Fackler
Date May 11, 2018, 4:55 a.m.
Message ID <f50c58e6f11a59266b7f.1526014525@imladris.local>
Download mbox | patch
Permalink /patch/31487/
State Accepted
Headers show

Comments

Augie Fackler - May 11, 2018, 4:55 a.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1526014432 14400
#      Fri May 11 00:53:52 2018 -0400
# Node ID f50c58e6f11a59266b7fc0d370d474dca84c3945
# Parent  5b4fd9f011a12c5e3b3c80100e826240c1747c56
cmdutil: drop support for legacy command registration

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -3151,12 +3151,6 @@  def _performrevert(repo, parents, ctx, a
         if f in copied:
             repo.dirstate.copy(copied[f], f)
 
-class command(registrar.command):
-    """deprecated: used registrar.command instead"""
-    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
 # "findcommonoutgoing()"
diff --git a/mercurial/extensions.py b/mercurial/extensions.py
--- a/mercurial/extensions.py
+++ b/mercurial/extensions.py
@@ -145,9 +145,6 @@  def _validatecmdtable(ui, cmdtable):
     """Check if extension commands have required attributes"""
     for c, e in cmdtable.iteritems():
         f = e[0]
-        if getattr(f, '_deprecatedregistrar', False):
-            ui.deprecwarn("cmdutil.command is deprecated, use "
-                          "registrar.command to register '%s'" % c, '4.6')
         missing = [a for a in _cmdfuncattrs if not util.safehasattr(f, a)]
         if not missing:
             continue