# HG changeset patch # User Yuya Nishihara # Date 1263304150 -32400 # Node ID 7648f32713f2d615bb79155b5b2c79a60a94ea17 # Parent 47f9868d8dcfe623a2f30bd3d114ba39991bfd07 branch: help misuse of hg branch to switch branches Maybe beginners tend to use 'hg branch EXISTING_BRANCH' instead of 'hg update EXISTING_BRANCH' as me. If so, let's help them to use 'update'. Also removed '(use --force to override)' because it can mislead them. diff -r 47f9868d8dcf -r 7648f32713f2 mercurial/commands.py --- a/mercurial/commands.py Sat Mar 06 21:29:02 2010 -0800 +++ b/mercurial/commands.py Tue Jan 12 22:49:10 2010 +0900 @@ -451,7 +451,7 @@ 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)')) + " (use 'hg update' to switch to it)")) repo.dirstate.setbranch(utflabel) ui.status(_('marked working directory as branch %s\n') % label) else: diff -r 47f9868d8dcf -r 7648f32713f2 tests/test-newbranch.out --- a/tests/test-newbranch.out Sat Mar 06 21:29:02 2010 -0800 +++ b/tests/test-newbranch.out Tue Jan 12 22:49:10 2010 +0900 @@ -2,7 +2,7 @@ foo marked working directory as branch bar % branch shadowing -abort: a branch of the same name already exists (use --force to override) +abort: a branch of the same name already exists (use 'hg update' to switch to it) marked working directory as branch default % there should be only one default branch head changeset: 3:bf1bc2f45e83