changeset 50896:259213382862

closehead: migrate `opts` to native kwargs
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 20 Aug 2023 15:38:35 -0400
parents 5a22b2594d96
children f12d53a6e8b8
files hgext/closehead.py
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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'}