8.2. Creating and using branches

We use the following standards in ArgoUML:

Merging branches together is causing some work. So please use them sparingly and announce your intentions before on the mailing list.

8.2.1. How do I ...?

  • ...commit stuff?

    You have made, the change, tested it and are satisfied with it.

    Do a cvs update -d and see that only the files you have changed are marked as modified. If files are updated or patched by this command, please recompile and test again.

    Do a cvs diff on each of the files and verify that only the lines you have changed are modified.

    Do a single cvs commit for all the files included in the change. This reduces the risk that someone else updates in the middle of your work and also reduces the amount of notifications of commits sent out. Include changes to documentation and JUnit tests if applicable.

    Don't forget to update the corresponding issue (if any) in Issuezilla i.e. set it to RESOLVED/FIXED.

  • ...get my update or patch into CVS if I don't have CVS write rights?

    Contact any of the active developers on the list and send them your updates. They're very nice about it the first few times.

    Supposing that you have checked out CVS as guest, then after you have mailed a diff or file to an active developer, and he has entered it in CVS your checked out copy contains the change but is not in sync and the next cvs update will result in an merge error. The simplest way to solve this is to do remove all files modified by you before doing the cvs update. The cvs update will restore all the files from the CVS repository and you can start with the next update.

  • ...get a list of the currently active working branches?

    You can't from CVS. You need to follow the announcements of created and discontinued branches on the mailing list to know what branches are interesting.

  • ...create a branch for my work on xxxyyy and start work on that branch?

    This assumes that you have a checked out copy of ArgoUML

    1. Change directory to the directory where ArgoUML is checked out.

    2. Enter the argouml directory: cd argouml or chdir argouml

    3. Create your branch: cvs tag -b work_xxxyyy_myname

      myname is is a self explaining code for you (your Tigris login).

    4. Change your checked out copy to be on the branch: cvs update -r work_xxxyyy_myname

    5. Do your work!

    6. Check in your changes in the branch: cvs commit -m'Blablabla' [file]

    7. Continue working and checking in!

  • ...move my work from my working branch into the release?

    This is done when your work with the feature xxxyyy is finished and you have decided/received clearance to enter it in the main branch.

    1. Change directory to the directory where ArgoUML is checked out.

      If you are just working on one feature at a time this is the place where you have a checked out copy on the branch in question. If not, this could be any checked out copy of the source that does not contain any uncommitted changes.

    2. Enter the argouml directory: cd argouml or chdir argouml

    3. Move the checked out copy that you are working on to the main branch: cvs update -A

    4. Merge the changes from the branch into your checked out copy: cvs update -j work_xxxyyy_myname

    5. Compile and run all your tests again.

      This is to verify that the merge was all right, no one else had done any changes that in the meantime that has in any way modified the work made in the branch.

    6. Commit your changes in the main branch: cvs commit -m'xxxyyy entered in the main branch

    7. Discontinue your branch!

      From this point on it is important that you do not reuse your branch for any work. Only check it out for the purpose of examining how things were in the branch. Make sure that all other developers that have been looking at your branch also knows that it is discontinued.

  • ...look at someone else's work in a branch?

    You need the name of the branch, i.e. the work_xxxyyy_hisname.

    There are two alternatives:

    • Check out ArgoUML or part of it on that branch: cvs co -r work_xxxyyy_hisname argouml

    • Update your copy of ArgoUML to be on that branch: cvs update -r work_xxxyyy_hisname

      Make sure that your copy does not have any uncommitted code or else your uncommitted code will be present in your checked out copy on the branch. This could, on the other hand, be useful if you want to test if your uncommitted code works also with the additions on that branch.