# HG changeset patch # User Gregory Szorc # Date 1399265290 25200 # Node ID 2b8697e20978f1c1ed04d59d66609d097b723808 # Parent 48e859e30cbf70451dcde534a09546b725ee6879 color: declare command using decorator diff -r 48e859e30cbf -r 2b8697e20978 hgext/color.py --- a/hgext/color.py Sun May 04 21:46:49 2014 -0700 +++ b/hgext/color.py Sun May 04 21:48:10 2014 -0700 @@ -111,10 +111,12 @@ import os -from mercurial import commands, dispatch, extensions, ui as uimod, util +from mercurial import cmdutil, commands, dispatch, extensions, ui as uimod, util from mercurial import templater, error from mercurial.i18n import _ +cmdtable = {} +command = cmdutil.command(cmdtable) testedwith = 'internal' # start and stop parameters for effects @@ -440,6 +442,7 @@ _("when to colorize (boolean, always, auto, or never)"), _('TYPE'))) +@command('debugcolor', [], 'hg debugcolor') def debugcolor(ui, repo, **opts): global _styles _styles = {} @@ -579,8 +582,3 @@ finally: # Explicitly reset original attributes _kernel32.SetConsoleTextAttribute(stdout, origattr) - -cmdtable = { - 'debugcolor': - (debugcolor, [], ('hg debugcolor')) -}