Changeset View
Changeset View
Standalone View
Standalone View
mercurial/commands.py
Show First 20 Lines • Show All 1230 Lines • ▼ Show 20 Line(s) | if action: | ||||
cmdutil.check_incompatible_arguments(opts, action, b'rev') | cmdutil.check_incompatible_arguments(opts, action, b'rev') | ||||
elif names or rev: | elif names or rev: | ||||
action = b'add' | action = b'add' | ||||
elif inactive: | elif inactive: | ||||
action = b'inactive' # meaning deactivate | action = b'inactive' # meaning deactivate | ||||
else: | else: | ||||
action = b'list' | action = b'list' | ||||
if inactive and action in {b'delete', b'list'}: | cmdutil.check_incompatible_arguments(opts, b'inactive', b'delete', b'list') | ||||
raise error.Abort(_(b"--inactive is incompatible with --%s") % action) | |||||
if not names and action in {b'add', b'delete'}: | if not names and action in {b'add', b'delete'}: | ||||
raise error.Abort(_(b"bookmark name required")) | raise error.Abort(_(b"bookmark name required")) | ||||
if action in {b'add', b'delete', b'rename', b'inactive'}: | if action in {b'add', b'delete', b'rename', b'inactive'}: | ||||
with repo.wlock(), repo.lock(), repo.transaction(b'bookmark') as tr: | with repo.wlock(), repo.lock(), repo.transaction(b'bookmark') as tr: | ||||
if action == b'delete': | if action == b'delete': | ||||
names = pycompat.maplist(repo._bookmarks.expandname, names) | names = pycompat.maplist(repo._bookmarks.expandname, names) | ||||
bookmarks.delete(repo, tr, names) | bookmarks.delete(repo, tr, names) | ||||
▲ Show 20 Lines • Show All 6575 Lines • Show Last 20 Lines |