I'm not sure what you're doing. You only need to checkout the branch you are merging to. There's no need to checkout both branches, do a switch, change your working copy, do a log, etc. It's really a fairly simple procedure:
- You make a branch (we'll call the copy branch) off of the original branch (normally
trunk
, but that's not necessarily always the case). - You can do your work on both original and the copy branch depending upon your development technique.
- When you want to do a merge, you checkout a copy of the branch you are merging to. This, after all, is the branch getting the changes. You want to test these merged changes before committing them back to the repository.
- To do a merge, all you have to do is use the
svn merge
command on your working copy. If you're merging from the original branch to the copy branch, you don't use the--reintegrate
switch. If you're merging from the copy branch to the original, you use the--reintegrate
switch.
That's all there is to it. You can pick and choose revisions you want to merge, or you can simply allow all changes to be merged. Subversion merging is pretty good and Subversion does a pretty good job at tracking merges.
I suggest you read up on the Subversion manual's chapter on branching and merging.
Do you need to delete a branch you merged from? No. Subversion since version 1.5 won't duplicate a merge that's already happened.
You may delete a branch if it is no longer needed. For example, I make a Release 1.2 branch. I do Release 1.2.1 and Release 1.2.2 on it. However, none of my users are on Release 1.2.x and I no longer do any work on it. I might delete it just because when I do svn ls http://server/svn/branches
, I won't see it. Being Subversion, I could move it out of the way if deleting it makes me nervous. I can move it to http://server/svn/branches/OBSOLETE/1.2
. That way, it doesn't show up when I list the branches, but it's still there if I ever decide I really, really still need it.
By the way, Subversion never really ever deletes anything permanently. Even if I delete the branch, I can always get it back.