Mercurial > hg
changeset 10315:be324d31b6c5 stable
commands: label from user is in local encoding
repo.branchtags().keys() are in UTF-8, so the label should be converted to UTF-8
before checking for a naming conflict. Keep the original label for ui.status()
author | Steve Borho <steve@borho.org> |
---|---|
date | Fri, 05 Feb 2010 04:33:08 -0600 |
parents | 7c5eb0988e7a |
children | d117089386e2 192083a3e6fe |
files | mercurial/commands.py |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Mon Feb 01 09:34:35 2010 -0600 +++ b/mercurial/commands.py Fri Feb 05 04:33:08 2010 -0600 @@ -426,11 +426,12 @@ repo.dirstate.setbranch(label) ui.status(_('reset working directory to branch %s\n') % label) elif label: - if not opts.get('force') and label in repo.branchtags(): + utflabel = encoding.fromlocal(label) + if not opts.get('force') and utflabel in repo.branchtags(): if label not in [p.branch() for p in repo.parents()]: raise util.Abort(_('a branch of the same name already exists' ' (use --force to override)')) - repo.dirstate.setbranch(encoding.fromlocal(label)) + repo.dirstate.setbranch(utflabel) ui.status(_('marked working directory as branch %s\n') % label) else: ui.write("%s\n" % encoding.tolocal(repo.dirstate.branch()))