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

Re: Merging Branch to Trunk

From: Hari Kodungallur <hkodungallur_at_gmail.com>
Date: 2007-08-24 20:22:32 CEST

On 8/24/07, bobf32@gmail.com <bobf32@gmail.com> wrote:
>
> Hi,
>
> I've yet to see a clear explanation for this so bear with me as it's
> obviously a hot topic.
>
> Paraphrasing the subversion manaual section "Merging a Whole Branch to
> Another", the process of merging changes from branch to trunk is by way
> of:
>
> $ cd <trunk wc>
> $ svn update
> $ svn merge <revision range> <branch-url>
>
> Fair enough.
>
> First question: Does this still work if during branch development, certain
> changes (but not all) were ported to branch from trunk ?

It depends on what changes you made. If you made modifications to the same
changes affected by the merge (of certain revisions from trunk to branch),
then you can potentially get conflicts. If not, it should work fine.

OK I'll continue. Let's say I finish development and want to port my branch
> back to the trunk. Tha manual says to first port all latest changes from
> trunk to branch and then:
>
> $ cd <trunk wc>
> $ svn update
> $ svn merge <trunk url@HEAD> <branch url@HEAD>

This is one of the approaches that is described in the manual. You will use
it when you have to regularly update from trunk to branch to keep the branch
development in sync with the trunk development.

Second question: Would this not produce the same result as the top example ?
>
And if not why not ?

Yes, it should produce the same result as above. This is another way to
accomplishing the same thing. Depending on the situation, you will either
merge all your branch changes to trunk at one go and test it or you will
keep the branch in sync with the trunk, test the branch and then merge to
the trunk. At the end of the day, if done correctly, both the approaches
merge the changes in the branch to the trunk.

Regards,
-Hari Kodungallur
Received on Fri Aug 24 20:20:26 2007

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.