# HG changeset patch # User Steve Borho # Date 1265375273 21600 # Node ID d117089386e220a8ae646834844e3efc39d70fcf # Parent d9aa5b368e36c10d2c29411772fef9fd339c2e9f# Parent be324d31b6c5a3df315ae596c4da136b4122b739 Merge with stable diff -r d9aa5b368e36 -r d117089386e2 mercurial/commands.py --- a/mercurial/commands.py Tue Feb 02 09:13:59 2010 +0100 +++ b/mercurial/commands.py Fri Feb 05 07:07:53 2010 -0600 @@ -429,11 +429,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()))