rename: migrate `opts` to native kwargs
authorMatt Harbison <matt_harbison@yahoo.com>
Sun, 20 Aug 2023 01:54:59 -0400
changeset 50847 6720894996f2
parent 50846 1d9ba5b40093
child 50848 eb23eada6550
rename: migrate `opts` to native kwargs
mercurial/commands.py
--- a/mercurial/commands.py	Sun Aug 20 01:53:47 2023 -0400
+++ b/mercurial/commands.py	Sun Aug 20 01:54:59 2023 -0400
@@ -6032,9 +6032,8 @@
 
     Returns 0 on success, 1 if errors are encountered.
     """
-    opts = pycompat.byteskwargs(opts)
     context = lambda repo: repo.dirstate.changing_files(repo)
-    rev = opts.get(b'at_rev')
+    rev = opts.get('at_rev')
     ctx = None
     if rev:
         ctx = logcmdutil.revsingle(repo, rev)
@@ -6043,9 +6042,11 @@
             def context(repo):
                 return util.nullcontextmanager()
 
-            opts[b'at_rev'] = ctx.rev()
+            opts['at_rev'] = ctx.rev()
     with repo.wlock(), context(repo):
-        return cmdutil.copy(ui, repo, pats, opts, rename=True)
+        return cmdutil.copy(
+            ui, repo, pats, pycompat.byteskwargs(opts), rename=True
+        )
 
 
 @command(