contrib/debugshell.py
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Wed, 04 Jul 2012 02:02:48 +0200
changeset 17125 95d785ccb4e5
parent 11633 6b7b99867ada
child 19771 3bc675361206
permissions -rw-r--r--
obsolete: append new markers to obsstore file instead of rewriting everything This is the second step toward incremental writing of marker inside a transaction. The obsstore file is now handled append only. Header writing have been extracted from _writemarkers. Because the _writemarkers method have been dropped, the push code directly reuse the serialised content of local repo `listkeys`. This is not very pretty, but this part of the protocol still need major improvement anyway.

# 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, [])
}