mercurial/commands.py
branchstable
changeset 10596 7648f32713f2
parent 10579 f142fa3c0a8c
child 10611 e764f24a45ee
child 10616 65b178f30eae
equal deleted inserted replaced
10595:47f9868d8dcf 10596:7648f32713f2
   449     elif label:
   449     elif label:
   450         utflabel = encoding.fromlocal(label)
   450         utflabel = encoding.fromlocal(label)
   451         if not opts.get('force') and utflabel in repo.branchtags():
   451         if not opts.get('force') and utflabel in repo.branchtags():
   452             if label not in [p.branch() for p in repo.parents()]:
   452             if label not in [p.branch() for p in repo.parents()]:
   453                 raise util.Abort(_('a branch of the same name already exists'
   453                 raise util.Abort(_('a branch of the same name already exists'
   454                                    ' (use --force to override)'))
   454                                    " (use 'hg update' to switch to it)"))
   455         repo.dirstate.setbranch(utflabel)
   455         repo.dirstate.setbranch(utflabel)
   456         ui.status(_('marked working directory as branch %s\n') % label)
   456         ui.status(_('marked working directory as branch %s\n') % label)
   457     else:
   457     else:
   458         ui.write("%s\n" % encoding.tolocal(repo.dirstate.branch()))
   458         ui.write("%s\n" % encoding.tolocal(repo.dirstate.branch()))
   459 
   459