How to access PhAT from the CVS repository

April 11, 2000: Document has been updated to reflect the move back to RCF.

October 13, 2003: Document has one line added to reflect trouble with rftpexp and Kerberos 5.

The development of PhAT has moved from a file based, periodically released system into a CVS source repository. This means that people working on PhAT will be able to get much quicker access to classes that have changed or been added. Working with CVS is fairly straightforward, but certain conventions are needed. There is ample documentation on CVS. One can use CVS on the command line with commands like 'cvs checkout ...' or for instance the Emacs vc-mode, where the only action that the user needs to do within Emacs is press 'C-x v v' to do the next logical thing with the current buffer (check-out, check-in, merge etc.).

This document does not describe HOW to use CVS, it is only meant as a guide how to ACCESS the repository.

The repository is located at BNL on the phobos disks at RCF. The general idea is that one accesses the remote repository to make a working copy of the source on a local machine. Once the copy is stored on the local machine, you make the changes to the files and do the usual compile/debug cycle. When satisfied with your changes you commit your changes back to the server, commenting your changes in the log file.

Here are the specific actions that you must take to access PhAT in the repository. We will refer to the local machine as the machine where you intend to do your development. The remote machine is nighthawk.chm.bnl.gov. Please contact Steve Gushue if you want an account on this machine.

  1. On the RCF:
    If you want to be able to change code in PhAT, you will need to have an account at RCF. If you do not have one, you can get one at the New User Accounts page at the RCF.
  2. (optional step): If  you want to be notified by CVS of any changes in the repository, you will need to give your email to the PhAT code manager (currently Patrick Decowski or George Heintzelman).
  3. If you intend to work on the RCF, you should use the RCF standard setup. You will now be able to access CVS, and can ignore the remaining steps (especially the one regarding rftpexp which does not work with the Kerberos5 upgrade (October, 2003).
  4. If you intend to work on your  local machine:
    You will need to setup ssh, the secure shell. Please have a look at Wolfgang Wander's ssh page to see how to do it. In particular you will probably want to setup the authentication using Passphrases (under the heading Keys) and the 'ssh-agent', that way you will only have to type your Passphrase once during your login and not everytime CVS needs to connect to the Repository server. Don't forget to copy the public part of your key (a file called $HOME/.ssh/identity.pub) from the local machine to $HOME/.ssh/authorized_keys on rcf.rhic.bnl.gov.
  5. Test the connection by typing:
    ssh rftpexp.rhic.bnl.gov
    This should give you a prompt without asking for a Passphrase. Go back to step 3 if this does not work.
    NOTE: Do not do any work on this machine. It is intended for data transfers to and from the outside world. Abuse will lead to account suspension at the RCF.
  6. Define the following environmentals on your local machine.
    You can do this in the '.cshrc' file or in some other setup file that you execute before using CVS.
    setenv CVSROOT rftpexp.rhic.bnl.gov:/phobos/u/phobos/Repository
    setenv CVS_RSH ssh
    setenv CVSREAD 1

    [or equivalent for the other shells]

    If you have installed ssh2, you will find it does not work well with CVS. In this case you should explicitly tell CVS to use the ssh1 client instead. Replace the second line above with:
    setenv CVS_RSH ssh1

    CVSROOT is the environmental pointing to the remote repository. CVS_RSH is needed to tell CVS not to use the default rsh type client/server connection, but rather ssh. Setting CVSREAD ensures that the files copied to the working directory will be read-only. This is needed to force the developer to use cvs edit file when modifying a file. This command can be used to notify the other developers that someone is starting to change the specified file.
  7. Go to the directory where you want your working copy of PhAT and do:
    cvs checkout Phat
    This will create a directory called Phat, with the familiar directories of Phat inside it. Additionally  there will also be directories called CVS. These are the administrative directories that CVS uses. Do not edit any files inside them! Chaos will result! The only way of changing the contents of these files is through the cvs commands.
  8. You are now ready to operate on PhAT. Use cvs edit file, when intending to change a file (this only sets the write permission on the file and notifies any users that have set a watch on this file, it will NOT open any editor - you need to do that yourself) or cvs add file when adding new files to PhAT. When you want to be notified of any changes in the repository, do a cvs watch on file. CVS will then automatically email you, provided that your email address has been included (see above). For the many other commands please see the CVS documentation.

You are now ready to use CVS. Since CVS does not use file locking for checked-out files, conflicts when checking files back in will sometimes occur. You will be warned in the output of 'cvs update' when this happens; pay attention to these warnings. These will have to be solved by hand (the conflicting region will be marked by >>>>>>> ...<<<<<<<, see the CVS documentation). 

Last Edited: Monday, October 13, 2003 15:06 by George Heintzelman