Branch Management
The Orocos code is hosted on a Subversion repository on svn.mech.kuleuven.be. As is typical for subversion, there is a main line of development, called trunk, and any number of branches for managing releases, new developments, etc. This document explains how to setup and maintain such a branch using the subversion tools.
!!Orocos Code Repository Basics The first step is always checking out the Orocos mainline in your sources directory with:
$ cd ~/src $ svn co http://svn.mech.kuleuven.be/repos/orocos/trunkIf you have write access, use the 'https' variant, otherwise you can not commit. If you make changes to this code, you can send a patch to the Orocos-dev mailinglist using:
$ cd trunk/rtt $ svn diff > my-rtt-improvements.patchIf the patch got accepted and applied, you need to revert your changes before updating:
$ svn revert . -R $ svn update'revert' undoes all your local modifications recursively. Be more selective ( for example 'svn revert doc/orocos-installation.xml' ) to revert only single files. The 'update' command gets the latest version recursively of the current directory.
!!Creating a Development Branch
Developers having write access to the subversion repository may create a branch to do their development, before the code is merged into the trunk. Development is done in the 'branches' directory. You create a branch by making a copy of trunk:
$ svn cp https://svn.mech.kuleuven.be/repos/orocos/trunk/rtt https://svn.mech.kuleuven.be/repos/orocos/branches/rtt/branch-nameNote the 'https' protocol. Off course, you can check this branch out:
$ svn co https://svn.mech.kuleuven.be/repos/orocos/branches/rtt/branch-nameA suitable 'branch-name' can be decided upon through the mailing list. The next step is to setup 'patch tracking' in order to see which patches appear on trunk and could be applied on your branch. We recommend the 'svnmerge' tool for this:
$ cd branch-name $ svnmerge init -f commit.txt $ svn commit -F commit.txt $ rm commit.txtThe tool will detect that you branched from trunk/rtt and create a commit message in commit.txt (read/modify it for yourself). You need to commit the current directory with that message. Now your branch is ready to be developed upon, commit code etc.
!!Maintaining a Development Branch
After a while, you want to get the latest fixes or addition of the trunk on your branch. To see what is available, you can use the svnmerge tool:
$ cd branch-name $ svnmerge avail 1370-1376Which lists that the trunk moved 6 revisions. You can read the log messages as well: {{{
$ svnmerge avail -l 1370-1376
r1370 | psoetens | 2004-12-22 10:37:36 +0100 (Wed, 22 Dec 2004) | 2 lines
OS_AGNOSTIC build fixes
r1373 | psoetens | 2004-12-22 11:36:52 +0100 (Wed, 22 Dec 2004) | 2 lines
OS_AGNOSTIC buildfix
r1375 | psoetens | 2004-12-24 13:43:42 +0100 (Fri, 24 Dec 2004) | 5 lines
merge from orocos-branch/branch-0.18 : -r1357:1374
- LGPL licenses
- cleanup() fixes in Program and state parsers
- Doc and Doxygen updates
------------------------------------------------------------------------ }}} Apparently 3 patches were applied. You want those build fixes, thus proceed with merging:
$ svnmerge merge -r 1370,1373 -f commit.txt ...you can now, if everything worked out fine, commit them on your branch using the svn command:
$ svn commit -F commit.txt ...If you got too many conflicts or want to start over, just revert the merge:
$ svn revert . -RWarning: this also reverts your own changes, so it is best to only use 'svnmerge merge' on a 'clean' tree. After the commit, you can see that the patches are merged:
$ svnmerge avail 1376Only one patch is on trunk but not on your branch. See 'svnmerge help' or the svnmerge webpage for more options.
!!Merging a Development Branch with Trunk
After a long day (or longer) work, your branch is tested and shining and ready for inclusion on the main line. The first thing you need to do is get your branch fully in sync with the trunk:
$ svnmerge avail 1376,1420-1538 $ svnmerge merge -r 1376,1420-1538 -f commit.txt ... $ svn commit -F commit.txtA merge to trunk is thus actually preceeded by a merge from trunk. If everything still works after the merge, you can communicate this to the Orocos-dev mailing list or add a message to your Bugzilla listed project. You can make your patch available by using:
$ cd branch-name $ svn diff http://svn.mech.kuleuven.be/repos/orocos/trunk/rtt http://svn.mech.kuleuven.be/repos/orocos/branches/rtt/branch-name > my-project.patchWhich lists the differences which must be made to trunk in order to get your branch. If this patch is thus applied to trunk, your project is effectively merged. When this merge is done, all future bugfixes related to this project will happen on orocos/trunk and the branch can be safely deleted: $ svn rm https://svn.mech.kuleuven.be/repos/orocos/branches/rtt/branch-name