contrib/debugshell.py
author Mads Kiilerich <mads@kiilerich.com>
Wed, 16 Nov 2011 03:45:14 +0100
changeset 15522 cf0f3cb8a332
parent 11633 6b7b99867ada
child 19771 3bc675361206
permissions -rw-r--r--
tests: don't use stdout redirection for test data Stdout redirection is not binary safe everywhere - for example not on windows with msys.

# debugshell extension
"""a python shell with repo, changelog & manifest objects"""

import mercurial
import code

def debugshell(ui, repo, **opts):
    objects = {
        'mercurial': mercurial,
        'repo': repo,
        'cl': repo.changelog,
        'mf': repo.manifest,
    }
    bannermsg = "loaded repo : %s\n" \
                "using source: %s" % (repo.root,
                                      mercurial.__path__[0])
    code.interact(bannermsg, local=objects)

cmdtable = {
    "debugshell|dbsh": (debugshell, [])
}