debugdata: migrate `opts` to native kwargs
authorMatt Harbison <matt_harbison@yahoo.com>
Mon, 21 Aug 2023 16:53:16 -0400
changeset 50946 4135e7271b9e
parent 50945 ad9b7017ca22
child 50947 32fe4af9971d
debugdata: migrate `opts` to native kwargs
mercurial/debugcommands.py
--- a/mercurial/debugcommands.py	Mon Aug 21 16:51:07 2023 -0400
+++ b/mercurial/debugcommands.py	Mon Aug 21 16:53:16 2023 -0400
@@ -709,8 +709,7 @@
 @command(b'debugdata', cmdutil.debugrevlogopts, _(b'-c|-m|FILE REV'))
 def debugdata(ui, repo, file_, rev=None, **opts):
     """dump the contents of a data file revision"""
-    opts = pycompat.byteskwargs(opts)
-    if opts.get(b'changelog') or opts.get(b'manifest') or opts.get(b'dir'):
+    if opts.get('changelog') or opts.get('manifest') or opts.get('dir'):
         if rev is not None:
             raise error.InputError(
                 _(b'cannot specify a revision with other arguments')
@@ -718,7 +717,9 @@
         file_, rev = None, file_
     elif rev is None:
         raise error.InputError(_(b'please specify a revision'))
-    r = cmdutil.openstorage(repo, b'debugdata', file_, opts)
+    r = cmdutil.openstorage(
+        repo, b'debugdata', file_, pycompat.byteskwargs(opts)
+    )
     try:
         ui.write(r.rawdata(r.lookup(rev)))
     except KeyError: