##// END OF EJS Templates
debugshell: add function to embed ipython
debugshell: add function to embed ipython

File last commit:

r19772:6ccec36a default
r19772:6ccec36a default
Show More
debugshell.py
34 lines | 721 B | text/x-python | PythonLexer
# debugshell extension
"""a python shell with repo, changelog & manifest objects"""
import mercurial
import code
def pdb(ui, repo, msg, **opts):
objects = {
'mercurial': mercurial,
'repo': repo,
'cl': repo.changelog,
'mf': repo.manifest,
}
code.interact(msg, local=objects)
def ipdb(ui, repo, msg, **opts):
import IPython
cl = repo.changelog
mf = repo.manifest
IPython.embed()
def debugshell(ui, repo, **opts):
bannermsg = "loaded repo : %s\n" \
"using source: %s" % (repo.root,
mercurial.__path__[0])
pdb(ui, repo, bannermsg, **opts)
cmdtable = {
"debugshell|dbsh": (debugshell, [])
}