[PATCH 0 of 1 ] Inconsistent behaviour with subrepos and named branches

Friedrich Kastner-Masilko kastner_masilko at at.festo.com
Wed Feb 29 08:27:31 CST 2012


Hy there,

I think I've found a minor problem in subrepos.

In a Mercurial repository, if you update to a changeset X that is an ancestor of a changeset Y, and you issue "hg merge Y", it depends on the named branch you are on if the merge actually happens or is aborted with the message "nothing to merge". Same branch == abort, different branch == merge. The other way around (update to Y, merge attempt with X), it is always aborting with something like "can't merge with ancestor".

Now I don't want to discuss if this is clever or not (given that it breaks the merge symmetry), it simply is the current (2.1) behaviour. But if you have the same situation in a subrepo-merge, it is different now. If you merge a super-repository with equivalent .hgsubstate pointers to a subrepo, the subrepo.py mergefunc() function explicitly updates the subrepo to Y, even if X and Y are on different named branches.

IMHO, this is inconsistent behaviour. The following patch attempts to fix this.

regards,
Fritz


More information about the Mercurial-devel mailing list