tags:

views:

60

answers:

2

We created a branch from the trunk on which a major refactoring was done. Meanwhile, the trunk advanced a few revisions with some fixes. We don't want these changes on the branch, so we don't want to "catch-up" merge the trunk to the branch, because we don't want to mix the old and new code. But without this I can't reintegrate the branch back to the trunk.

Is there a way to impose the branch on the trunk "as-is"?

(an idea I considered is to undo ("reverse-merge") the trunk back to the revision where the branch started, and then it is safe to merge it on branch - nothing should happen. Then I can reintegrate. What do you think?)

thanks!

+1  A: 

Assuming that you are fine losing those changes then that is an acceptable solution, although you might want to consider simply renaming the current trunk to a branch and renaming the branch to trunk:

svn move https://path/to/repo/trunk https://path/repo/branches/newbranchname
svn move https://path/to/repo/branches/refactoring https://path/to/repo/trunk

Although, are you really sure that you don't want to bring in the changes from trunk? You might want to consider that very carefully. Even if you have done lots of refactoring, if usable work on trunk has been made, you still might want to look at it very carefully so that the progress made doesn't go to waste.

Michael Aaron Safyan
thanks a lot. these changes are hotfixes by my collegues, and they claim that they all exist also in the new version.
davka
+1  A: 

You can use, as you mentioned the reverse merge. Checkout the trunk

svn merge -rHEAD:RevisionTheBranchWasCreated ^/trunk

This will undo all changes you've made after the branch has been created. After that the merging should be working without any problems.

khmarbaise
thanks. not sure about the notation "^/trunk", is this a path to repository or a working copy?
davka
Ah sorry. ^/ is used from inside a working copy. If you are outside you have to use the full URL instead (^/ is SVN since 1.6.X)
khmarbaise