SVN merge (Integrate Project) for multi-module project

We used SVN from the command line to create a branch copy of our project, and have since deployed that branch to production. Now the main line of development is on the trunk. So we want to merge the branch back to the trunk before the next release. Our project is a multi-module J2EE project.

Using IntelliJ 6.06, I checked out the trunk code from SVN and created the multi-module project by importing the modules. I have some questions about using IntelliJ to do the SVN merge:

1. Is source 1 the trunk code, and source 2 the branch code?
2. Do you have to integrate each module separately (they look like separate directories under the SVN trunk and branch directories), or just select the entire trunk as one source and the current branch as the other source?


Thanks,

Bill

1 comment
Comment actions Permalink

We have figured this out ourselves, and since no one has answered the question, I will share our solution.

SVN Merge Instructions using IntelliJ – Merging a branch to the trunk

1. Create new directory for project, e.g. c:\myproject_merge
2. Open IntelliJ with no active project (close current project if necessary)
3. Check out from Version Control (SVN). Expand your repository. Select trunk and Checkout to newly created directory.
4. Create New Project, using name of new directory.
a. Use setup wizard defaults until the Project JDK. Choose the appropriate one
b. Choose multi-module project and Finish. This creates a new Project with no modules
c. Use File/New Module menu to import all existing modules into Project, finding the XXXX.iml module files under each module
d. Set Default Module Version Control to Subversion under File/Settings/Version Control
5. Open Version->Integrate Project
6. All the roots (modules) are displayed in the left pane. Select the first root
7. Use ‘…’ button next to Source 1 entry to find /branches/myproject.../root name and select. Do the same for Source 2
8. Find Revision where branch was initially copied (either using SourceForge or IntelliJ revision history)
9. Specify the File Version value as the Source 1 Revision
10.Select each root in the left pane, and repeat steps 7 through 9 for each
11.Once done, select each root individually and double check to make sure the Sources and Revisions are set correctly
12.Check the boxes for ‘Descend into child directories’ and ‘Run status after update’. Uncheck box for ‘Try merge, but make no changes’
13.Press OK button to do the merge (Note that the merge is only happening locally at this point, and is NOT committed to SourceForge)
14.The Merge results should display in IntelliJ. Check for correctness, and fix any conflicts
15.Before committing the merge, the code should be built, deployed, and tested
16.Commit the merge with the Version Control/Commit Changes menu
a. (Optional) A SourceForge artifact should already exist for the merge – if not, create one.
b. (Optional) Enter a comment in the Commit Changes dialog such as ‘[artfXXXX] Merge branch 1.0.0.23 to trunk
c. (Optional) Unselect all the .iml files and any other files you do not want to commit
d. Press the Commit button and stand back. If the commit fails, resolve the error, and open the Failed Commit Changelist in the Commit Changes dialog to re commit. If no errors, congratulations – you have successfully merged the branch to the trunk!

0

Please sign in to leave a comment.