Show More
@@ -426,11 +426,12 b' def branch(ui, repo, label=None, **opts)' | |||||
426 | repo.dirstate.setbranch(label) |
|
426 | repo.dirstate.setbranch(label) | |
427 | ui.status(_('reset working directory to branch %s\n') % label) |
|
427 | ui.status(_('reset working directory to branch %s\n') % label) | |
428 | elif label: |
|
428 | elif label: | |
429 | if not opts.get('force') and label in repo.branchtags(): |
|
429 | utflabel = encoding.fromlocal(label) | |
|
430 | if not opts.get('force') and utflabel in repo.branchtags(): | |||
430 | if label not in [p.branch() for p in repo.parents()]: |
|
431 | if label not in [p.branch() for p in repo.parents()]: | |
431 | raise util.Abort(_('a branch of the same name already exists' |
|
432 | raise util.Abort(_('a branch of the same name already exists' | |
432 | ' (use --force to override)')) |
|
433 | ' (use --force to override)')) | |
433 |
repo.dirstate.setbranch( |
|
434 | repo.dirstate.setbranch(utflabel) | |
434 | ui.status(_('marked working directory as branch %s\n') % label) |
|
435 | ui.status(_('marked working directory as branch %s\n') % label) | |
435 | else: |
|
436 | else: | |
436 | ui.write("%s\n" % encoding.tolocal(repo.dirstate.branch())) |
|
437 | ui.write("%s\n" % encoding.tolocal(repo.dirstate.branch())) |
General Comments 0
You need to be logged in to leave comments.
Login now