# HG changeset patch # User Matt Harbison # Date 1692510712 14400 # Node ID e674941ad4eb6e9bf4d00c5b4bdd0f7a68397d4a # Parent fb0f07c64304014afedd1969c0b625a316022bab purge: migrate `opts` to native kwargs diff -r fb0f07c64304 -r e674941ad4eb mercurial/commands.py --- a/mercurial/commands.py Sun Aug 20 01:49:48 2023 -0400 +++ b/mercurial/commands.py Sun Aug 20 01:51:52 2023 -0400 @@ -5633,24 +5633,23 @@ list of files that this program would delete, use the --print option. """ - opts = pycompat.byteskwargs(opts) - cmdutil.check_at_most_one_arg(opts, b'all', b'ignored') - - act = not opts.get(b'print') + cmdutil.check_at_most_one_arg(opts, 'all', 'ignored') + + act = not opts.get('print') eol = b'\n' - if opts.get(b'print0'): + if opts.get('print0'): eol = b'\0' act = False # --print0 implies --print - if opts.get(b'all', False): + if opts.get('all', False): ignored = True unknown = True else: - ignored = opts.get(b'ignored', False) + ignored = opts.get('ignored', False) unknown = not ignored - removefiles = opts.get(b'files') - removedirs = opts.get(b'dirs') - confirm = opts.get(b'confirm') + removefiles = opts.get('files') + removedirs = opts.get('dirs') + confirm = opts.get('confirm') if confirm is None: try: extensions.find(b'purge') @@ -5662,7 +5661,7 @@ removefiles = True removedirs = True - match = scmutil.match(repo[None], dirs, opts) + match = scmutil.match(repo[None], dirs, pycompat.byteskwargs(opts)) paths = mergemod.purge( repo, @@ -5671,7 +5670,7 @@ ignored=ignored, removeemptydirs=removedirs, removefiles=removefiles, - abortonerror=opts.get(b'abort_on_err'), + abortonerror=opts.get('abort_on_err'), noop=not act, confirm=confirm, )