D1628: py3: handle keyword arguments correctly in commands.py

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Sun Dec 10 01:09:02 UTC 2017


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/D1628

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1278,6 +1278,7 @@
 
     Returns 0 on success.
     """
+    opts = pycompat.byteskwargs(opts)
     ctx = scmutil.revsingle(repo, opts.get('rev'))
     m = scmutil.match(ctx, (file1,) + pats, opts)
     fntemplate = opts.pop('output', '')
@@ -1290,7 +1291,8 @@
         ui.pager('cat')
         fm = ui.formatter('cat', opts)
     with fm:
-        return cmdutil.cat(ui, repo, ctx, m, fm, fntemplate, '', **opts)
+        return cmdutil.cat(ui, repo, ctx, m, fm, fntemplate, '',
+                           **pycompat.strkwargs(opts))
 
 @command('^clone',
     [('U', 'noupdate', None, _('the clone will include an empty working '
@@ -1743,7 +1745,7 @@
 def debugcomplete(ui, cmd='', **opts):
     """returns the completion list associated with the given command"""
 
-    if opts.get('options'):
+    if opts.get(r'options'):
         options = []
         otables = [globalopts]
         if cmd:



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


More information about the Mercurial-devel mailing list