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

RE: mergeinfo between svn copied branches and merges

From: Andrew Reedick <Andrew.Reedick_at_cbeyond.net>
Date: Wed, 8 May 2013 09:17:22 -0400

> From: Z W [mailto:mpc8250_at_gmail.com]
> Sent: Wednesday, May 08, 2013 6:49 AM
> To: Andrew Reedick
> Cc: users_at_subversion.apache.org
> Subject: Re: mergeinfo between svn copied branches and merges
> In this case, all you should have to do is:
> a) merge branchC UP to branchB
> b) merge --reintegrate branchB DOWN to branchC.
> Step a) will pick up any branchA changes (because all of branchA is a subset of branchC.)
> >> This strategy is still new to us.
> We're not sure what the intermediate steps are trying to accomplish, esp the merge up and down parts.
> What is the exact syntax (as an example) for (a) and (b) ?

a) merge branchC UP to branchB
        cd branchB_workspace (or create a brand new, clean workspace)
        svn status (check for existing changes)
        svn update (If your workspace is not up to date, svn merge will complain.)
        svn merge svn://.../branchC
        resolve any conflicts
        svn ci

b) merge --reintegrate branchB DOWN to branchC.
        cd branchC_workspace (or checkout a clean workspace)
        svn status
        svn update
        Notify folks to not check into branchB, or simply lock branchB (since we will need to delete branchB)
        svn merge --reintegrate svn://.../branchB
        resolve any conflicts
        svn ci
        svn log -l 3 svn://.../branchB (Since we're going to delete branchB, make sure that no one checked into branchB after your merge)
        svn rm svn://.../branchB
        svn copy svn://.../branchC_at_1234 svn://.../branchB (recreate the branchB if it is still needed.)
                where 1234 is either the HEAD of branchC or the merge point on branchC. It's up to you.

        This is covered in the svn book: http://svnbook.red-bean.com/en/1.7/svn.branchmerge.basicmerging.html#svn.branchemerge.basicmerging.reintegrate

You merge UP to a child branch that was created from a parent branch. You merge "back DOWN" to a parent branch from a child branch. "UP" and "DOWN" are just semantics to help you keep things straight due to the need to run --reintegrate. Once svn 1.8 comes out, you shouldn't have to worry about up, down, and --reintegrate anymore.

>> we svn copy branchA to produce branchB
In this case, branchA is the parent, and branchB is the child, so you merge UP from A to B, and DOWN (via --reintegrate) from B back to A. In the example given in the svn book, branchA would be the "calc-trunk" and branchB would be "my-calc-branch".

>> we then svn copy branchA to produce branchC
Since branchC was created from branchA, branchC would still be the "parent" of branchB. Merge UP to branchB, merge DOWN to branchC.

Of course, this is Subversion, and merge tracking wasn't part of the original design specs, so there's always the chance of something odd happening...

Branching and merging: http://svnbook.red-bean.com/en/1.7/svn.branchmerge.html
Received on 2013-05-08 15:18:42 CEST

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.