I'm not quite sure I undestand what you're trying to do. What do you want to have happen to all the changes made on trunk after the branch was created? Do you want them to not appear in the log when you view the history of a file after the merge? If so, that's what you'll get if you delete the trunk and copy the branch into its place -- the branch shares the history with trunk prior to being branched, so it's the same except for the revisions made after the branch. If you want to keep the history of trunk, but just stomp on all the changes made between branching and merging, that's a slightly trickier problem. I think if you do a merge that ignores ancestry (there's an option --ignore-ancestry
), it will replace the contents of trunk with the branch. You may also want to try the --force
option with the merge (both in lieu of and in conjuction with --ignore-ancestry
). Try it a couple different ways to see if you get the results you want...
If that fails, you could always reverse-merge all the changes on trunk since the branch point, then merge in the branch. This seems likely to cause some conflicts, which you would of course want to resolve using the version from your branch. I don't know if any of these ideas are optimal.