PHEW..!! (Wiping the sweat off my forehead..!! )
I tried this hack when Nothing else really worked for me.. This was a branch that went into a completely different tangent from head, with multiple versions and branches created intermediate which I did not keep track of. Finally what I wanted was that my branch V5 should replace everything in Head. simple. So here is what I did:
If you want to replace branch BTARGET (in this example Head) completely with Branch BSOURCE (in this example DRISHTI_RCP_0_9_6_V5), this is how you proceed.
For the EXPERTS -> "Move to your source branch, and disconnect from CVS, share this disconnected project again with the same repository but with the target branch. Do not commit the outgoing diffs, nor update the incoming diffs from the repository. Just cancel before the last step. Synchronize... mark this entire project as merged.. which is like saying override my repository with the local source. Just commit. All repository structure in the BTARGET branch and files will be replaced by structure and files in the local project which was the source project to begin with"
A more detailed explanation....::
1. Make sure everything in your module / eclipse project in branch BSOURCE is committed already into the CVS.
2. Now right click on your BSOURCE module and Team->Disconnect. There is a popup in which you choose "Also delete CVS Meta-Information From the filesystem". This will unshare the project.
At this point you have in your local workspace in a non-cvs project the code which was in your source which you wanted to move to the Target.
3. Right click on this local project again and Go to Team->Share Project, and share project using the same repository CVS and choose the branch BTARGET.. (in this case HEAD)
At this point you told eclipse you want to share this project with the head. However eclipse will prompt and tell you there is alreayd a project with the same name.. do you instead want to synchronize with that. You say YES !!
4. When you synchronize obviously you will see a lot of diffs and errors since you are seeing the BSOURCE branch and comparing it with BTARGET.
5. Do not commit. Before the last step of commit, press cancel, so that the project is still shared.
6. Right click again on this project and say Team->Synchronize. This opens the synchronize view where you will again see similar diffs..
7. Right click the project again and say "Mark as Merged". This is the most important step.. what you did was effectively tell eclipse and cvs that the local project is now the master..and you want to override the structure and files of repository from teh local project
8. Commit the local project :) YOU ARE DONE MY FRIEND..!! in about 5 mins.. instead of staying up all night..!! :)