88 | | Typically, after you worked on your development branch for a while and want to make the current version in there the new official release for your project, you want to "merge" the changes you made in the branch into the '''trunk''' branch. For this, you use the {{{svn merge}}} command. |
| 87 | '''Please make sure you read the [wiki:pm-svn-releases page about the COIN policy of handling releases and stable branches].''' |
| 88 | |
| 89 | === Synchonizing two branches === |
| 90 | |
| 91 | After you worked on your development branch ({{{trunk}}}) for a while, you might want to merge the changes you made into a stable branch, say {{{stable/2.5}}}. For this, you use the {{{svn merge}}} command. |
92 | | In the example of maintaining a development branch {{{devel}}} for the active code development, you will have created a new branch {{{devel}}} branch as described above. ''You should write down somewhere, which the revision number was at which you split the development branch from the main {{{trunk}}} branch, or the revision number when you updated the official code release in {{{trunk}}} most recently.'' An easy way to do this is to include the revision number in the {{{commit}}} message when you first submit the new branch, or in the message for the {{{commit}}} when you submit the merges applied to the {{{trunk}}} version. One way to find out the revision number of a working copy, is to type {{{svn update}}}. |
| 95 | As an example, assume that the current content in {{{stable/2.5}}} was the content of the development {{{trunk}}} corresponding to the repository revision 450 (e.g., you copied the {{{trunk}}} to {{{stable/2.5}}} at that revision, or you synchronized the two with a previous merge operation). Now you want to update {{{stable/2.5}}} to the current state of {{{trunk}}}. First, you need to have a local working copy of {{{stable/2.5}}}. In the base directory of this working copy, you would then type |
| 96 | {{{ |
| 97 | svn merge -r 450 https://projects.coin-or.org/svn/Prjct/trunk |
| 98 | }}} |
| 99 | This will merge then changes that occurred in {{{trunk}}} since revision 450 into your local copy (of {{{stable/2.5}}}). If you have made no local modifications in {{{stable/2.5}}} (and it is a good idea do keep it that way), everything should just work fine. If you have local modification in your {{{trunk}}} copy, you might encounter conflicts that you have to resolve, just as if you have done an {{{svn commit}}} and encountered conflicts (see the description of {{{svn commit}}} [wiki:pm-svn-cmds here]). |
94 | | Say now that you want to update the trunk version to reflect the changes you have made in your develepment branch. The last change (or the creation of the development branch) has happened at revision number 123. In order to merge the changes that happened in the development branch {{{devel}}} into your local copy of the {{{trunk}}} version, you go into the base directory of the {{{trunk}}} version (e.g., {{{Coin-Prjct/trunk}}}, and there you type |
95 | | |
96 | | {{{ |
97 | | svn merge -r 123 https://projects.coin-or.org/svn/Coin-Prjct/branches/devel |
98 | | }}} |
99 | | |
100 | | This will get all the changes that happened in {{{Coin-Prjct/branches/devel}}} since revision number 123 and apply those changes to your local copy of {{{trunk}}}. If you have made no local modifications in {{{trunk}}} (and it is a good idea do keep it that way), everything should just work fine. If you have local modification in your {{{trunk}}} copy, you might encounter conflicts that you have to resolve, just as if you have done an {{{svn commit}}} and encountered conflicts (see the description of {{{svn commit}}} [wiki:pm-svn-cmds here]). |
| 101 | Note: Once you have successfully synchronized {{{stable/2.5}}} with {{{trunk}}}, you should commit the changes in {{{sytable/2.5}}} and '''include the current repository number in your commit message, so that you know the beginning point for your next marge operation.''' |