# HG changeset patch # User Valentin Gatien-Baron # Date 1583181291 18000 # Node ID 1e508097f5706272904f41c894836eaa72113af2 # Parent c85d5fd1a5d9a7ab8c24444219155bf83c2cdc79 update: simplify slightly Differential Revision: https://phab.mercurial-scm.org/D8204 diff -r c85d5fd1a5d9 -r 1e508097f570 mercurial/commands.py --- 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' diff -r c85d5fd1a5d9 -r 1e508097f570 tests/test-update-branches.t --- a/tests/test-update-branches.t Sun Mar 01 21:16:45 2020 -0500 +++ b/tests/test-update-branches.t Mon Mar 02 15:34:51 2020 -0500 @@ -189,17 +189,17 @@ parent=2 $ revtest '-cC dirty linear' dirty 1 2 -cC - abort: can only specify one of -C/--clean, -c/--check, or -m/--merge + abort: cannot specify both --clean and --check parent=1 M foo $ revtest '-mc dirty linear' dirty 1 2 -mc - abort: can only specify one of -C/--clean, -c/--check, or -m/--merge + abort: cannot specify both --check and --merge parent=1 M foo $ revtest '-mC dirty linear' dirty 1 2 -mC - abort: can only specify one of -C/--clean, -c/--check, or -m/--merge + abort: cannot specify both --clean and --merge parent=1 M foo