comparison mercurial/commands.py @ 17686:6e4b962600a3

bookmarks: teach the -r option to use revsets
author David Soria Parra <dsp@php.net>
date Mon, 01 Oct 2012 03:19:23 +0200
parents 28c43957f8b4
children 009db477c9fb
comparison
equal deleted inserted replaced
17685:8fcef9614150 17686:6e4b962600a3
831 if ((mark in repo.branchmap() or mark == repo.dirstate.branch()) 831 if ((mark in repo.branchmap() or mark == repo.dirstate.branch())
832 and not force): 832 and not force):
833 raise util.Abort( 833 raise util.Abort(
834 _("a bookmark cannot have the name of an existing branch")) 834 _("a bookmark cannot have the name of an existing branch"))
835 if rev: 835 if rev:
836 marks[mark] = repo.lookup(rev) 836 marks[mark] = scmutil.revsingle(repo, rev).node()
837 else: 837 else:
838 marks[mark] = cur 838 marks[mark] = cur
839 if not inactive and cur == marks[mark]: 839 if not inactive and cur == marks[mark]:
840 bookmarks.setcurrent(repo, mark) 840 bookmarks.setcurrent(repo, mark)
841 bookmarks.write(repo) 841 bookmarks.write(repo)