automv: migrate `opts` to native kwargs
authorMatt Harbison <matt_harbison@yahoo.com>
Sun, 20 Aug 2023 15:24:58 -0400
changeset 50870 47af00b2217f
parent 50869 e0cae2b44191
child 50871 0c76520ec4cc
automv: migrate `opts` to native kwargs
hgext/automv.py
--- a/hgext/automv.py	Sun Aug 20 15:16:18 2023 -0400
+++ b/hgext/automv.py	Sun Aug 20 15:24:58 2023 -0400
@@ -56,9 +56,8 @@
 
 def mvcheck(orig, ui, repo, *pats, **opts):
     """Hook to check for moves at commit time"""
-    opts = pycompat.byteskwargs(opts)
     renames = None
-    disabled = opts.pop(b'no_automv', False)
+    disabled = opts.pop('no_automv', False)
     with repo.wlock():
         if not disabled:
             threshold = ui.configint(b'automv', b'similarity')
@@ -67,7 +66,9 @@
                     _(b'automv.similarity must be between 0 and 100')
                 )
             if threshold > 0:
-                match = scmutil.match(repo[None], pats, opts)
+                match = scmutil.match(
+                    repo[None], pats, pycompat.byteskwargs(opts)
+                )
                 added, removed = _interestingfiles(repo, match)
                 uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=True)
                 renames = _findrenames(
@@ -82,7 +83,7 @@
                 # current extension structure, and this is not worse than what
                 # happened before.
                 scmutil._markchanges(repo, (), (), renames)
-        return orig(ui, repo, *pats, **pycompat.strkwargs(opts))
+        return orig(ui, repo, *pats, **opts)
 
 
 def _interestingfiles(repo, matcher):