We are migrating some Java projects from a proprietary source control system to SVN (company is already using it and we haven't switched to git yet).
Another goal we wanted to do as well was to take this opportunity to switch the Java projects to Maven as well as do long overdue fixes. While I waited to get access to SVN to be able to create new projects (big company, there are delays), I started migrating the projet to Maven.
I then created a branch from trunk for our next code delivery, called: L12.34 (company policy, delivery versions are numbered with letter "L" followed by 2 sets of 2 numbers, seperated by a period). From then on, several fix branches were created from the delivery branch, for various fixes and then subsequently merged back into the delivery branch after proper code reviews, etc.
We also caught someone who has commited a few fixes directly onto the trunk.
Once I got access, I created a new folder to host the project under /Department/System/Backend/Project1 (with trunk, tags, branches sub-folders) and proceeded to import the modified version into trunk. This is where I faulted and this is what I need to correct. The trunk should reflect what's in production at the moment.
Is there a way to update the trunk so it reflects the code that's in production at the moment, without loosing all of our history? Would it be simpler to create a new project (Project2), commit the production code into trunk, then create a delivery branch (L12.34) and merge Project1/L12.34 into Project2/L12.34? Would that keep all our history?
I am hesitant to start trying things before fully understanding the proper course of action.
I expect a few things after this is resolved:
- trunk reflects what's actually in production at the moment
- Project1/branches/L12.34 should have as an ancestor the code that's in production right now, so we should be able to do a diff between the branch L12.34 and trunk to see all changes that are to be deployed in our upcoming release
- we keep all the history of what was done so far (branches, commit messages, merges, etc)
Finally, are there back-ups that should be taken before starting to correct this situation?