# HG changeset patch # User Martin von Zweigbergk # Date 1669757461 28800 # Node ID f65656572e255d783ca4c3aa18f5307b778dfd5c # Parent bcae90c53defff8253ce78290a2dbd9e35af9a89 commit: move check for incompatible args earlier I think it makes sense to check the command line arguments as early as possible, so we don't have to wait for a repo lock to tell the user that they passed invalid arguments. diff -r bcae90c53def -r f65656572e25 mercurial/commands.py --- 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')