Using SVN to Download VMOSS

These notes will describe the steps you need to use Subversion (SVN) to download VMOSS. On this page we will concentrate on using SVN from the command line to download the source code directly to a directory. For instructions on downloading directly into Eclipse, see Using SVN in Eclipse for VMOSS project.

For quick background, you should read through How to use Subversion (Guide and Resources).

Contents

SVN Command Line

This example assumes that SVN is installed on your file system. To test whether it is, type 'svn' on the command line and you should see the following output:

$ svn
Type 'svn help' for usage.

If SVN is not installed, you can download a installer package from the SVN web site.

A Repository on a Shared File System

Let's assume that the SVN repository is located in a directory on your own system. This would be the case, for example, if we were all working on the CPSC department's system. Let's suppose the repository's full path is /tmp/svnrepos.

A project named project in an SVN repository has the following hierarchical file structure:

/tmp/svnrepos/project/branches/
/tmp/svnrepos/project/tags/
/tmp/svnrepos/project/trunk/

Let's suppose in this case that the trunk/ contains the source code you wish to work on. And let's suppose it contains files named countbyM.php, hello.php, and README.txt.

You would first create a project workspace in your own directory, and then change into that directory:

$ mkdir myproject
$ cd myproject

Next you would checkout the source code from the repository into your current directory:

$ svn checkout file:///tmp/svnrepos/trunk .
A    countbyM.php
A    hello.php
A    README.txt
Checked out revision 1.
$

The dot (.) in this command means that the files should be downloaded into the current working directory. Note in this case that the transfer protocol is file:, which means that repository files are being transferred from a shared file system. The command is followed by an SVN report. In this case, SVN is reporting that three files are being added (A) to your project.

A Repository on a Remote File System

If the repository is located on a remote file system you would use a different transfer protocol to access it. In this case you would use the 'svn+ssh protocol. This versions transfers files across a secure channel:

$ svn checkout svn+ssh://ram@svn.cs.trincoll.edu/var/svn-repos/repo_exercise .
Password: 
A    sample_proj
A    sample_proj/course_list.php
A    sample_proj/README
A    sample_proj/course_email.php
Checked out revision 29.

In this case we are accessing a repository stored on svn.cs.trincoll.edu as a registered user. This won't work unless you have an account on that server.

Hidden Files

When checking out source files from an SVN repository using the svn checkout command, SVN stores repository information as files--e.g., .svn and svn-commit.tmp --in your working directory:

$ ls -al
drwxr-xr-x  8 rmorelli  rmorelli  272 Apr 14 09:27 .svn
-rw-r--r--  1 rmorelli  rmorelli   69 Apr 14 09:12 README.txt
-rw-r--r--  1 rmorelli  rmorelli  731 Apr 14 09:27 countbyM.php
-rw-r--r--  1 rmorelli  rmorelli  912 Apr 14 09:10 hello.php
-rw-r--r--  1 rmorelli  rmorelli   66 Apr 14 09:13 svn-commit.tmp

This means you don't have to give the path to the directory when you want to commit or update your working copy.

Editing and Committing to the Repository

Now let's suppose you edit and revise the README.txt file. You will now want to commit your project to the repository:

$ svn commit -m "My first commit"
Sending        README.txt
Transmitting file data .
Committed revision 2.

The -m flag in this example is a command-line message that summarizes the change that you made. As you can see from the SVN output, the README.txt file was transmitted to the repository.

To update your current version of the project, you use the update command:

$ svn update
U    countbyM.php
Updated to revision 3.

As this example shows, the countbyM.php files is updated (U), which means someone else working on the project must have modified it.

To see other SVN commands, use the help command:

$ svn help
usage: svn <subcommand> [options] [args]
Subversion command-line client, version 1.4.4.
Type 'svn help <subcommand>' for help on a specific subcommand.
Type 'svn --version' to see the program version and RA modules
  or 'svn --version --quiet' to see just the version number.

Most subcommands take file and/or directory arguments, recursing
on the directories.  If no arguments are supplied to such a
command, it recurses on the current directory (inclusive) by default.

Available subcommands:
   add
   blame (praise, annotate, ann)
   cat
   checkout (co)
   cleanup
   commit (ci)
   copy (cp)
   delete (del, remove, rm)
   diff (di)
   export
   help (?, h)
   import
   info
   list (ls)
   lock
   log
   merge
   mkdir
   move (mv, rename, ren)
   propdel (pdel, pd)
   propedit (pedit, pe)
   propget (pget, pg)
   proplist (plist, pl)
   propset (pset, ps)
   resolved
   revert
   status (stat, st)
   switch (sw)
   unlock
   update (up)


Downloading VMOSS from Sourceforge

To download VMOSS from the sourceforge repository, we use yet a third protocol:

$  svn co https://vmoss.svn.sourceforge.net/svnroot/vmoss/vmoss-dev/branches/vmoss110 vmoss

This will download the VMOSS source code from the vmoss110 branch and store it in a directory named vmoss within your current working directory. The protocol here is https, a secure http channel. You do not need a Sourceforge account to download the source code, but you will be prompted to okay the security certificate to verify that this is really the Sourceforge site.