0

Why does creating a branch from a branch cause subsequent tree conflicts in merges?

Shouldn't the mergeinfo be enough to know not to try to merge the commits that are keeping branches up to date with trunk?

For example if I do the following I get a conflict:

trunk 
Create branchA from trunk 
Create branchB from trunk 
Create branchC from trunk 

Make changes to branchA

Add jar to branchC

Merge branchC to trunk 

Add file to branchB 
Update branchB from trunk 

Update branchA from trunk 

Create Integration from branchA 
Merge in branchB
--tree conflict incoming add on existing jar

However, if I do it like this I get no conflict:

trunk 
Create branchA from trunk 
Create branchB from trunk 
Create branchC from trunk 

Make changes to branchA

Add jar to branchC

Merge branchC to trunk 

Add file to branchB 
Update branchB from trunk 

Update branchA from trunk 

Create Integration from trunk
Merge in branchA    
Merge in branchB
--no conflict

I can post bat files demonstrating this if it helps clarify.

opticyclic
  • 7,412
  • 12
  • 81
  • 155
  • branchB did not come from branchA so it must first be rebased before it can be merged – clancer Apr 02 '14 at 02:56
  • How would I rebase in svn? branchA and branchB are both from trunk though so they have the same ancestor. They have the last trunk commits from trunk merged in (with the mergeinfo property) too. Shouldn't that be enough to know not to try to merge that commit from branchB? – opticyclic Apr 02 '14 at 03:06
  • I'm not really an expert with svn but I read through similar answers and this should provide a method for merging your changes into "each other" before merging to trunk http://stackoverflow.com/questions/3177192/subversion-rebase .. its a pretty good trick (in the original question) and some discussion in the answers and linked articles – clancer Apr 02 '14 at 04:37
  • Interestingly, if I clone the repo with git, git can do the merge with no problems and without rebasing first. In future I will avoid the branch-from-branch but I want to understand why svn fails in this case (and git doesn't). – opticyclic Apr 02 '14 at 05:14
  • Which version of SVN do you use? Have you tried it with the newest 1.8 version? – przno Apr 02 '14 at 06:48

0 Answers0