comparison mercurial/commands.py @ 43902:e623ad1b4800

bookmarks: use check_incompatible_arguments() for inactive+action Differential Revision: https://phab.mercurial-scm.org/D7662
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 13 Dec 2019 14:31:51 -0800
parents 5cde16489b42
children 6b6872822b32
comparison
equal deleted inserted replaced
43901:5cde16489b42 43902:e623ad1b4800
1234 elif inactive: 1234 elif inactive:
1235 action = b'inactive' # meaning deactivate 1235 action = b'inactive' # meaning deactivate
1236 else: 1236 else:
1237 action = b'list' 1237 action = b'list'
1238 1238
1239 if inactive and action in {b'delete', b'list'}: 1239 cmdutil.check_incompatible_arguments(opts, b'inactive', b'delete', b'list')
1240 raise error.Abort(_(b"--inactive is incompatible with --%s") % action)
1241 if not names and action in {b'add', b'delete'}: 1240 if not names and action in {b'add', b'delete'}:
1242 raise error.Abort(_(b"bookmark name required")) 1241 raise error.Abort(_(b"bookmark name required"))
1243 1242
1244 if action in {b'add', b'delete', b'rename', b'inactive'}: 1243 if action in {b'add', b'delete', b'rename', b'inactive'}:
1245 with repo.wlock(), repo.lock(), repo.transaction(b'bookmark') as tr: 1244 with repo.wlock(), repo.lock(), repo.transaction(b'bookmark') as tr: