debugshell: abstract out pdb code.interact
authorSean Farley <sean.michael.farley@gmail.com>
Sun, 14 Jul 2013 12:10:52 -0500
changeset 19771 3bc675361206
parent 19770 0361163efbaf
child 19772 6ccec36a1fd9
debugshell: abstract out pdb code.interact
contrib/debugshell.py
--- a/contrib/debugshell.py	Sun Sep 22 13:52:18 2013 +0400
+++ b/contrib/debugshell.py	Sun Jul 14 12:10:52 2013 -0500
@@ -4,17 +4,22 @@
 import mercurial
 import code
 
-def debugshell(ui, repo, **opts):
+def pdb(ui, repo, msg, **opts):
     objects = {
         'mercurial': mercurial,
         'repo': repo,
         'cl': repo.changelog,
         'mf': repo.manifest,
     }
+
+    code.interact(msg, local=objects)
+
+def debugshell(ui, repo, **opts):
     bannermsg = "loaded repo : %s\n" \
                 "using source: %s" % (repo.root,
                                       mercurial.__path__[0])
-    code.interact(bannermsg, local=objects)
+
+    pdb(ui, repo, bannermsg, **opts)
 
 cmdtable = {
     "debugshell|dbsh": (debugshell, [])