# HG changeset patch # User Martin von Zweigbergk # Date 1623362110 25200 # Node ID fca9c63f160ec228d0c43514167681fe62eb038f # Parent 3ee036c6f8345e26aab352c4090660d5c43f71ce cmdutil: make amend() take str-keyed opts I couldn't think of a reasonable change to the signature here, so unfortunately it keeps the existing one. Differential Revision: https://phab.mercurial-scm.org/D10862 diff -r 3ee036c6f834 -r fca9c63f160e mercurial/cmdutil.py --- a/mercurial/cmdutil.py Thu Jun 10 14:47:14 2021 -0700 +++ b/mercurial/cmdutil.py Thu Jun 10 14:55:10 2021 -0700 @@ -2783,6 +2783,7 @@ def amend(ui, repo, old, extra, pats, opts): + opts = pycompat.byteskwargs(opts) # avoid cycle context -> subrepo -> cmdutil from . import context diff -r 3ee036c6f834 -r fca9c63f160e mercurial/commands.py --- a/mercurial/commands.py Thu Jun 10 14:47:14 2021 -0700 +++ b/mercurial/commands.py Thu Jun 10 14:55:10 2021 -0700 @@ -2135,8 +2135,8 @@ if not obsolete.isenabled(repo, obsolete.createmarkersopt): cmdutil.checkunfinished(repo) + node = cmdutil.amend(ui, repo, old, extra, pats, opts) opts = pycompat.byteskwargs(opts) - node = cmdutil.amend(ui, repo, old, extra, pats, opts) if node == old.node(): ui.status(_(b"nothing changed\n")) return 1 diff -r 3ee036c6f834 -r fca9c63f160e tests/test-obsolete.t --- a/tests/test-obsolete.t Thu Jun 10 14:47:14 2021 -0700 +++ b/tests/test-obsolete.t Thu Jun 10 14:55:10 2021 -0700 @@ -1478,9 +1478,8 @@ > command = registrar.command(cmdtable) > @command(b"amendtransient",[], _(b'hg amendtransient [rev]')) > def amend(ui, repo, *pats, **opts): - > opts = pycompat.byteskwargs(opts) - > opts[b'message'] = b'Test' - > opts[b'logfile'] = None + > opts['message'] = b'Test' + > opts['logfile'] = None > cmdutil.amend(ui, repo, repo[b'.'], {}, pats, opts) > ui.write(b'%s\n' % stringutil.pprint(repo.changelog.headrevs())) > EOF