Subversion

What is Subversion? This document explains.

What is svn (Subversion)

It is a tool to help you keep track of versions of your code or documents that you write. You can also collaborate with others on the same project by checking out versions and so on.

The basic idea is:

  • IT provides a server that offers you some space to "import" versions of your project from your own computer.
  • You download and install a free svn client (like Tortoise for windows) on your own computer. This lets you communicate to the server and update your project. Once the client is on your computer, you can for example right-click on a folder and choose to "import" this version of your folder into your repository on the server.
  • You can configure your project to also be shared and updated by any collaborators that also have Rice NetIDs.

See also the complete svn reference documentation

What do you need to do to start using svn

STEP 1: Request for a place to be created where you will be keeping versions of your project. This is called a "repository".

  • Go to http://old.apply.rice.edu, login with your NetID, then go to Account maintenance.
    Subversion repository management Repository. On the left menu of options, "Repository management" is circled in red. There is a red arrow pointing to "Repository Group."
  • Choose Repository Management from the left column. Choose a name for your "repository" and type it in. You can keep up to 3 repositories at a time.
  • Wait for a while as directed by the apply.rice.edu site, for the automatic scripts to run and create your repository.

STEP 2: Use your browser to verify that your repository is there.

  • Use a browser to go to https://svn.rice.edu/r/<name of your repository>
  • Authenticate using your NetID and password (not adrice\netid, just NetID)

STEP 3: Get the software you need to start updating your project

  • Download and install the client for your operating system.

On Windows

The suggested software in the complete svn reference documentation is Tortoise.Once you download and install it, your windows explorer gives you the ability to use its options. So, when you right-click on a folder you get extra options of what you can do with this folder via Tortoise. You can "import" the folder from your computer into your repository on the subversion server. You can "export" the latest version from your repository back to your computer and so on.
Shows a menu with "Tortoise SVN" selected, with a menu arrow to "repo browser" then "Export."


You will need to provide the path to your repository in all your communications with your svn server. The path will be like https://svn.rice.edu/r/<name of your repository>
Shows a repository named  https://svn.rice.edu/r/nikissvn

On Macs

MacOSX should have the svn library already available. Open a terminal window and run the command which svn" to make sure you have svn. Then *svn help will tell you what the options are. For example, to export your project from the svn server to your local machine you need to run:

svn export https://svn.rice.edu/r/yourproject ./localpath --username yournetid

On Linux

You will need to download and install a subversion client package, if your machine does not already have one installed. The standard Rice iso for Redhat that you can download from http://linuxsupport.rice.edu contains the necessary package/libraries and so gives command-line svn options are immediately available to you.

The following screenshot comes from a Ubuntu 8.04 machine using the "SVN Workbench". This is a GUI that lets you use svn manipulations. Again the idea is that you use the "Add" action to add a project to your workbench and then use the "Check-in" button to upload it to the server and the "Check-out" button to download it back to your own machine.
Shows how to save using Linux code

STEP 4: Configure your project to let others collaborate with you

When you request for your "repository" to be created, you will notice that a folder called "rice_config" is created within the repository. In it there is a file called "access_file", which is used to control access to your repository. There is also a file called "access_file.readme" that explains how to use the access_file to control access to your repository by other users.

How to edit the access_file

The idea is that you use a basic text editor (vi, wordpad etc) to edit the access_file. In there you declare groups of users using their netid. All users have to have a netid to collaborate with you. If they do not, you can ask for a guest account netid for them. Go tohttp://guest.rice.edu to do so, and become their sponsor.

The access_file is made up of blocks that create groups and then blocks that tell what groups have what access to which subfolder in the repository. The first line declares the block. Here is an excerpt form the access_file.readme:

#This file is made up of simple blocks.  Each block begins with an entry in
#   hard brackets ([]).  One block is special, it contains the word groups
#   in brackets.  This special block allows you to define groups of users
#   that can be used in other blocks.  There can only be one [groups] block
#   in this file.
#BEGINNING OF [groups] BLOCK
#   [groups]
#   group1 = user1, user2, user3, user4
#   group2 = user3, user4
#
#END OF [groups] BLOCK - NOTICE THE EMPTY LINE ABOVE
#
# The other blocks in the file specify the permissions for a specific area of
#   the repository.  The value within the brackets gives the location
#   within the repository that the permissions following it affect.
#BEGINNING OF BLOCK CONFIGURING user PERMISSIONS ON YOUR TOP FOLDER
#   [/]
#   user = rw
#   @group1 = r
#   @group2 =
#   * =
#
#END OF BLOCK CINFIGURING user permission - NOTICE THE EMPTY LINE ABOVE
#   Explanation:
#
#       "user" has READ and WRITE access
#       All users of "group1" have READ access
#       All permissions are removed from the users in "group2"
#       All permissions are removed from ALL users
#
# The block, [/rice_config], is really important.  This block controls
#   who has access to update this file.  It is recommended that you not
#   mess with this block unless you know what you are doing.  If you
#   remove your access from this block, you will not be able to change
#   the permissions for your repository and probably will not be able
#   to even access your repository.
#
# Please see http://svnbook.red-bean.com/nightly/en/svn-book.html for
#   more information about Subversion and this access file.

Here is an example of an access_file.

#
#
#
[groups]
instructors = symes, netid2
 
#
[/]
serak = rw
@instructors = rw
* =
 
#
[/rice_config]
symes = rw
* =
 
#
#
#

Please make sure that

  • you leave SPACES between the usernames, the = sign and the permissions
  • you leave empty lines after the definitions of each block
    If your editor removes empty lines at the end, thsi will be a problem.
  • you may add a comment (pound sign #) at the very end of the file to make sure you have empty lines where you need them.
Commit the changes and start using the access_file

After you edit the file you will need to commit the changes to the repository. Run

$ svn commit -m "comment goes here"

The process that reads the access_file after it has been commited runs every few minutes. Your changes will take effect in about 2 to 3 minutes after you have run the svn commit command.

 
 
  • No labels




Keywords:svn, Subversion   Doc ID:72830
Owner:Christi C.Group:Rice University
Created:2017-04-24 11:37 CSTUpdated:2017-04-24 11:38 CST
Sites:Rice University
Feedback:  0   0