Patchwork [1,of,3] extensions: drop support for extsetup() without `ui` argument (API)

login
register
mail settings
Submitter Matt Harbison
Date May 19, 2019, 12:53 a.m.
Message ID <38b7b45627a21fa8f9de.1558227210@Envy>
Download mbox | patch
Permalink /patch/40138/
State Accepted
Headers show

Comments

Matt Harbison - May 19, 2019, 12:53 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1558222428 14400
#      Sat May 18 19:33:48 2019 -0400
# Node ID 38b7b45627a21fa8f9de20d4f173510cf614859f
# Parent  bcb1a2b6cd00e6d47bd0c22e5bbeaaa7f3ea3453
extensions: drop support for extsetup() without `ui` argument (API)
Yuya Nishihara - May 19, 2019, 11:35 p.m.
On Sat, 18 May 2019 20:53:30 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1558222428 14400
> #      Sat May 18 19:33:48 2019 -0400
> # Node ID 38b7b45627a21fa8f9de20d4f173510cf614859f
> # Parent  bcb1a2b6cd00e6d47bd0c22e5bbeaaa7f3ea3453
> extensions: drop support for extsetup() without `ui` argument (API)

Queued, thanks.

Patch

diff --git a/mercurial/extensions.py b/mercurial/extensions.py
--- a/mercurial/extensions.py
+++ b/mercurial/extensions.py
@@ -221,14 +221,7 @@  def _runextsetup(name, ui):
     extsetup = getattr(_extensions[name], 'extsetup', None)
     if extsetup:
         try:
-            try:
-                extsetup(ui)
-            except TypeError:
-                if pycompat.getargspec(extsetup).args:
-                    raise
-                ui.deprecwarn("extsetup for '%s' must take a ui argument"
-                              % name, "4.9")
-                extsetup() # old extsetup with no ui argument
+            extsetup(ui)
         except Exception as inst:
             ui.traceback(force=True)
             msg = stringutil.forcebytestr(inst)