You are here: Foswiki>LabstaffWeb Web>SubversionHowto (08 Oct 2010, lindss2@LAB.CS.RPI.EDU)EditAttach

Revision Control: Subversion

Subversion references

url Description
https://subversion.cs.rpi.edu/websvn Web based repository browser
http://svnbook.red-bean.com Oreilly documentation for subversion
subversion.apache.org/ Subversion packages and binaries
http://tortoisesvn.tigris.org Win32 GUI for subversion

Clients

Checkin email

  • A copy of each subversion checkin message will be emailed to the checkin author.
  • TBRB: ${user1}@cs.rpi.edu, ${user2}@cs.rpi.edu (to be reviewed by)
    • For collaborative groups the keyword TBRB: can be inserted into checkin comments and all users listed will be sent a copy of the checkin email.
  • listserve email lists
    • To automate notifying users about checkins an email list ${repository}-svn-notify can be created. All checkin messages for the repository will be sent to the email list and group members can subscribe/unsubscribe as necessary to receive checkin email.

Mailing lists

  • To automate distribution of checkin messages / notification of source code changes request to have a listserve mailing list ${repository}-svn-notify created.
  • After a repository has been updated all checkin messages will be CC'd to the mailing list for distribution.
  • Group members can subscribe/unsubscribe from lists as necessary to receive the email.

HOWTO: Subversion

  • How to check modified files into subversion ( file xyz/README modified )
    • cd sandbox/xyz
    • svn status # determine what files were modified
    • svn ci README # Check edits into subversion and enter a meaningful description of the changes made.
    • svn ci # 'svn ci' can also be run w/o arguments to recursively commit any changes made in the sandbox.

  • How to place a new file under revision control
    • cd sandbox
    • date >> README
    • svn add README
    • svn status # will display 'M README' for a modified file
    • svn ci README # Checkin the edits

  • How to create a new directory in subversion
    • cd sandbox
    • svn mkdir foo
    • svn ci foo

  • How to determine what files have been modified
    • cd sandbox
    • svn status # recursively check for modified files. 'M'-modified, '?'-file is not under revision control.

  • How to delete a subversion file
    • cd sandbox
    • svn delete README
    • svn status # 'D README' will be displayed
    • svn ci README # record the deletion

  • How to remove executable attribute from files
    • svn propdel 'svn:executable' file1[, file2 .. fileN ]

  • HOWTO: Ignore generated or unversioned files (directory attribute)
    • cd ${sandbox_directory_containing_elements_to_ignore}
    • svn propset svn:ignore ${list_of_elements} ${dot_directory}

Hooks

Subversion repository commit hooks can be configured to perform a variety of tasks.
  • Send checkin email to a mailing list whenever changes are made in the repository.
    • Unit tests can be used as a gatekeeper to prevent checking in problem files
    • Syntax checks performed on source prior to checkin (~perl scripts)
  • Checking in files can trigger misc actions to be performed.
    • Generate documentation
    • Rebuild index files

Request creation of a subversion repository

HOWTO: Grant/restrict user access

  • Checkout a copy of the .subversion directory from a repository (r/w access required)
  • Modify the SVNAccess file to grant/restrict repository access
  • Checkin edits made to the SVNAccess file.
    • Modified file will be screened for typos and invalid user logins.
    • If no problems are detected the new config file will be used by the subversion server.
  • Contact labstaff@cs.rpi.edu if either a .subversion/SVNAccess file does not exist in your repository or if recent config edits are not active.

Repositories

  • Several repositories exist or can be created for project work.
  • A protected repository exists for faculty use where proposals, grants, etc can be created/maintained.

Problems

Subversion checkout using an https:// URL fails

This is a know problem involving kerberos tickets and subversion, there are two workarounds:
  • Use kdestroy to eliminate your existing kerberos credentials prior to checkout, then use kinit afterward to re-authenticate your session.
  • Checkout using an http:// URL instead of https://.
    • Item of note: Using http:// will transmit your login & password to the server in plaintext which can be vulnerable to snooping. Include the argument --no-auth-cache when using http:// to prevent caching your password in the local sandbox.

Workaround for Subversion (SVN) certificate verification error: insecure algorithm on Ubuntu 10.04

  • svn: OPTIONS of 'https://server.com/repo': Certificate verification error: signed using insecure algorithm
  • Add to the end of your ~/.subversion/servers file:
    • ssl-trust-default-ca = no
  • Which will force having to manually verify certificates when a sandbox is initially checked out.

403 Forbidden

  • If you receive the following message while trying to checkout code from a repository
    • svn: Server sent unexpected return value (403 Forbidden) in response to OPTIONS request for 'https://subversion.cs.rpi.edu/svn/${repository}'
  • It means that the account you are trying to interact with the repository has not been granted access
    • This may be due to either your login not being listed in the SVNAccess file or your RCS/CS account was added and you are trying to gain access with the other account.
  • Resolution
    • Contact the repository maintainer and request to be added
    • Contact labstaff if you are unsure who to contact or require additional help.


-- JoeyArmstrong - 28 Sep 2010
-- StevenLindsey - 08 Oct 2010
Topic revision: r27 - 08 Oct 2010, lindss2@LAB.CS.RPI.EDU
 

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback