Show More
@@ -904,7 +904,6 b' def bisect(ui, repo, rev=None, extra=Non' | |||
|
904 | 904 | ('m', 'rename', '', _('rename a given bookmark'), _('OLD')), |
|
905 | 905 | ('i', 'inactive', False, _('mark a bookmark inactive')), |
|
906 | 906 | ('l', 'list', False, _('list existing bookmarks')), |
|
907 | ('', 'active', False, _('display the active bookmark')), | |
|
908 | 907 | ] + formatteropts, |
|
909 | 908 | _('hg bookmarks [OPTIONS]... [NAME]...')) |
|
910 | 909 | def bookmark(ui, repo, *names, **opts): |
@@ -931,10 +930,6 b' def bookmark(ui, repo, *names, **opts):' | |||
|
931 | 930 | A bookmark named '@' has the special property that :hg:`clone` will |
|
932 | 931 | check it out by default if it exists. |
|
933 | 932 | |
|
934 | The '--active' flag will display the current bookmark or return non-zero, | |
|
935 | if combined with other action, they will be performed on the active | |
|
936 | bookmark. | |
|
937 | ||
|
938 | 933 | .. container:: verbose |
|
939 | 934 | |
|
940 | 935 | Examples: |
@@ -958,14 +953,17 b' def bookmark(ui, repo, *names, **opts):' | |||
|
958 | 953 | - move the '@' bookmark from another branch:: |
|
959 | 954 | |
|
960 | 955 | hg book -f @ |
|
956 | ||
|
957 | - print only the active bookmark name:: | |
|
958 | ||
|
959 | hg book -ql . | |
|
961 | 960 | ''' |
|
962 | 961 | opts = pycompat.byteskwargs(opts) |
|
963 | 962 | force = opts.get('force') |
|
964 | 963 | rev = opts.get('rev') |
|
965 | 964 | inactive = opts.get('inactive') # meaning add/rename to inactive bookmark |
|
966 | 965 | |
|
967 |
selactions = [k for k in ['delete', 'rename', ' |
|
|
968 | if opts.get(k)] | |
|
966 | selactions = [k for k in ['delete', 'rename', 'list'] if opts.get(k)] | |
|
969 | 967 | if len(selactions) > 1: |
|
970 | 968 | raise error.Abort(_('--%s and --%s are incompatible') |
|
971 | 969 | % tuple(selactions[:2])) |
@@ -978,11 +976,9 b' def bookmark(ui, repo, *names, **opts):' | |||
|
978 | 976 | else: |
|
979 | 977 | action = 'list' |
|
980 | 978 | |
|
981 |
if rev and action in {'delete', 'rename', ' |
|
|
979 | if rev and action in {'delete', 'rename', 'list'}: | |
|
982 | 980 | raise error.Abort(_("--rev is incompatible with --%s") % action) |
|
983 |
if |
|
|
984 | raise error.Abort(_("NAMES is incompatible with --active")) | |
|
985 | if inactive and action in {'delete', 'active', 'list'}: | |
|
981 | if inactive and action in {'delete', 'list'}: | |
|
986 | 982 | raise error.Abort(_("--inactive is incompatible with --%s") % action) |
|
987 | 983 | if not names and action in {'add', 'delete'}: |
|
988 | 984 | raise error.Abort(_("bookmark name required")) |
@@ -1008,11 +1004,6 b' def bookmark(ui, repo, *names, **opts):' | |||
|
1008 | 1004 | ui.status(_("no active bookmark\n")) |
|
1009 | 1005 | else: |
|
1010 | 1006 | bookmarks.deactivate(repo) |
|
1011 | elif action == 'active': | |
|
1012 | book = repo._activebookmark | |
|
1013 | if book is None: | |
|
1014 | return 1 | |
|
1015 | ui.write("%s\n" % book, label=bookmarks.activebookmarklabel) | |
|
1016 | 1007 | elif action == 'list': |
|
1017 | 1008 | names = pycompat.maplist(repo._bookmarks.expandname, names) |
|
1018 | 1009 | with ui.formatter('bookmarks', opts) as fm: |
@@ -240,8 +240,9 b' display how "{activebookmark}" template ' | |||
|
240 | 240 | - Y |
|
241 | 241 | - |
|
242 | 242 | |
|
243 |
$ hg bookmarks - |
|
|
243 | $ hg bookmarks -ql . | |
|
244 | 244 | Y |
|
245 | 245 | $ hg bookmarks --inactive |
|
246 |
$ hg bookmarks - |
|
|
247 | [1] | |
|
246 | $ hg bookmarks -ql . | |
|
247 | abort: no active bookmark! | |
|
248 | [255] |
@@ -250,7 +250,7 b' Show all commands + options' | |||
|
250 | 250 | archive: no-decode, prefix, rev, type, subrepos, include, exclude |
|
251 | 251 | backout: merge, commit, no-commit, parent, rev, edit, tool, include, exclude, message, logfile, date, user |
|
252 | 252 | bisect: reset, good, bad, skip, extend, command, noupdate |
|
253 |
bookmarks: force, rev, delete, rename, inactive, list, |
|
|
253 | bookmarks: force, rev, delete, rename, inactive, list, template | |
|
254 | 254 | branch: force, clean, rev |
|
255 | 255 | branches: active, closed, template |
|
256 | 256 | bundle: force, rev, branch, base, all, type, ssh, remotecmd, insecure |
General Comments 0
You need to be logged in to leave comments.
Login now