[PATCH] branch: help misuse of hg branch to switch to an existing branch

Martin Geisler mg at lazybytes.net
Tue Jan 12 02:37:52 CST 2010


Yuya Nishihara <yuya at tcha.org> writes:

>> branch: help misuse of hg branch to switch to an existing branch
>> 
>> Maybe beginners tend to use 'hg branch EXISTING_BRANCH' instead of
>> 'hg update EXISTING_BRANCH' as me.
>> If so, let's lead them to the correct place.
>
> The output is something like the following:
>
> $ LANG=C hg branch default
> abort: a branch of the same name already exists (use --force to override) (or use 'hg update' to switch to an existing branch)
>
>
> 1, Here I want to insert a line break, but is it okay to pass multi-line
>    string to util.Abort?

It is nicest if we can keep it to a single line. I'm not a fan of all
this manual formatting since it is cumbersome to maintain by the
translators and it breaks anyway with different terminal widths.

> 2. Is `(use --force to override)' needed? It seems dangerous for normal
>    users. And advanced users can recognize the error message, then
>    they will check `hg help branch'.

I agree with you -- it is bad style for us to advertice the --force
option here and elsewhere. People should read 'hg help foo' and then
decide to use 'hg foo --force' if that is really what they want.

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.


More information about the Mercurial-devel mailing list