mercurial/commands.py
changeset 32451 bce5ebe72859
parent 32431 9fd9f91b0c43
child 32482 579df5aaa425
equal deleted inserted replaced
32450:548478efc46c 32451:bce5ebe72859
   966                                "(use -f to force)") % mark)
   966                                "(use -f to force)") % mark)
   967         if ((mark in repo.branchmap() or mark == repo.dirstate.branch())
   967         if ((mark in repo.branchmap() or mark == repo.dirstate.branch())
   968             and not force):
   968             and not force):
   969             raise error.Abort(
   969             raise error.Abort(
   970                 _("a bookmark cannot have the name of an existing branch"))
   970                 _("a bookmark cannot have the name of an existing branch"))
       
   971         if len(mark) > 3 and mark in repo and not force:
       
   972             repo.ui.warn(
       
   973                 _("bookmark %s matches a changeset hash\n"
       
   974                   "(did you leave a -r out of an 'hg bookmark' command?)\n") %
       
   975                 mark)
   971 
   976 
   972     if delete and rename:
   977     if delete and rename:
   973         raise error.Abort(_("--delete and --rename are incompatible"))
   978         raise error.Abort(_("--delete and --rename are incompatible"))
   974     if delete and rev:
   979     if delete and rev:
   975         raise error.Abort(_("--rev is incompatible with --delete"))
   980         raise error.Abort(_("--rev is incompatible with --delete"))