closehead: migrate `opts` to native kwargs
authorMatt Harbison <matt_harbison@yahoo.com>
Sun, 20 Aug 2023 15:38:35 -0400
changeset 50873 259213382862
parent 50872 5a22b2594d96
child 50874 f12d53a6e8b8
closehead: migrate `opts` to native kwargs
hgext/closehead.py
--- a/hgext/closehead.py	Sun Aug 20 15:34:11 2023 -0400
+++ b/hgext/closehead.py	Sun Aug 20 15:38:35 2023 -0400
@@ -54,8 +54,8 @@
             text=message,
             files=[],
             filectxfn=None,
-            user=opts.get(b'user'),
-            date=opts.get(b'date'),
+            user=opts.get('user'),
+            date=opts.get('date'),
             extra=extra,
         )
         tr = repo.transaction(b'commit')
@@ -64,9 +64,7 @@
         cctx.markcommitted(ret)
         tr.close()
 
-    opts = pycompat.byteskwargs(opts)
-
-    revs += tuple(opts.get(b'rev', []))
+    revs += tuple(opts.get('rev', []))
     revs = logcmdutil.revrange(repo, revs)
 
     if not revs:
@@ -80,7 +78,7 @@
         if rev not in heads:
             raise error.Abort(_(b'revision is not an open head: %d') % rev)
 
-    message = cmdutil.logmessage(ui, opts)
+    message = cmdutil.logmessage(ui, pycompat.byteskwargs(opts))
     if not message:
         raise error.Abort(_(b"no commit message specified with -l or -m"))
     extra = {b'close': b'1'}