2

I am using SVN. I have a branch created from another branch which in turn created from trunk. Now what is the correct procedure to rentegrate my branch to trunk?

-------------------------------------------- trunk
   \
    \________________________ Branch1
              \
               \____________ MyBranch

Abhijeet Pawar
  • 690
  • 6
  • 19

2 Answers2

1

Mybranch and Branch1 both use the same method of reintegration: standard. Starting point of branch is unimportant

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
  • And the changes made in Branch1 after its creationg and before MyBranch creation? – Diego Fernández Durán Mar 25 '13 at 15:30
  • @DiegoF.Durán - obviously **yes**, MyBranch at starting point have included all changes from Branch1 at this point (branching = copy of data) – Lazy Badger Mar 25 '13 at 23:06
  • A merge apply changes, not the existing code. If you merge MyBranch to Branch1 and there's any change in MyBranch dependent in a change exinsting in Branch1 prior to the creation of MyBranch you will have problems, maybe not conflict problems but logical ones. – Diego Fernández Durán Mar 26 '13 at 07:56
0

Merge back MyBranch to Branch1 and then Branch1 back to trunk, or reintegrate MyBranch to Branch1 and then Branch1 to trunk. I'm not a fan of --reintegrate, I prefer manual just merge the right revisions.

----(1)-------------------------------------- trunk    \
     \(2)_____(3)______________ Branch1
               \
                \(4)__________(5) MyBranch

Or, if you want go the hard way: merge from Branch1 to trunk the revisions from Branch1 creation to the Branch1's revision from where you created MyBranch, and then merge MyBranch to trunk.

If you know that there's no changes between (4) and (5) that depends in changes between (2) and (3) you can just merge MyBranch directly to trunk.

  • Why do you want to pollute Branch1 by changes, separated into special branch?! – Lazy Badger Mar 25 '13 at 23:08
  • Changes made between (4) and (5) may be logical dependent on changes made between (2) or (3). I explained above. Your solution is right if there's no functional dependencies between changesets :) – Diego Fernández Durán Mar 26 '13 at 07:59
  • When I merge to trunk MyBranch, *all* changes **from common parent of two heads** will be applied - thus include all changes from (1) branchpoint. Do you want to see samples? – Lazy Badger Mar 26 '13 at 09:13
  • Please, I want to see a sample because Subversion doesn't work with snapshots but with changesets and if you do a svn merge -r4:5 MyBranch over a working copy of trunk you are doing just that, merging that revision range. – Diego Fernández Durán Mar 26 '13 at 12:21