closing named branches

Tony Mechelynck antoine.mechelynck at gmail.com
Sun Dec 30 01:17:42 UTC 2012


On 30/12/12 02:11, Tony Mechelynck wrote:
> On 29/12/12 08:32, Christian Widmer wrote:
>> i am a bit confused
>>
>> i have a named feature branch 'foo' which i want to merge into the
>> 'default' branch (merges are asymmetric) . i want to stay on 'default'
>> and the 'foo' branches should be closed.
>>
>> a) to stay on default i have to update to 'default' then merge 'foo' and
>> commit. if i use --close-branch on the final commit i will close
>> 'default'. not really the way to go
>>
>> b) thus i have to stay on 'foo' and merge 'default' and use
>> --close-branch on the final commit. thus 'foo' gets closed but now i
>> actually have merged in 'default' into 'foo'. i am on a closed branch. i
>> would have to update to default first.
>>
>> am i wrong to say that what it try to accomplish is an exotic use case
>> or is there another/better way to do this with named branches?
>>
>> thanks
>
> When merging, you can specify a merge tool. By default, Mercurial will
> try to import changes from both parents, and call you to the rescue if
> they are incompatible; but there are others, see hg help merge-tools
>
> hg merge --tool internal:local -r rev1 -r rev2
>      always use the "local" version of the files (the version on rev1
> IIUC) as the merged version.
>
> hg merge --tool internal:other -r rev1 -r rev2
>      always use the "other" version (the version on rev2 IIUC).
>
> Neither of these "tools" can fail, of course. They are just ways to
> close one or the other of the parent heads by "pretending" to merge it
> with the other one.
>
>
> Best regards,
> Tony.
Oops, only one revision.

hg merge --tool internal:local -r revision
	always use the version in the current changeset, disregarding that on 
"revision" (which will still be listed as an ancestor of the merge).

hg merge --tool internal:other -r revision
	always use the version on "revision", but keep the merge as a child of 
the current changeset on the same branch.


Best regards,
Tony.
-- 
"They're unfriendly, which is fortunate, really.  They'd be difficult
to like."
		-- Avon




More information about the Mercurial mailing list