[PATCH 0 of 9] improvements for named branches

Patrick Mézard pmezard at gmail.com
Wed Mar 5 08:42:36 UTC 2008


Paul Franz a écrit :
> 
> 
> Patrick Mézard wrote:
>> Paul Franz a écrit :
>>  
>>> I am not sure how a branch can have multiple heads.
>>>     
>>
>> Here is a repository made of a single named branch "foo" with 2 heads.
>> You can obviously plug this named branch in any existing repository :
>>
>> $ hg init t
>> $ cd t
>> $ hg branch foo
>> marked working directory as branch foo
>> $ echo a > a
>> $ hg ci -Am adda
>> adding a
>> $ echo b > b
>> $ hg ci -Am addb
>> adding b
>> $ hg up -C 0
>> 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
>> $ echo c > c
>> $ hg ci -Am addc
>> adding c
>>   
> What is the use case where this should be valid? In my mind this should
> force you to merge changes into the head of the branch. But that is
> probably just my previous version control experience speaking. Could
> somebody give a reason that this is allowed?

Well, you can already have multiple heads *without* named branches, and there was no compelling reason to disallow them with named branches. Besides, you have to tolerate "named branches" sub-branches to allow several people to work on the same named branch, even if you may prevent them from pushing additional named branches heads in a reference repository.

--
Patrick Mézard



More information about the Mercurial-devel mailing list