Patchwork D6031: py3: make contrib/debugshell.py work with Python 3

login
register
mail settings
Submitter phabricator
Date Feb. 28, 2019, 1:48 a.m.
Message ID <806bbfccd15a201626ecd7d298c3756b@localhost.localdomain>
Download mbox | patch
Permalink /patch/38960/
State Not Applicable
Headers show

Comments

phabricator - Feb. 28, 2019, 1:48 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGb10bbbe995eb: py3: make contrib/debugshell.py work with Python 3 (authored by pulkit, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D6031?vs=14257&id=14267#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6031?vs=14257&id=14267

REVISION DETAIL
  https://phab.mercurial-scm.org/D6031

AFFECTED FILES
  contrib/debugshell.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/contrib/debugshell.py b/contrib/debugshell.py
--- a/contrib/debugshell.py
+++ b/contrib/debugshell.py
@@ -7,6 +7,7 @@ 
 import sys
 from mercurial import (
     demandimport,
+    pycompat,
     registrar,
 )
 
@@ -32,28 +33,30 @@ 
 
     IPython.embed()
 
-@command('debugshell|dbsh', [])
+@command(b'debugshell|dbsh', [])
 def debugshell(ui, repo, **opts):
     bannermsg = ("loaded repo : %s\n"
-                 "using source: %s" % (repo.root,
+                 "using source: %s" % (pycompat.sysstr(repo.root),
                                        mercurial.__path__[0]))
 
     pdbmap = {
         'pdb'  : 'code',
         'ipdb' : 'IPython'
     }
 
-    debugger = ui.config("ui", "debugger")
+    debugger = ui.config(b"ui", b"debugger")
     if not debugger:
         debugger = 'pdb'
+    else:
+        debugger = pycompat.sysstr(debugger)
 
     # if IPython doesn't exist, fallback to code.interact
     try:
         with demandimport.deactivated():
             __import__(pdbmap[debugger])
     except ImportError:
-        ui.warn(("%s debugger specified but %s module was not found\n")
+        ui.warn((b"%s debugger specified but %s module was not found\n")
                 % (debugger, pdbmap[debugger]))
-        debugger = 'pdb'
+        debugger = b'pdb'
 
     getattr(sys.modules[__name__], debugger)(ui, repo, bannermsg, **opts)