py3: handle keyword arguments correctly in debugcommands.py
authorPulkit Goyal <7895pulkit@gmail.com>
Sun, 10 Dec 2017 06:36:20 +0530
changeset 35401 cd3392cb5818
parent 35400 8a0cac20a1ad
child 35402 b1c9853e0775
py3: handle keyword arguments correctly in debugcommands.py Differential Revision: https://phab.mercurial-scm.org/D1671
mercurial/debugcommands.py
--- a/mercurial/debugcommands.py	Mon Dec 11 09:27:40 2017 -0800
+++ b/mercurial/debugcommands.py	Sun Dec 10 06:36:20 2017 +0530
@@ -368,6 +368,7 @@
         norepo=True)
 def debugcapabilities(ui, path, **opts):
     """lists the capabilities of a remote peer"""
+    opts = pycompat.byteskwargs(opts)
     peer = hg.peer(ui, opts, path)
     caps = peer.capabilities()
     ui.write(('Main capabilities:\n'))
@@ -870,6 +871,7 @@
 
     Use --verbose to get extra information about current config value and
     Mercurial default."""
+    opts = pycompat.byteskwargs(opts)
     maxvariantlength = max(len(fv.name) for fv in upgrade.allformatvariant)
     maxvariantlength = max(len('format-variant'), maxvariantlength)
 
@@ -2324,7 +2326,7 @@
         ctx = repo[rev]
         ui.write('%s\n'% ctx2str(ctx))
         for succsset in obsutil.successorssets(repo, ctx.node(),
-                                                closest=opts['closest'],
+                                                closest=opts[r'closest'],
                                                 cache=cache):
             if succsset:
                 ui.write('    ')
@@ -2450,6 +2452,7 @@
     for k, v in opts.iteritems():
         if v:
             args[k] = v
+    args = pycompat.strkwargs(args)
     # run twice to check that we don't mess up the stream for the next command
     res1 = repo.debugwireargs(*vals, **args)
     res2 = repo.debugwireargs(*vals, **args)