0

I am facing a issue with svn merging, here is the scenario

Trunk
Branch1
Branch2

A new folder 'abc' was created on Branch1 and Branch2 simulataneously, the code-base of both was updated till Branch1 was released. Further code chagnes were made on Branch2.
Now when, Branch1 was merged back to Trunk, it was smooth.
When Trunk was merged to Branch2, there was a tree conflict ( as expected).

But now I am not sure how to proceed. I want to retain the lcoal changes in Branch2 as well as merge the directories correctly, so that the future merges doesn't give any tree conflict.

Any ideas? have anyone faced such issue? Any resolution?


Some answer to question asked: Q Why did you create two branches at the same time?
A: I am on merging svn task in a team of 25 devs. 2 developers have created this.

Q And, why did both branches create this abc directory?
A: It's same project that is being used. One is working on it's inital phase, while other on a feature of it before it is actaully released.

Q Is abc a project or merely a new directory under an existing project?
A: it's a new project

Did that abc directory exist in the trunk?
A: No

mtk
  • 13,221
  • 16
  • 72
  • 112

3 Answers3

0

obviously you're going to get tree conflicts if you merge the same directory name from 2 sources. You can try to fudge it by merging branch 1, and then merging subsequent changes to the directory from branch 2 (ie skip the revision that created the directory and only merge the ones that contain changes to the contents)

Alternatively, you can manually copy the changes across after merging branch 1 and commit.

gbjbaanb
  • 51,617
  • 12
  • 104
  • 148
0

Before merging /trunk from root into Branch2, merge subtree /trunk/abc into /Branch2/abc

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
0

To Subversion /Branch1/abc and /Branch2/abc are two completely separate directories. There's no common history between the two. Next time, you need to use svn cp, so Subversion can tell that they're related.

You can try the --ignore-ancestory tag, but that will do a two-way merge instead of a three-way merge. That means if I merge /Branch2 into /Branch1, the abc directory on /Branch1 will be whatever was on /Branch2.

Why did you create two branches at the same time? And, why did both branches create this abc directory? Is abc a project or merely a new directory under an existing project? Did that abc directory exist in the trunk?

It sounds like you may have to review your CM practices. Unfortunately, without more information, I can't give you more specific advice.

David W.
  • 105,218
  • 39
  • 216
  • 337
  • answers to your question in the updated post. I plan to hard delete the abc project in one branch and then proceed with merge. Do you think it's a good idea? – mtk Oct 07 '14 at 06:33
  • Yes. Get rid of one of the branches. It's a completely different project with the same name. Delete that branch. If still needed, copy that branch to the other one. I would make it a policy to always create new projects in `/trunk` before making a branch for that project. Then to use `svn cp` to create the branch. This will prevent the creating two projects in a single branch issue. – David W. Oct 13 '14 at 14:04