mercurial/commands.py
changeset 16719 e7bf09acd410
parent 16715 1e24da6fcd67
child 16720 e825a89de5d7
--- a/mercurial/commands.py	Sun May 13 16:39:40 2012 +0200
+++ b/mercurial/commands.py	Sun May 13 14:04:04 2012 +0200
@@ -827,7 +827,7 @@
         if mark in marks and not force:
             raise util.Abort(_("bookmark '%s' already exists "
                                "(use -f to force)") % mark)
-        if ((mark in repo.branchtags() or mark == repo.dirstate.branch())
+        if ((mark in repo.branchmap() or mark == repo.dirstate.branch())
             and not force):
             raise util.Abort(
                 _("a bookmark cannot have the name of an existing branch"))
@@ -903,7 +903,7 @@
             repo.dirstate.setbranch(label)
             ui.status(_('reset working directory to branch %s\n') % label)
         elif label:
-            if not opts.get('force') and label in repo.branchtags():
+            if not opts.get('force') and label in repo.branchmap():
                 if label not in [p.branch() for p in repo.parents()]:
                     raise util.Abort(_('a branch of the same name already'
                                        ' exists'),