##// END OF EJS Templates
debugshell: declare command using decorator
Gregory Szorc -
r21243:8b5c039f default
parent child Browse files
Show More
@@ -4,6 +4,10 b''
4 import sys
4 import sys
5 import mercurial
5 import mercurial
6 import code
6 import code
7 from mercurial import cmdutil
8
9 cmdtable = {}
10 command = cmdutil.command(cmdtable)
7
11
8 def pdb(ui, repo, msg, **opts):
12 def pdb(ui, repo, msg, **opts):
9 objects = {
13 objects = {
@@ -24,6 +28,7 b' def ipdb(ui, repo, msg, **opts):'
24
28
25 IPython.embed()
29 IPython.embed()
26
30
31 @command('debugshell|dbsh', [])
27 def debugshell(ui, repo, **opts):
32 def debugshell(ui, repo, **opts):
28 bannermsg = "loaded repo : %s\n" \
33 bannermsg = "loaded repo : %s\n" \
29 "using source: %s" % (repo.root,
34 "using source: %s" % (repo.root,
@@ -47,7 +52,3 b' def debugshell(ui, repo, **opts):'
47 debugger = 'pdb'
52 debugger = 'pdb'
48
53
49 getattr(sys.modules[__name__], debugger)(ui, repo, bannermsg, **opts)
54 getattr(sys.modules[__name__], debugger)(ui, repo, bannermsg, **opts)
50
51 cmdtable = {
52 "debugshell|dbsh": (debugshell, [])
53 }
General Comments 0
You need to be logged in to leave comments. Login now