contrib/debugshell.py
changeset 19771 3bc675361206
parent 11633 6b7b99867ada
child 19772 6ccec36a1fd9
equal deleted inserted replaced
19770:0361163efbaf 19771:3bc675361206
     2 """a python shell with repo, changelog & manifest objects"""
     2 """a python shell with repo, changelog & manifest objects"""
     3 
     3 
     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, [])
    21 }
    26 }