[PATCH] extensions: notice extsetup() is deprecated on debug message
TK Soh
teekaysoh at gmail.com
Wed Oct 14 06:01:23 UTC 2009
On Tue, Oct 13, 2009 at 11:40 AM, Yuya Nishihara <yuya at tcha.org> wrote:
>> Is this really necessary? It can be very annoying especially for 3rd
>> party extensions which not that quick to pick up any changes in
>> mercurial API.
>
> How about this?
> This complains about extsetup() only if --debug is specified.
> --debug is mostly for developers.
Mercurial help text says --debug is to enable debugging output, but I
am not sure it's really meant for developers. I guess Matt will
decide.
> Thanks TK and Matt.
>
>> 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:
>
> Yuya.
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>
More information about the Mercurial-devel
mailing list