Merge on push?

Roman Kennke roman.kennke at aicas.com
Mon Jun 9 03:28:16 CDT 2008


Hi Giorgios,

> > I'd like to propose an extension to the push command. I imagine an
> > option --merge and maybe a configuration option for use in ~/.hgrc
> > which makes push try a merge on the remote side if necessary. hg push
> > --merge would then try to perform a non-interactive merge and commit
> > on the remote repository, when the push would create an additional
> > head. This should fail when the changes touch files that have been
> > touched by other changesets since their 'branch-point'. This is more
> > or less the behaviour of more traditional RCSes. I know, there is a
> > chance that this results in a broken tree even when there are no
> > overlapping changes, but experience with more traditional RCSes (CVS
> > and Subversion, maybe other DRCSes, dunno about them) shows that such
> > cases are very rare in a reasonable structured project.
> 
> Broken trees are *far* more annoying than "you need to merge" warnings,
> and I don't see how `hg push --merge' can do anything sensible about
> conflicts :-(

It can't. When there is a conflict, i.e. somebody else touched the same
files as I did and non-interactive merge is not possible, then it should
simply fail and tell me to merge manually. My point is that HG requires
merging, even if I push changes that are completely disjoint of other
changes, that have been pushed to the remote repository in the meantime,
which is quite frequent. It is really difficult to explain that to
anybody. Sure, a broken tree is possible even when only disjoint changes
are merged, but in order to avoid this, you would have to pull, merge
locally, build and test the whole thing, which, in my case, would take a
very long time, during which I'm pretty sure somebody else has pushed
something in between. So, my only solution is to fetch and try again,
without building and testing, I leave that to an automatic builder and
tester.

Cheers, Roman

-- 
Dipl.-Inform. (FH) Roman Kennke, Software Engineer, http://kennke.org
aicas Allerton Interworks Computer Automated Systems GmbH
Haid-und-Neu-Straße 18 * D-76131 Karlsruhe * Germany
http://www.aicas.com   * Tel: +49-721-663 968-0
USt-Id: DE216375633, Handelsregister HRB 109481, AG Karlsruhe
Geschäftsführer: Dr. James J. Hunt




More information about the Mercurial mailing list