SVN/PTS Guide

Checking Out an SVN Repository

  • Check out the code on AFS using the command "svn co svn+ssh://REPO-PATH CO-PATH" where REPO-PATH is the full path to the repository and CO-PATH is the path to where you'd like to check it out. For example, if your repository is in /afs/andrew.cmu.edu/usr/xyz and you want to check it out in the current directory, then you would use "svn co file:///afs/andrew.cmu.edu/usr/xyz .".

  • Check out the code on a non-afs *nix machine using the command "svn co svn+ssh://

    USER@unix.andrew.cmu.edu/PATH" where USER is your andrew id and PATH is the path to your repository on afs. For the previous example, you would use "svn co svn+ssh://

    abc@unix.andrew.cmu.edu/afs/andrew.cmu.edu/usr/xyz" if your username was abc. If the repository is on club.cc.cmu.edu (this includes the roboclub directory) then you will need to create the file .ssh/rc in your home directory on afs and add the line "aklog club.cc.cmu.edu" to it.

    • Note that this will break ssh X forwarding for some reason (to fix ssh X forwarding after that, just move the file).
  • Check out the code on a Windows machine using TortoiseSVN, a free SVN client. After installing it, right click in the target directory and do a "checkout" using the same URL that you would use when checking it out in Linux (see above).


Setting Up and SVN

  • Connect to AFS via SSH or otherwise. Create your repository using the command "svnadmin create --fs-type=fsfs PATH", where PATH is the path to the directory in which you want to store the repository.
    • If you would like to create a repository on the cclub roboclub volume (/afs/club/usr/roboclub/) then you should create a subdirectory for your project in /afs/club/usr/roboclub/www/.
      • If you setup a repository on the roboclub volume, you need to create a group to use it. See the PTS section for more information.
    • If you would like to create a repository on roboclub8 then you should create a subdirectory for your project in /home/svn/
      • If you setup a repository on roboclub8, you need to create a group and set the permissions correctly. See the Roboclub8 Groups section below.

PTS and Groups

  • Create a group: pts creategroup roboclub:[groupname]
  • Add users to the group: pts adduser [user]@andrew.cmu.edu roboclub:[group]
    • Members must first do the following steps:
      • SSH into unix.andrew.cmu.edu via putty or ssh secure client.
      • Type the command "mkdir .ssh"
      • Type the command "nano .ssh/rc"
      • Type "aklog club.cc.cmu.edu"
      • Type "ctrl-x" then hit the key "y"
  • Recursively add permissions to your repository. In the www folder there is a script called fs_sa_recursive:
    • ./fs_sa_recursive.sh [repository_name]/ roboclub:[group] rlidwk
  • Note you may need an officer to set this up for you. Try it yourself first. If it fails ask an officer.


Roboclub8 Groups

  • You need to create the group. Launch the users-admin program and create a group. Check the users that you want to add to the group (note they must have roboclub8 accounts to do this)
  • Go to the /home/svn directory
  • Type "sudo chown -R :[GROUP_NAME] ./[SUB_DIRECTORY]"
    • Note this requires you to be an admin. If you are not you need to ask an officer to do it for you.
  • Type "sudo chmod -R g+rwx ./[SUB_DIRECTORY]".


Acknowledgments

  • Thanks to Cornell Wright for the fa_sa_recursive script
  • Thanks to Felix Duvallet for his knowledge on PTS