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