comparison mercurial/commands.py @ 14189:328422b0380d

bookmarks: allow deactivating current bookmark with -i
author Kevin Bullock <kbullock@ringworld.org>
date Wed, 04 May 2011 10:43:47 -0500
parents 9029b1a38c30
children c124341c4cea
comparison
equal deleted inserted replaced
14188:9029b1a38c30 14189:328422b0380d
537 raise util.Abort(_("bookmark name cannot contain newlines")) 537 raise util.Abort(_("bookmark name cannot contain newlines"))
538 mark = mark.strip() 538 mark = mark.strip()
539 if not mark: 539 if not mark:
540 raise util.Abort(_("bookmark names cannot consist entirely of " 540 raise util.Abort(_("bookmark names cannot consist entirely of "
541 "whitespace")) 541 "whitespace"))
542 if inactive and mark == repo._bookmarkcurrent:
543 bookmarks.setcurrent(repo, None)
544 return
542 if mark in marks and not force: 545 if mark in marks and not force:
543 raise util.Abort(_("bookmark '%s' already exists " 546 raise util.Abort(_("bookmark '%s' already exists "
544 "(use -f to force)") % mark) 547 "(use -f to force)") % mark)
545 if ((mark in repo.branchtags() or mark == repo.dirstate.branch()) 548 if ((mark in repo.branchtags() or mark == repo.dirstate.branch())
546 and not force): 549 and not force):