[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: How to merge branch back to trunk when branch is in sync with trunk

From: Stefan Haller <haller_at_ableton.com>
Date: 2004-10-30 20:17:13 CEST

Claude Montpetit [Nertec] <cmontpetit@nertec.com> wrote:

> > We had a long-life branch that received a couple of merges from the trunk.
> >
> > revision 81: created branch X from trunk HEAD.
> > ...
> > revision 100: merged trunk into branch X - 82:99
> > ...
> > revision 150: merged trunk into branch X - 100:149
> >
> > The branch X now contains all changes in the trunk (HEAD). I want to
> > apply all changes that were made to the branch X back in the trunk.
>
> From reading about this here and there, and trying it locally, it seems
> that if I merge the branch X from version 81:HEAD into the trunk, I get
> the desired results. But although the commit on the trunk after this
> merge shows only the branch X modified files, somehow, this operation
> seems not right to me. Is this the way to proceed?

No, this is wrong. It will often work, because Subversion notices that
the trunk you're merging into already contains most of the changes you
are trying to merge into it; but it doesn't always work, and it is not
the correct way to do it.

Instead, merge the differences between trunk@150 and branch@HEAD into
the trunk. You need to be very careful that the branch really contains
all the changes from trunk up to r150, otherwise you will revert the
ones that it doesn't contain.

One common mistake is to merge the trunk up to the current HEAD into the
branch, and then merge the differences between trunk@HEAD and
branch@HEAD into the trunk. This is dangerous, because if someone else
manages to commit something between the two merges, you will revert that
commit. It is better to give the trunk rev explicitely.

-- 
Stefan Haller
Ableton
http://www.ableton.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sat Oct 30 20:17:47 2004

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.