Questions about branching in Mercurial

Aurelien Jacobs aurel at gnuage.org
Sun May 6 16:01:13 UTC 2007


On Sun, 6 May 2007 14:00:07 +0200 (CEST)
Guido Ostkamp <hg at ostkamp.fastmail.fm> wrote:

> > They've still got a couple rough edges that should be polished up in the 
> > next couple months, but I think they're perfectly useful today provided 
> > you understand how they work.
> 
> In the 'git' User Manual I've found this:
> 
> "Normally a merge results in a merge commit, with two parents, one 
> pointing at each of the two lines of development that were merged.
> 
> However, if one of the two lines of development is completely contained 
> within the other -- so every commit present in the one is already 
> contained in the other -- then git just performs a fast forward; the head 
> of the current branch is moved forward to point at the head of the 
> merged-in branch, without any new commits being created."
> 
> I think this is exactly what is missing in Mercurial as of now. I would 
> appreciate if you could add it.

Indeed, in Mercurial, when you have a single branch with 2 branch name,
merge won't do anything. And with the current example, I guess that
what you expect about merge is that it does a `hg branch default`
(to bring the default name at tip).
But I'm not sure if it would be a good idea (nor even if it's possible)
that hg merge does this automaticaly.

Aurel



More information about the Mercurial mailing list