[PATCH] extensions: notice extsetup() is deprecated on debug message

Yuya Nishihara yuya at tcha.org
Tue Oct 13 06:32:31 CDT 2009


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1255432313 -32400
# Node ID 5c847db921b7efc8a7a2e79c7a6524c558214f32
# Parent  4f3cc0e9eb729adfc1d0c70856f784a4397e18ef
extensions: notice extsetup() is deprecated on debug message

extsetup() is quite similar to uisetup() since 1c83938b6a8e change.
it's worth to be deprecated.

diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -363,6 +363,9 @@ def _dispatch(ui, args):
     for name, module in exts:
         extsetup = getattr(module, 'extsetup', None)
         if extsetup:
+            if '--debug' in args:  # ui.debug() isn't prepared here
+                ui.write('%s: extsetup() is deprecated. use uisetup() instead.\n'
+                         % name)
             try:
                 extsetup(ui)
             except TypeError:


More information about the Mercurial-devel mailing list