mercurial/commands.py
changeset 49768 f65656572e25
parent 49741 2aaa5d1e57e9
child 49770 f0e9dda408b3
--- a/mercurial/commands.py	Mon Nov 07 22:30:30 2022 -0500
+++ b/mercurial/commands.py	Tue Nov 29 13:31:01 2022 -0800
@@ -2082,6 +2082,7 @@
 
           hg commit --amend --date now
     """
+    cmdutil.check_incompatible_arguments(opts, 'subrepos', ['amend'])
     with repo.wlock(), repo.lock():
         return _docommit(ui, repo, *pats, **opts)
 
@@ -2097,7 +2098,6 @@
         return 1 if ret == 0 else ret
 
     if opts.get('subrepos'):
-        cmdutil.check_incompatible_arguments(opts, 'subrepos', ['amend'])
         # Let --subrepos on the command line override config setting.
         ui.setconfig(b'ui', b'commitsubrepos', True, b'commit')