# HG changeset patch # User Gregory Szorc # Date 2014-05-05 04:19:31 # Node ID 8b5c039f2b4f888e3006eec0172fd4ec2f18c3b5 # Parent 4c94229c51fbcd08a996307de5a1c21c08bbb57b debugshell: declare command using decorator diff --git a/contrib/debugshell.py b/contrib/debugshell.py --- a/contrib/debugshell.py +++ b/contrib/debugshell.py @@ -4,6 +4,10 @@ import sys import mercurial import code +from mercurial import cmdutil + +cmdtable = {} +command = cmdutil.command(cmdtable) def pdb(ui, repo, msg, **opts): objects = { @@ -24,6 +28,7 @@ def ipdb(ui, repo, msg, **opts): IPython.embed() +@command('debugshell|dbsh', []) def debugshell(ui, repo, **opts): bannermsg = "loaded repo : %s\n" \ "using source: %s" % (repo.root, @@ -47,7 +52,3 @@ def debugshell(ui, repo, **opts): debugger = 'pdb' getattr(sys.modules[__name__], debugger)(ui, repo, bannermsg, **opts) - -cmdtable = { - "debugshell|dbsh": (debugshell, []) -}