mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 01:07:15 +03:00
debugshell: define more modules
Summary: Add more shortcuts to common modules. This make it easier to test changed code paths. Reviewed By: markbt Differential Revision: D15952263 fbshipit-source-id: c0eca6a61902d36a26a99f85e29dc70f431eca59
This commit is contained in:
parent
3aa38649ec
commit
e4ce4c6416
@ -9,20 +9,32 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
import code
|
||||
import edenscm
|
||||
import edenscmnative
|
||||
import os
|
||||
import sys
|
||||
|
||||
from edenscm import mercurial
|
||||
from edenscm import hgext, mercurial
|
||||
from edenscm.mercurial import demandimport, registrar, thirdparty
|
||||
from edenscm.mercurial.i18n import _
|
||||
|
||||
from edenscmnative import bindings
|
||||
|
||||
cmdtable = {}
|
||||
command = registrar.command(cmdtable)
|
||||
|
||||
|
||||
def _assignobjects(objects, repo):
|
||||
objects.update({"m": mercurial, "mercurial": mercurial})
|
||||
objects.update(
|
||||
{
|
||||
"m": mercurial,
|
||||
"e": edenscm,
|
||||
"n": edenscmnative,
|
||||
"b": bindings,
|
||||
"x": hgext,
|
||||
"mercurial": mercurial,
|
||||
}
|
||||
)
|
||||
if repo:
|
||||
objects.update({"repo": repo, "cl": repo.changelog, "mf": repo.manifestlog})
|
||||
|
||||
@ -43,10 +55,17 @@ def debugshell(ui, repo, **opts):
|
||||
exec(command)
|
||||
return 0
|
||||
|
||||
bannermsg = (
|
||||
"loaded repo: %s\n"
|
||||
"using source: %s" % (repo and repo.root or "(none)", mercurial.__path__[0])
|
||||
+ "\n\nAvailable variables:\n m: the mercurial module\n ui: the ui object"
|
||||
bannermsg = "loaded repo: %s\n" "using source: %s" % (
|
||||
repo and repo.root or "(none)",
|
||||
mercurial.__path__[0],
|
||||
) + (
|
||||
"\n\nAvailable variables:\n"
|
||||
" e: edenscm\n"
|
||||
" n: edenscmnative\n"
|
||||
" m: edenscm.mercurial\n"
|
||||
" x: edenscm.hgext\n"
|
||||
" b: edenscmnative.bindings\n"
|
||||
" ui: the ui object"
|
||||
)
|
||||
if repo:
|
||||
bannermsg += (
|
||||
|
Loading…
Reference in New Issue
Block a user