revert: migrate `opts` to native kwargs
authorMatt Harbison <matt_harbison@yahoo.com>
Sun, 20 Aug 2023 02:01:37 -0400
changeset 50849 fdf97ae05165
parent 50848 eb23eada6550
child 50850 65e2cb23294e
revert: migrate `opts` to native kwargs
mercurial/commands.py
--- a/mercurial/commands.py	Sun Aug 20 01:56:23 2023 -0400
+++ b/mercurial/commands.py	Sun Aug 20 02:01:37 2023 -0400
@@ -6397,30 +6397,29 @@
     Returns 0 on success.
     """
 
-    opts = pycompat.byteskwargs(opts)
-    if opts.get(b"date"):
-        cmdutil.check_incompatible_arguments(opts, b'date', [b'rev'])
-        opts[b"rev"] = cmdutil.finddate(ui, repo, opts[b"date"])
+    if opts.get("date"):
+        cmdutil.check_incompatible_arguments(opts, 'date', ['rev'])
+        opts["rev"] = cmdutil.finddate(ui, repo, opts["date"])
 
     parent, p2 = repo.dirstate.parents()
-    if not opts.get(b'rev') and p2 != repo.nullid:
+    if not opts.get('rev') and p2 != repo.nullid:
         # revert after merge is a trap for new users (issue2915)
         raise error.InputError(
             _(b'uncommitted merge with no revision specified'),
             hint=_(b"use 'hg update' or see 'hg help revert'"),
         )
 
-    rev = opts.get(b'rev')
+    rev = opts.get('rev')
     if rev:
         repo = scmutil.unhidehashlikerevs(repo, [rev], b'nowarn')
     ctx = logcmdutil.revsingle(repo, rev)
 
     if not (
         pats
-        or opts.get(b'include')
-        or opts.get(b'exclude')
-        or opts.get(b'all')
-        or opts.get(b'interactive')
+        or opts.get('include')
+        or opts.get('exclude')
+        or opts.get('all')
+        or opts.get('interactive')
     ):
         msg = _(b"no files or directories specified")
         if p2 != repo.nullid:
@@ -6454,7 +6453,7 @@
             hint = _(b"use --all to revert all files")
         raise error.InputError(msg, hint=hint)
 
-    return cmdutil.revert(ui, repo, ctx, *pats, **pycompat.strkwargs(opts))
+    return cmdutil.revert(ui, repo, ctx, *pats, **opts)
 
 
 @command(