contrib/debugshell.py
author Pierre-Yves David <pierre-yves.david@logilab.fr>
Mon, 15 Apr 2013 17:10:58 +0200
changeset 18983 31bcc5112191
parent 11633 6b7b99867ada
child 19771 3bc675361206
permissions -rw-r--r--
destroyed: invalidate phraserevs cache in all case (issue3858) When revisions are destroyed, the `phaserevs` cache becomes invalid in most case. This cache hold a `{rev => phase}` mapping and revision number most likely changed. Since 1c8e0d6ac3b0, we filter unknown phases' roots after changesets destruction. When some roots are filtered the `phaserevs` cache is invalidated. But not if none root where destroyed. We now invalidate the cache in all case filtered root or not. This bug was a bit tricky to reproduce as in most case we either: * rebase a set a draft changeset including root (phaserev invalidated) * strip tip-most changesets (no re-numbering of revision) Note that the invalidation of `phaserevs` are not strictly needed when only tip-most part of the history have been destroyed. But I do not expect the overhead to be significant.

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