mercurial/commands.py
branchstable
changeset 17984 b74361cf7c0a
parent 17981 e689b0d91546
child 17986 e853d27956fb
child 18122 730b769fb634
equal deleted inserted replaced
17981:e689b0d91546 17984:b74361cf7c0a
   922                 if label not in [p.branch() for p in repo.parents()]:
   922                 if label not in [p.branch() for p in repo.parents()]:
   923                     raise util.Abort(_('a branch of the same name already'
   923                     raise util.Abort(_('a branch of the same name already'
   924                                        ' exists'),
   924                                        ' exists'),
   925                                      # i18n: "it" refers to an existing branch
   925                                      # i18n: "it" refers to an existing branch
   926                                      hint=_("use 'hg update' to switch to it"))
   926                                      hint=_("use 'hg update' to switch to it"))
       
   927             scmutil.checknewlabel(None, label, 'branch')
   927             repo.dirstate.setbranch(label)
   928             repo.dirstate.setbranch(label)
   928             ui.status(_('marked working directory as branch %s\n') % label)
   929             ui.status(_('marked working directory as branch %s\n') % label)
   929             ui.status(_('(branches are permanent and global, '
   930             ui.status(_('(branches are permanent and global, '
   930                         'did you want a bookmark?)\n'))
   931                         'did you want a bookmark?)\n'))
   931     finally:
   932     finally: