Patchwork D1671: py3: handle keyword arguments correctly in debugcommands.py

login
register
mail settings
Submitter phabricator
Date Dec. 12, 2017, 11:25 p.m.
Message ID <differential-rev-PHID-DREV-hpfhyhd4gsgymr74s46m-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/26252/
State Superseded
Headers show

Comments

phabricator - Dec. 12, 2017, 11:25 p.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/debugcommands.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -365,6 +365,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'))
@@ -867,6 +868,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)
 
@@ -2296,7 +2298,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('    ')
@@ -2422,6 +2424,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)