equal
deleted
inserted
replaced
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 |