views:

22

answers:

2

I have a project which was branched, and a bunch of files (F1) were moved into a different directory and changed (F2). Now, I want to merge the branch back to Trunk and keep revision history, but I want to keep both F1 and F2. Is there a way to do this in subversion?

+1  A: 

What you're asking sounds contradictory to me. Maybe I just don't understand what you're asking.

If you just want to access F1 if the need arises, tag F1 before you merge the F2 branch.

If you merge the branch back into the trunk, the F2 files will overlay the F1 files. That's what a merge is.

If you want to keep both the F1 and F2 files, you would add the branch to the trunk and delete the branch. That way, the F1 and F2 files would both be available. I would do this by exporting the working copy of F2, sharing the working copy of F2, and deleting the original F2.

Gilbert Le Blanc
F1 and F2 are in different relative locations right now within their own branches. If I simply export the branch into my working copy, I will lose the file history information. Does that make sense?
Ziplin
And I DO want both F1 and F2 to end up in trunk
Ziplin
@Zipln: Yes, you will lose the F2 file history information. You're adding F2 to the trunk. The file history information is that "you're adding F2 to the trunk". F2 is brand new code to Subversion, with no history. F1 still has the history for F1.
Gilbert Le Blanc
A: 

I figured this out.

I need to check out the trunk revision that was originally branched. Then, I need to SVN COPY the F1 files to their respective new directories so the copies may become F2. Then, merge in a range of revisions from the branch to bring the F2 files up to date. Last, merge in a range of revisions to bring the F1 files up to date. Voila! Histories and everything are preserved, and I get both F1 and F2.

Ziplin