I am facing a situation at which my development team would like to re-organize the file structures in our repositories. This process will take about 2-3 months. During the file re-structurization, we still have to do a software releases. So, after the re-structurization process, we want to merge the organized files from the branch back to trunk. It is important to preserve the file history and also we need to be able to merge the code changes in trunk since first creating the branch.
My initial attempt was by creating a branch and then simply merge it. Unfortunately, it is not as simple as I thought. One of my test scenarios was the following:
- Created the branch from trunk
- Update a file in trunk
- Move the file in the branch
- update the file in the branch
- Doing a merge from branch back to trunk
At step 5, I got a "tree conflict" error on the file that I update in trunk. TortoiseSVN does not give information on what file in branch that that the conflicted file related to. In my scenario, it is not that difficult to figure out the files with problems; however, in our real repository it will be very difficult because we have thousands of files and many of those files have the same filenames (in a different folders).
Does anyone have experiences in the same situation as I am in? Any suggestion / best practices that I should/can do to make ensure the integrity of the codes?
Thanks for all the helps.
This is what I ended up doing: 1. Merge all renamed and modified files in the branch with all the updates (when applicable) from trunk 2. Commit branch to repository. The branch now has the latest code including changes from trunk since the branch was first created 3. Merge all changes from the branch back to trunk. Trunk will not have all the updated files structure and all changes that happens in both trunk and the re-organization branch
Note: Expect to still get Tree conflict for files that are updated in trunk and moved to another location in the branch. All I needed to do was removing those files.
Step #1 is a tedious process but it works on my test. This may not the best solution but it works for me (maintain updates from both trunk and branch and also preserve history).