equal
deleted
inserted
replaced
607 ui.status(_('reset working directory to branch %s\n') % label) |
607 ui.status(_('reset working directory to branch %s\n') % label) |
608 elif label: |
608 elif label: |
609 if not opts.get('force') and label in repo.branchtags(): |
609 if not opts.get('force') and label in repo.branchtags(): |
610 if label not in [p.branch() for p in repo.parents()]: |
610 if label not in [p.branch() for p in repo.parents()]: |
611 raise util.Abort(_('a branch of the same name already exists'), |
611 raise util.Abort(_('a branch of the same name already exists'), |
|
612 # i18n: "it" refers to an existing branch |
612 hint=_("use 'hg update' to switch to it")) |
613 hint=_("use 'hg update' to switch to it")) |
613 repo.dirstate.setbranch(label) |
614 repo.dirstate.setbranch(label) |
614 ui.status(_('marked working directory as branch %s\n') % label) |
615 ui.status(_('marked working directory as branch %s\n') % label) |
615 else: |
616 else: |
616 ui.write("%s\n" % repo.dirstate.branch()) |
617 ui.write("%s\n" % repo.dirstate.branch()) |