I have a branch which I created from the trunk some time ago. Since I created the branch, I didn’t touch the trunk. Now, I want to return from the branch to the trunk. This is a very simple case, since there’s not much merging to do. Nothing changed in the trunk. The branch can fully replace the trunk.
As I see it, I have two options:
- Delete the trunk (rename it to something else, delete it later) and rename the branch to be the trunk.
- Merge the branch to the trunk (move my working copy to the trunk and use the Merge command from the branch).
I’m not sure which option is preferred. It is important for me to maintain the revision context (not to break the revision graph).
Any thoughts?
You really should use the merge option. The argument of loosing revision information as all changes will be inside 1 commit is negligible, as subversions merge-tracking will preserve this information. If you still have a pre-1.5 installation, you can note the revision range and the branch-path in your commit message.
As you did not change anything in trunk, the merge will be a no-brainer, as you just say:
(Of course your Working copy should point to trunk)
Answers to your comment
svn 1.4 has no merge tracking, so you should not rollback
Why you should not rename branch to trunk:
This is just not the way you should work In your simple setup this would be working, however, your trunk will be deleted and all files will be added again, but you cannot easily track the changed files, as in your action all files were added.
If you merge, only files you changed in branch will be displayed as modified.
Also all workingcopys from old trunk will be invalidated(as you work alone, this may not be important), so you need to check out them again.