serve: leverage cmdutil.check_incompatible_arguments()
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 15 Oct 2020 22:36:17 -0700
changeset 45744 4df5d3965a3e
parent 45743 3b23cec4953f
child 45745 94f681b84c70
serve: leverage cmdutil.check_incompatible_arguments() Differential Revision: https://phab.mercurial-scm.org/D9222
mercurial/commands.py
--- a/mercurial/commands.py	Thu Oct 15 22:36:08 2020 -0700
+++ b/mercurial/commands.py	Thu Oct 15 22:36:17 2020 -0700
@@ -6317,9 +6317,8 @@
     Returns 0 on success.
     """
 
+    cmdutil.check_incompatible_arguments(opts, 'stdio', ['cmdserver'])
     opts = pycompat.byteskwargs(opts)
-    if opts[b"stdio"] and opts[b"cmdserver"]:
-        raise error.Abort(_(b"cannot use --stdio with --cmdserver"))
     if opts[b"print_url"] and ui.verbose:
         raise error.Abort(_(b"cannot use --print-url with --verbose"))