# HG changeset patch # User Matt Harbison # Date 1692500800 14400 # Node ID 489268c8ee7e900fd5d32e65c07d329804294af8 # Parent b922c767b21414648b56e69fe0ece8031918601e cmdutil: migrate `opts` on commitstatus() to native kwargs diff -r b922c767b214 -r 489268c8ee7e mercurial/cmdutil.py --- a/mercurial/cmdutil.py Sat Aug 19 22:56:14 2023 -0400 +++ b/mercurial/cmdutil.py Sat Aug 19 23:06:40 2023 -0400 @@ -3329,9 +3329,7 @@ return b"\n".join(edittext) -def commitstatus(repo, node, branch, bheads=None, tip=None, opts=None): - if opts is None: - opts = {} +def commitstatus(repo, node, branch, bheads=None, tip=None, **opts): ctx = repo[node] parents = ctx.parents() @@ -3341,7 +3339,7 @@ # for most instances repo.ui.warn(_(b"warning: commit already existed in the repository!\n")) elif ( - not opts.get(b'amend') + not opts.get('amend') and bheads and node not in bheads and not any( @@ -3378,7 +3376,7 @@ # # H H n head merge: head count decreases - if not opts.get(b'close_branch'): + if not opts.get('close_branch'): for r in parents: if r.closesbranch() and r.branch() == branch: repo.ui.status( diff -r b922c767b214 -r 489268c8ee7e mercurial/commands.py --- a/mercurial/commands.py Sat Aug 19 22:56:14 2023 -0400 +++ b/mercurial/commands.py Sat Aug 19 23:06:40 2023 -0400 @@ -2175,7 +2175,6 @@ cmdutil.checkunfinished(repo) node = cmdutil.amend(ui, repo, old, extra, pats, opts) - opts = pycompat.byteskwargs(opts) if node == old.node(): ui.status(_(b"nothing changed\n")) return 1 @@ -2206,11 +2205,14 @@ extra=extra, ) - opts = pycompat.byteskwargs(opts) - node = cmdutil.commit(ui, repo, commitfunc, pats, opts) + node = cmdutil.commit( + ui, repo, commitfunc, pats, pycompat.byteskwargs(opts) + ) if not node: - stat = cmdutil.postcommitstatus(repo, pats, opts) + stat = cmdutil.postcommitstatus( + repo, pats, pycompat.byteskwargs(opts) + ) if stat.deleted: ui.status( _( @@ -2223,7 +2225,7 @@ ui.status(_(b"nothing changed\n")) return 1 - cmdutil.commitstatus(repo, node, branch, bheads, tip, opts) + cmdutil.commitstatus(repo, node, branch, bheads, tip, **opts) if not ui.quiet and ui.configbool(b'commands', b'commit.post-status'): status( @@ -2234,7 +2236,7 @@ removed=True, deleted=True, unknown=True, - subrepos=opts.get(b'subrepos'), + subrepos=opts.get('subrepos'), )