closing named branches
Tony Mechelynck
antoine.mechelynck at gmail.com
Sun Dec 30 01:11:48 UTC 2012
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.
--
There are three ways to get something done:
(1) Do it yourself.
(2) Hire someone to do it for you.
(3) Forbid your kids to do it.
More information about the Mercurial
mailing list