Another oddity about named branches

0000 vk 0000.vk at gmail.com
Sun May 24 09:45:20 CDT 2009


On Sun, May 24, 2009 at 1:06 AM, Alpár Jüttner <alpar at cs.elte.hu> wrote:
> Hi,
>
> In general, 'hg st' should report the changes that next 'hg commit' will
> put into the chgset. For example
>
> $ hg st
> M f.txt
> $ hg ci -m X   # will commit f.txt
> $
>
> but
>
> $ hg ci -m X
> $ hg st
> $ hg ci -m X
> nothing changed
> $
>
> However it is not the case when a new named branch has been created:
>
> $ hg branch my-branch
> marked working directory as branch my-branch
> $ hg st         #reports nothing

that's because at this point you have only set the working directory
branch name, which is not associated with any files. hence hg st
reports nothing.

> $ hg ci -m X    #creates a new chgset

this is the creation of the branch proper. from hg help branch:
" the branch does not exist in the repository until the next commit"

> $ hg st         #reports nothing
> $ hg ci -m X    #commits nothing
> nothing changed

these need no explanation.

> I think this is quite misleading.

a little, but it also seems overkill to have a command tell you that
you created a branch name but haven't yet committed it.

-vk



More information about the Mercurial mailing list