Merge on push?

Roman Kennke roman.kennke at aicas.com
Mon Jun 9 08:46:32 CDT 2008


Hi Martin,

> >>   svn update; svn commit
> >>
> >> With Mercurial this becomes
> >>
> >>   hg fetch; hg push
> >>
> >> On the other hand, if you know that no merging is necessary, then
> >> the commands are simply
> >>
> >>   svn commit
> >>
> >> or
> >>
> >>   hg push
> >
> > No, I disagree. In Mercurial you have to pull before pushing, even
> > when there is no merging necessary, at least not in the sense of
> > like it is in Subversion. In Mercurial, merging is necessary exactly
> > when anybody else pushed after you pulled last time.
> 
> Yes, this is exactly the same with Subversion -- you cannot do a
> commit unless you have an up-to-date SVN checkout. With SVN you must
> do a 'svn update' to bring your checkout up-to-date, and this actually
> does a merge for you.

Aha, interesting. Haven't used Subversion enough to know that. I was
assuming that it behaves more or less like CVS here. Good point for
argumentation.

> > In Subversion (I think) merging is necessary when somebody else
> > changed a file that you also changed in one of your changesets.
> 
> Not always -- and you can only have one outstanding un-committed
> changeset in Subversion, namely the one in your working copy.
> 
> Subversion does a merge for you everytime you do 'svn update', just
> like Mercurial will do with 'hg fetch'. If there is a conflict with
> Subversion you will have to resolve it ('svn resolved'), and in
> Mercurial you do the same with the 'hg merge' command. I believe the
> 'hg fetch' step will trigger this merging automatically.

Yeah ok, then hg fetch and hg merge should be just perfect.

/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