py3: handle keyword arguments correctly in commands.py
authorPulkit Goyal <7895pulkit@gmail.com>
Sun, 10 Dec 2017 04:45:41 +0530
changeset 35352 920cca6c8462
parent 35351 a4478f74ad56
child 35353 8384553b1684
py3: handle keyword arguments correctly in commands.py Differential Revision: https://phab.mercurial-scm.org/D1628
mercurial/commands.py
--- a/mercurial/commands.py	Sun Dec 10 04:45:27 2017 +0530
+++ b/mercurial/commands.py	Sun Dec 10 04:45:41 2017 +0530
@@ -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: