changeset 50879:7e6cd8472dc8

keyword: migrate `opts` to native kwargs
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 20 Aug 2023 16:43:41 -0400
parents bbaac3a222bb
children ee393dbfe5cb
files hgext/keyword.py
diffstat 1 files changed, 8 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/keyword.py	Sun Aug 20 16:20:56 2023 -0400
+++ b/hgext/keyword.py	Sun Aug 20 16:43:41 2023 -0400
@@ -420,11 +420,10 @@
     """Bails out if [keyword] configuration is not active.
     Returns status of working directory."""
     if kwt:
-        opts = pycompat.byteskwargs(opts)
         return repo.status(
-            match=scmutil.match(wctx, pats, opts),
+            match=scmutil.match(wctx, pats, pycompat.byteskwargs(opts)),
             clean=True,
-            unknown=opts.get(b'unknown') or opts.get(b'all'),
+            unknown=opts.get('unknown') or opts.get('all'),
         )
     if ui.configitems(b'keyword'):
         raise error.Abort(_(b'[keyword] patterns cannot match'))
@@ -604,26 +603,26 @@
     else:
         cwd = b''
     files = []
-    opts = pycompat.byteskwargs(opts)
-    if not opts.get(b'unknown') or opts.get(b'all'):
+
+    if not opts.get('unknown') or opts.get('all'):
         files = sorted(status.modified + status.added + status.clean)
     kwfiles = kwt.iskwfile(files, wctx)
     kwdeleted = kwt.iskwfile(status.deleted, wctx)
     kwunknown = kwt.iskwfile(status.unknown, wctx)
-    if not opts.get(b'ignore') or opts.get(b'all'):
+    if not opts.get('ignore') or opts.get('all'):
         showfiles = kwfiles, kwdeleted, kwunknown
     else:
         showfiles = [], [], []
-    if opts.get(b'all') or opts.get(b'ignore'):
+    if opts.get('all') or opts.get('ignore'):
         showfiles += (
             [f for f in files if f not in kwfiles],
             [f for f in status.unknown if f not in kwunknown],
         )
     kwlabels = b'enabled deleted enabledunknown ignored ignoredunknown'.split()
     kwstates = zip(kwlabels, pycompat.bytestr(b'K!kIi'), showfiles)
-    fm = ui.formatter(b'kwfiles', opts)
+    fm = ui.formatter(b'kwfiles', pycompat.byteskwargs(opts))
     fmt = b'%.0s%s\n'
-    if opts.get(b'all') or ui.verbose:
+    if opts.get('all') or ui.verbose:
         fmt = b'%s %s\n'
     for kwstate, char, filenames in kwstates:
         label = b'kwfiles.' + kwstate