# HG changeset patch # User Matt Harbison # Date 1692564709 14400 # Node ID ee393dbfe5cbc254e63a55de8ee7a3d898da16a7 # Parent 7e6cd8472dc80c2aa898b655c29008b2730f2f5a largefiles: migrate `opts` to native kwargs diff -r 7e6cd8472dc8 -r ee393dbfe5cb hgext/largefiles/lfcommands.py --- a/hgext/largefiles/lfcommands.py Sun Aug 20 16:43:41 2023 -0400 +++ b/hgext/largefiles/lfcommands.py Sun Aug 20 16:51:49 2023 -0400 @@ -27,7 +27,6 @@ lock, logcmdutil, match as matchmod, - pycompat, scmutil, util, ) @@ -87,12 +86,11 @@ Use --to-normal to convert largefiles back to normal files; after this, the DEST repository can be used without largefiles at all.""" - opts = pycompat.byteskwargs(opts) - if opts[b'to_normal']: + if opts['to_normal']: tolfile = False else: tolfile = True - size = lfutil.getminsize(ui, True, opts.get(b'size'), default=None) + size = lfutil.getminsize(ui, True, opts.get('size'), default=None) if not hg.islocal(src): raise error.Abort(_(b'%s is not a local Mercurial repo') % src) diff -r 7e6cd8472dc8 -r ee393dbfe5cb hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py Sun Aug 20 16:43:41 2023 -0400 +++ b/hgext/largefiles/overrides.py Sun Aug 20 16:51:49 2023 -0400 @@ -1717,11 +1717,10 @@ @eh.wrapcommand(b'cat') def overridecat(orig, ui, repo, file1, *pats, **opts): - opts = pycompat.byteskwargs(opts) - ctx = logcmdutil.revsingle(repo, opts.get(b'rev')) + ctx = logcmdutil.revsingle(repo, opts.get('rev')) err = 1 notbad = set() - m = scmutil.match(ctx, (file1,) + pats, opts) + m = scmutil.match(ctx, (file1,) + pats, pycompat.byteskwargs(opts)) origmatchfn = m.matchfn def lfmatchfn(f): @@ -1758,12 +1757,12 @@ m.visitdir = lfvisitdirfn for f in ctx.walk(m): - with cmdutil.makefileobj(ctx, opts.get(b'output'), pathname=f) as fp: + with cmdutil.makefileobj(ctx, opts.get('output'), pathname=f) as fp: lf = lfutil.splitstandin(f) if lf is None or origmatchfn(f): # duplicating unreachable code from commands.cat data = ctx[f].data() - if opts.get(b'decode'): + if opts.get('decode'): data = repo.wwritedata(f, data) fp.write(data) else: