# HG changeset patch # User Martin von Zweigbergk # Date 2020-10-16 05:23:02 # Node ID 450e17e5960344494402d3183eb5cc82977dc3c4 # Parent 84ce9ffc95adc20c4285006976f69d515b172542 commit: leverage cmdutil.check_incompatible_arguments() Differential Revision: https://phab.mercurial-scm.org/D9218 diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2015,8 +2015,7 @@ def _docommit(ui, repo, *pats, **opts): opts = pycompat.byteskwargs(opts) if opts.get(b'subrepos'): - if opts.get(b'amend'): - raise error.Abort(_(b'cannot amend with --subrepos')) + cmdutil.check_incompatible_arguments(opts, b'subrepos', [b'amend']) # Let --subrepos on the command line override config setting. ui.setconfig(b'ui', b'commitsubrepos', True, b'commit')