changeset 45774:450e17e59603

commit: leverage cmdutil.check_incompatible_arguments() Differential Revision: https://phab.mercurial-scm.org/D9218
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 15 Oct 2020 22:23:02 -0700
parents 84ce9ffc95ad
children 5bb900885311
files mercurial/commands.py
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Tue Oct 27 10:06:17 2020 -0700
+++ b/mercurial/commands.py	Thu Oct 15 22:23:02 2020 -0700
@@ -2015,8 +2015,7 @@
 
     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')