Patchwork [06,of,12] cmdutil: drop deprecated precursor of registrar.command

login
register
mail settings
Submitter Matt Harbison
Date May 11, 2018, 5:11 a.m.
Message ID <2510563dd5b28a1dbe26.1526015479@Envy>
Download mbox | patch
Permalink /patch/31495/
State Accepted
Headers show

Comments

Matt Harbison - May 11, 2018, 5:11 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1526003628 14400
#      Thu May 10 21:53:48 2018 -0400
# Node ID 2510563dd5b28a1dbe26cae22cb8964cc73eaeaa
# Parent  f491c2884713b3080d94680dda6b00a11c51caf0
cmdutil: drop deprecated precursor of registrar.command
Yuya Nishihara - May 11, 2018, 12:39 p.m.
On Fri, 11 May 2018 01:11:19 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1526003628 14400
> #      Thu May 10 21:53:48 2018 -0400
> # Node ID 2510563dd5b28a1dbe26cae22cb8964cc73eaeaa
> # Parent  f491c2884713b3080d94680dda6b00a11c51caf0
> cmdutil: drop deprecated precursor of registrar.command

I've picked this over Augie's patch to fix test failure, thanks.

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
diff --git a/tests/test-extension.t b/tests/test-extension.t
--- a/tests/test-extension.t
+++ b/tests/test-extension.t
@@ -1697,10 +1697,6 @@  Show deprecation warning for the use of 
   >     pass
   > EOF
 
-  $ hg --config extensions.nonregistrar=`pwd`/nonregistrar.py version > /dev/null
-  devel-warn: cmdutil.command is deprecated, use registrar.command to register 'foo'
-  (compatibility will be dropped after Mercurial-4.6, update your code.) * (glob)
-
 Prohibit the use of unicode strings as the default value of options
 
   $ hg init $TESTTMP/opt-unicode-default