comparison mercurial/commands.py @ 33931:5cd6d4826f9f

bookmarks: allow deleting active bookmark using '.'
author David Demelier <markand@malikania.fr>
date Thu, 24 Aug 2017 09:23:06 +0200
parents 10f1809ab98f
children 8abbae93045a
comparison
equal deleted inserted replaced
33930:e278d6d2d7d2 33931:5cd6d4826f9f
915 Bookmarks can be pushed and pulled between repositories (see 915 Bookmarks can be pushed and pulled between repositories (see
916 :hg:`help push` and :hg:`help pull`). If a shared bookmark has 916 :hg:`help push` and :hg:`help pull`). If a shared bookmark has
917 diverged, a new 'divergent bookmark' of the form 'name@path' will 917 diverged, a new 'divergent bookmark' of the form 'name@path' will
918 be created. Using :hg:`merge` will resolve the divergence. 918 be created. Using :hg:`merge` will resolve the divergence.
919 919
920 Specifying bookmark as '.' to -m or -d options is equivalent to specifying
921 the active bookmark's name.
922
920 A bookmark named '@' has the special property that :hg:`clone` will 923 A bookmark named '@' has the special property that :hg:`clone` will
921 check it out by default if it exists. 924 check it out by default if it exists.
922 925
923 .. container:: verbose 926 .. container:: verbose
924 927
960 raise error.Abort(_("bookmark name required")) 963 raise error.Abort(_("bookmark name required"))
961 964
962 if delete or rename or names or inactive: 965 if delete or rename or names or inactive:
963 with repo.wlock(), repo.lock(), repo.transaction('bookmark') as tr: 966 with repo.wlock(), repo.lock(), repo.transaction('bookmark') as tr:
964 if delete: 967 if delete:
968 names = pycompat.maplist(repo._bookmarks.expandname, names)
965 bookmarks.delete(repo, tr, names) 969 bookmarks.delete(repo, tr, names)
966 elif rename: 970 elif rename:
967 if not names: 971 if not names:
968 raise error.Abort(_("new bookmark name required")) 972 raise error.Abort(_("new bookmark name required"))
969 elif len(names) > 1: 973 elif len(names) > 1: