Mercurial > public > mercurial-scm > hg-stable
diff contrib/debugshell.py @ 43076:2372284d9457
formatting: blacken the codebase
This is using my patch to black
(https://github.com/psf/black/pull/826) so we don't un-wrap collection
literals.
Done with:
hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**"' | xargs black -S
# skip-blame mass-reformatting only
# no-check-commit reformats foo_bar functions
Differential Revision: https://phab.mercurial-scm.org/D6971
author | Augie Fackler <augie@google.com> |
---|---|
date | Sun, 06 Oct 2019 09:45:02 -0400 |
parents | b10bbbe995eb |
children | 86e4daa2d54c |
line wrap: on
line diff
--- a/contrib/debugshell.py Sat Oct 05 10:29:34 2019 -0400 +++ b/contrib/debugshell.py Sun Oct 06 09:45:02 2019 -0400 @@ -14,6 +14,7 @@ cmdtable = {} command = registrar.command(cmdtable) + def pdb(ui, repo, msg, **opts): objects = { 'mercurial': mercurial, @@ -24,25 +25,25 @@ code.interact(msg, local=objects) + def ipdb(ui, repo, msg, **opts): import IPython cl = repo.changelog mf = repo.manifestlog - cl, mf # use variables to appease pyflakes + cl, mf # use variables to appease pyflakes IPython.embed() + @command(b'debugshell|dbsh', []) def debugshell(ui, repo, **opts): - bannermsg = ("loaded repo : %s\n" - "using source: %s" % (pycompat.sysstr(repo.root), - mercurial.__path__[0])) + bannermsg = "loaded repo : %s\n" "using source: %s" % ( + pycompat.sysstr(repo.root), + mercurial.__path__[0], + ) - pdbmap = { - 'pdb' : 'code', - 'ipdb' : 'IPython' - } + pdbmap = {'pdb': 'code', 'ipdb': 'IPython'} debugger = ui.config(b"ui", b"debugger") if not debugger: @@ -55,8 +56,10 @@ with demandimport.deactivated(): __import__(pdbmap[debugger]) except ImportError: - ui.warn((b"%s debugger specified but %s module was not found\n") - % (debugger, pdbmap[debugger])) + ui.warn( + b"%s debugger specified but %s module was not found\n" + % (debugger, pdbmap[debugger]) + ) debugger = b'pdb' getattr(sys.modules[__name__], debugger)(ui, repo, bannermsg, **opts)