##// END OF EJS Templates
debugshell: abstract out pdb code.interact
Sean Farley -
r19771:3bc67536 default
parent child Browse files
Show More
@@ -4,17 +4,22 b''
4 import mercurial
4 import mercurial
5 import code
5 import code
6
6
7 def debugshell(ui, repo, **opts):
7 def pdb(ui, repo, msg, **opts):
8 objects = {
8 objects = {
9 'mercurial': mercurial,
9 'mercurial': mercurial,
10 'repo': repo,
10 'repo': repo,
11 'cl': repo.changelog,
11 'cl': repo.changelog,
12 'mf': repo.manifest,
12 'mf': repo.manifest,
13 }
13 }
14
15 code.interact(msg, local=objects)
16
17 def debugshell(ui, repo, **opts):
14 bannermsg = "loaded repo : %s\n" \
18 bannermsg = "loaded repo : %s\n" \
15 "using source: %s" % (repo.root,
19 "using source: %s" % (repo.root,
16 mercurial.__path__[0])
20 mercurial.__path__[0])
17 code.interact(bannermsg, local=objects)
21
22 pdb(ui, repo, bannermsg, **opts)
18
23
19 cmdtable = {
24 cmdtable = {
20 "debugshell|dbsh": (debugshell, [])
25 "debugshell|dbsh": (debugshell, [])
General Comments 0
You need to be logged in to leave comments. Login now