comparison mercurial/commands.py @ 39752:2d478b05fb14

bookmarks: reject --delete with --inactive which makes no sense A deleted bookmark is neither active nor inactive.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 15 Sep 2018 12:34:13 +0900
parents 5dfc0ca02aa0
children b05b4b91de3d
comparison
equal deleted inserted replaced
39751:5dfc0ca02aa0 39752:2d478b05fb14
978 978
979 if rev and action in {'delete', 'rename', 'active'}: 979 if rev and action in {'delete', 'rename', 'active'}:
980 raise error.Abort(_("--rev is incompatible with --%s") % action) 980 raise error.Abort(_("--rev is incompatible with --%s") % action)
981 if names and action == 'active': 981 if names and action == 'active':
982 raise error.Abort(_("NAMES is incompatible with --active")) 982 raise error.Abort(_("NAMES is incompatible with --active"))
983 if inactive and action == 'active': 983 if inactive and action in {'delete', 'active'}:
984 raise error.Abort(_("--inactive is incompatible with --active")) 984 raise error.Abort(_("--inactive is incompatible with --%s") % action)
985 if not names and action in {'add', 'delete'}: 985 if not names and action in {'add', 'delete'}:
986 raise error.Abort(_("bookmark name required")) 986 raise error.Abort(_("bookmark name required"))
987 987
988 if action in {'add', 'delete', 'rename', 'inactive'}: 988 if action in {'add', 'delete', 'rename', 'inactive'}:
989 with repo.wlock(), repo.lock(), repo.transaction('bookmark') as tr: 989 with repo.wlock(), repo.lock(), repo.transaction('bookmark') as tr: