# HG changeset patch # User Martin von Zweigbergk # Date 1576275134 28800 # Node ID d50b4ad1d4a5d08fe8065dfb9d23bac4609f9b0d # Parent e623ad1b4800e7c10e3fc3541a816c5a6b410691 transplant: use check_incompatible_arguments() Differential Revision: https://phab.mercurial-scm.org/D7663 diff -r e623ad1b4800 -r d50b4ad1d4a5 hgext/transplant.py --- a/hgext/transplant.py Fri Dec 13 14:31:51 2019 -0800 +++ b/hgext/transplant.py Fri Dec 13 14:12:14 2019 -0800 @@ -760,22 +760,14 @@ def checkopts(opts, revs): if opts.get(b'continue'): - if opts.get(b'branch') or opts.get(b'all') or opts.get(b'merge'): - raise error.Abort( - _( - b'--continue is incompatible with ' - b'--branch, --all and --merge' - ) - ) + cmdutil.check_incompatible_arguments( + opts, b'continue', b'branch', b'all', b'merge' + ) return if opts.get(b'stop'): - if opts.get(b'branch') or opts.get(b'all') or opts.get(b'merge'): - raise error.Abort( - _( - b'--stop is incompatible with ' - b'--branch, --all and --merge' - ) - ) + cmdutil.check_incompatible_arguments( + opts, b'stop', b'branch', b'all', b'merge' + ) return if not ( opts.get(b'source') diff -r e623ad1b4800 -r d50b4ad1d4a5 tests/test-transplant.t --- a/tests/test-transplant.t Fri Dec 13 14:31:51 2019 -0800 +++ b/tests/test-transplant.t Fri Dec 13 14:12:14 2019 -0800 @@ -18,10 +18,10 @@ abort: no source URL, branch revision, or revision list provided [255] $ hg transplant --continue --all - abort: --continue is incompatible with --branch, --all and --merge + abort: cannot specify both --continue and --all [255] $ hg transplant --stop --all - abort: --stop is incompatible with --branch, --all and --merge + abort: cannot specify both --stop and --all [255] $ hg transplant --all tip abort: --all requires a branch revision