# HG changeset patch # User Matt Harbison # Date 1692564221 14400 # Node ID 7e6cd8472dc80c2aa898b655c29008b2730f2f5a # Parent bbaac3a222bbaafc7f9f3f2fb7e7a50342ed2fd6 keyword: migrate `opts` to native kwargs diff -r bbaac3a222bb -r 7e6cd8472dc8 hgext/keyword.py --- 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