Questions about branching in Mercurial

Marcin Kasperski Marcin.Kasperski at softax.com.pl
Sun May 6 11:17:19 CDT 2007


> I think you misunderstood something. Here are the 2 key points:
>  - hg branch *don't* create a branch ! It only give a name to the current
>    branch.
>  - the only way to create a real branch (named or not) is to commit
>    over an older (non-tip) revision. As long as you commit (or push)
>    over tip, you can't create a branch.
>
> In your original example, you just had a single branch with 2 names
> (default and dev).
>   
Well, one can reasonably expect that if hi is using non-default branch, 
then the changes he makes
do not apply to default branch (I use term 'branch' in general terms, 
not those specific to mercurial).
According to the description above, it seems mercurial 'branch' is 
almost alias to 'tag'.

Hard to say which command should work differently (maybe not 'branch', 
but 'merge'), but it is
natural to expect that if I create branch (in version control terms), 
make and commit some changes,
then revert to the main branch and ask for merge, then all the changes 
made on branch are put into default.
Even if internally it means just moving 'default' mark to another 
changeset without true merge.



More information about the Mercurial mailing list