comparison hgext/rebase.py @ 43929:08b8bf4a8516

rebase: use cmdutil.check_at_most_one_arg() for -b/-s/-r Differential Revision: https://phab.mercurial-scm.org/D7643
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 12 Dec 2019 22:43:15 -0800
parents 0b769e1cbe89
children 412f199b4092
comparison
equal deleted inserted replaced
43928:0b769e1cbe89 43929:08b8bf4a8516
1023 if action: 1023 if action:
1024 cmdutil.check_incompatible_arguments( 1024 cmdutil.check_incompatible_arguments(
1025 opts, action, b'confirm', b'dry_run' 1025 opts, action, b'confirm', b'dry_run'
1026 ) 1026 )
1027 cmdutil.check_at_most_one_arg(opts, b'confirm', b'dry_run') 1027 cmdutil.check_at_most_one_arg(opts, b'confirm', b'dry_run')
1028 cmdutil.check_at_most_one_arg(opts, b'rev', b'source', b'base')
1028 1029
1029 if action or repo.currenttransaction() is not None: 1030 if action or repo.currenttransaction() is not None:
1030 # in-memory rebase is not compatible with resuming rebases. 1031 # in-memory rebase is not compatible with resuming rebases.
1031 # (Or if it is run within a transaction, since the restart logic can 1032 # (Or if it is run within a transaction, since the restart logic can
1032 # fail the entire transaction.) 1033 # fail the entire transaction.)
1257 if revf is None: 1258 if revf is None:
1258 revf = [] 1259 revf = []
1259 1260
1260 # destspace is here to work around issues with `hg pull --rebase` see 1261 # destspace is here to work around issues with `hg pull --rebase` see
1261 # issue5214 for details 1262 # issue5214 for details
1262 if srcf and basef:
1263 raise error.Abort(_(b'cannot specify both a source and a base'))
1264 if revf and basef:
1265 raise error.Abort(_(b'cannot specify both a revision and a base'))
1266 if revf and srcf:
1267 raise error.Abort(_(b'cannot specify both a revision and a source'))
1268 1263
1269 cmdutil.checkunfinished(repo) 1264 cmdutil.checkunfinished(repo)
1270 if not inmemory: 1265 if not inmemory:
1271 cmdutil.bailifchanged(repo) 1266 cmdutil.bailifchanged(repo)
1272 1267