changeset 50407:4fafc6642bee

cat: drop unnecessary internal roundtrip of kwargs PyCharm seems to stick with the type at the initial assignment, so it flagged the `get()` with a bytes key since the method argument has str keys. It wasn't a bug, but then the bytes form is otherwise unused, and converted back to str.
author Matt Harbison <matt_harbison@yahoo.com>
date Wed, 01 Mar 2023 11:33:57 -0500
parents ffdfb1066ac6
children 4a73df6eb67d
files mercurial/cmdutil.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Thu Mar 02 15:34:45 2023 +0100
+++ b/mercurial/cmdutil.py	Wed Mar 01 11:33:57 2023 -0500
@@ -2754,7 +2754,6 @@
 
 def cat(ui, repo, ctx, matcher, basefm, fntemplate, prefix, **opts):
     err = 1
-    opts = pycompat.byteskwargs(opts)
 
     def write(path):
         filename = None
@@ -2768,7 +2767,7 @@
             except OSError:
                 pass
         with formatter.maybereopen(basefm, filename) as fm:
-            _updatecatformatter(fm, ctx, matcher, path, opts.get(b'decode'))
+            _updatecatformatter(fm, ctx, matcher, path, opts.get('decode'))
 
     # Automation often uses hg cat on single files, so special case it
     # for performance to avoid the cost of parsing the manifest.
@@ -2803,7 +2802,7 @@
                 basefm,
                 fntemplate,
                 subprefix,
-                **pycompat.strkwargs(opts),
+                **opts,
             ):
                 err = 0
         except error.RepoLookupError: