Source Code Repositories

Last Updated: 30 Apr 2012

Creating and Using Subversion Repositories

Subversion: Provides a version control system for managing source files, and documents. Both svn and svnadmin commands are included in the version control system.

Revision control is a key component for software development. Subversion is a well-known centralized version control system installed on all participating HPCMP systems. Due to system configuration differences, users running svn commands to remote systems from ARL DSRC systems must prepend /usr/brl/bin to their $PATH.

When using subversion to host repositories on HPCMP systems, the svn+ssh:// protocol method must be used. This will make changes over the HCPMP Kerberos ssh.

The following is a sample set of instructions for creating and using a subversion repository on HPCMP systems. The user guide for subversion can be found at the project website: http://subversion.apache.org/docs/.

Creating a New Repository:

Each system has the subversion commands installed in the default path after login. To create a new repository on an HPCMP system, first login to the system that will host the repository and execute the following command:

svnadmin create /path/to/root_location

e.g.

svnadmin create $HOME/svn/bct

In the above example, the $HOME/svn directory should already exist, but $HOME/svn/bct should not.

Adding Files

If there is an existing directory structure that should be moved into the repository, use the import directive:

svn import /path/to/import file:///path/to/root_location

Alternatively, if the files to be imported are on a different system then login to that system and execute the following command:

svn import /path/to/import \
svn+ssh://us.afrl.hpc.mil/u/home/jdoe/svn/bct

In the above example we assume that the destination system is the AFRL Utility Server (us.afrl.hpc.mil) and the user is jdoe.

Checking out Files

The next step is to access the files and check out a version of the repository. On any system, execute the following command:

svn co svn+ssh://us.afrl.hpc.mil/u/home/jdoe/svn/bct

This will check out a copy of the current version of the repository into the current directory that has the same name 'bct', as the repository.

Revising Files

Before making any changes, make sure the working copy is the latest available. The svn update command updates the working copy to the latest.

Making revisions to files, adding new files, deleting files, and checking in changes are done using the svn add, svn delete, svn commit commands respectively. Other options such as svn diff, svn status, svn revert are other commands that are key to using subversion and are explained in greater detail in the subversion user guide.

Last Updated: 04.30.2012