Chapter C7
Using SVN

SVN is a version control system, which allows you to keep old versions of files (usually source code), log of when, and why changes occurred, and who made them, etc. SVN does not just operate on one file at a time or one directory at a time, but operates on hierarchical collections of directories consisting of version controlled files. SVN helps to manage releases and to control the concurrent editing of source files among multiple authors. SVN can be obtained from http://subversion.apache.org, but is usually available on workstations, or can be easily installed using a package manager.

An SVN repository located on a server contains a hierarchy of directory and files, and any subdirectory can be checked out independently. The Cactus flesh and the Cactus arrangements are organized as repositories on the server svn.cactuscode.org. You can browse the contents of this repository using a web browser at the URL http://svn.cactuscode.org.

You do not need to know about SVN in order to download or update Cactus using the GetComponents script, though you must have SVN installed. In order to contribute changes to Cactus files or your own thorns, which may also be stored in SVN, you will need a basic understanding of SVN. For more information about

C7.1 Essential SVN Commands

Assuming that you have checked out Cactus using the GetComponents script, the following commands are the minimum you will need in order to work with SVN in Cactus.

svn update

Execute this command from within your working directory when you wish to update your copies of source files from changes that other developers have made to the source in the repository. Merges are performed automatically when possible, a warning is issued if manual resolution is required for conflicting changes.

svn add file

Use this command to enroll new files in SVN records of your working directory. The files will be added to the repository the next time you run ‘svn commit’.

svn commit file

Use this command to add your local changes to the source to the repository and, thereby, making it publically available to checkouts and updates by other users. You cannot commit a newly created file unless you have added it.

svn diff file

Show differences between a file in your working directory and a file in the source repository, or between two revisions in source repository. (Does not change either repository or working directory.) For example, to see the difference between versions 1.8 and 1.9 of a file foobar.c:

svn diff -r 1.8 1.9 foobar.c

svn remove file

Remove files from the source repository, pending an svn commit on the same files.

svn status [file]

This command returns the current status of your local copy relative to the repository: e.g. it indicates local modifications and possible updates.

For more information about using SVN, you can read the documentation provided at http://svnbook.red-bean.com.