Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 10316:d117089386e2
Merge with stable
author | Steve Borho <steve@borho.org> |
---|---|
date | Fri, 05 Feb 2010 07:07:53 -0600 |
parents | 08a0f04b56bd be324d31b6c5 |
children | 8b90e2966219 |
comparison
equal
deleted
inserted
replaced
10314:d9aa5b368e36 | 10316:d117089386e2 |
---|---|
427 if opts.get('clean'): | 427 if opts.get('clean'): |
428 label = repo[None].parents()[0].branch() | 428 label = repo[None].parents()[0].branch() |
429 repo.dirstate.setbranch(label) | 429 repo.dirstate.setbranch(label) |
430 ui.status(_('reset working directory to branch %s\n') % label) | 430 ui.status(_('reset working directory to branch %s\n') % label) |
431 elif label: | 431 elif label: |
432 if not opts.get('force') and label in repo.branchtags(): | 432 utflabel = encoding.fromlocal(label) |
433 if not opts.get('force') and utflabel in repo.branchtags(): | |
433 if label not in [p.branch() for p in repo.parents()]: | 434 if label not in [p.branch() for p in repo.parents()]: |
434 raise util.Abort(_('a branch of the same name already exists' | 435 raise util.Abort(_('a branch of the same name already exists' |
435 ' (use --force to override)')) | 436 ' (use --force to override)')) |
436 repo.dirstate.setbranch(encoding.fromlocal(label)) | 437 repo.dirstate.setbranch(utflabel) |
437 ui.status(_('marked working directory as branch %s\n') % label) | 438 ui.status(_('marked working directory as branch %s\n') % label) |
438 else: | 439 else: |
439 ui.write("%s\n" % encoding.tolocal(repo.dirstate.branch())) | 440 ui.write("%s\n" % encoding.tolocal(repo.dirstate.branch())) |
440 | 441 |
441 def branches(ui, repo, active=False, closed=False): | 442 def branches(ui, repo, active=False, closed=False): |