changeset 50870:47af00b2217f

automv: migrate `opts` to native kwargs
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 20 Aug 2023 15:24:58 -0400
parents e0cae2b44191
children 0c76520ec4cc
files hgext/automv.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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):