diff mercurial/commands.py @ 44438:1e508097f570

update: simplify slightly Differential Revision: https://phab.mercurial-scm.org/D8204
author Valentin Gatien-Baron <vgatien-baron@janestreet.com>
date Mon, 02 Mar 2020 15:34:51 -0500
parents ddbc296a1f48
children 2f290136b7d6
line wrap: on
line diff
--- a/mercurial/commands.py	Sun Mar 01 21:16:45 2020 -0500
+++ b/mercurial/commands.py	Mon Mar 02 15:34:51 2020 -0500
@@ -7665,6 +7665,7 @@
 
     Returns 0 on success, 1 if there are unresolved files.
     """
+    cmdutil.check_at_most_one_arg(opts, b'clean', b'check', b'merge')
     rev = opts.get('rev')
     date = opts.get('date')
     clean = opts.get('clean')
@@ -7686,14 +7687,6 @@
     if date and rev is not None:
         raise error.Abort(_(b"you can't specify a revision and a date"))
 
-    if len([x for x in (clean, check, merge) if x]) > 1:
-        raise error.Abort(
-            _(
-                b"can only specify one of -C/--clean, -c/--check, "
-                b"or -m/--merge"
-            )
-        )
-
     updatecheck = None
     if check:
         updatecheck = b'abort'