Difference between revisions of "Subversion"

From WikiROMS
Jump to navigationJump to search
Line 33: Line 33:


==Using GUI SVN Clients==
==Using GUI SVN Clients==
Most of the GUI '''svn clients''' are very similar to each other. In this example we will use eSVN.
Most of the GUI '''svn clients''' are very similar to each other. In this example we will use eSVN, although several users have reported better luck with SmartSVN.


===View the Repository===
===View the Repository===

Revision as of 15:05, 30 May 2007

Subversion

ROMS source code is distributed using Subversion(SVN). There are SVN clients available for nearly every operating system and a list of popular clients can be found here. If you wish to use Subversion to maintain your own copy of ROMS you will also need an svn server. This page will help you get started with downloading ROMS with Subversion.

SVN Overview

Subversion is a tool for managing software development that keeps track of who modified what and allows the return to a previous version if changes don't work as expected. All the ROMS/TOMS files are stored in a SVN repository on www.myroms.org with access controlled by requiring authentication with the same ROMS Username/Password combination assigned to registered users of the ROMS Forum.

This SVN repository is the official version of the code which only the developers are allowed to change. Users should download the ROMS code to their local machines using an svn client. Don't attempt to use a regular web browser to browse or download files from the SVN repository - there are much better tools for interacting with the code repository. See the notes blow under the heading View the Repository.

We strongly recommend users always check out the current trunk version since this has the most recent updates and bug fixes. The tags version is kept largely as an historical record of stable releases at the conclusion of major code upgrades.

Below is a general description of how subversion works. Please look at the svn book for more detailed information. Brief instructions for using two GUI clients (one for PC and one for Linux) we've tried are included.

Using Subversion

In order download source code from a Subversion repository, svn client software must be installed on your local machine. If you are compiling subversion on your own be sure to build it with SSL support or you will not be able to download the ROMS source code. Most Linux distributions come with subversion (the command name is svn), so shell commands may be used without installing additional software. If your username on your local computer is not the same as your ROMS username you will need to pass the '--username <username>' option to svn; an example is given below. The general form of subversion commands is:

   svn action from to {optional_qualifiers} 

To check-out the files from the ROMS repository trunk (latest version), enter (notice https instead of http):

   svn checkout https://www.myroms.org/svn/src/trunk MyDir 

where MyDir is the destination directory on your local computer. It will be created if not found. If your username on your local computer is not the same as your ROMS username you will need to pass the --username option to svn:

   svn checkout --username joe_roms https://www.myroms.org/svn/src/trunk MyDir

To check-out the files from the ROMS repository branches, tags, and trunk, (this is not recomended because it takes a long time to complete) enter:

   svn checkout https://www.myroms.org/svn/src MyDir

You only check out once, after that, a hidden directory called .svn exists to keep track of the source, destination and a bunch of other information. Your username and password will also be saved. For more detail on command line use and syntax, see the svn book.

Several GUI front-ends to subversion exist, allowing the user to have visual prompts to help them manage their files.

Using GUI SVN Clients

Most of the GUI svn clients are very similar to each other. In this example we will use eSVN, although several users have reported better luck with SmartSVN.

View the Repository

The easiest way to view a repository is to simply look at it with Trac in a web browser. Enter the URL:

https://www.myroms.org/projects/src/browser

You will be prompted for your ROMS username and password. This is also a good way to see individual files in the repository without actually downloading them.

To view the repository with eSVN, Click on the file menu and choose "Browse Repository" and enter repository URL:

esvn browser.jpg

Click "Browse" and you should be able to look at the branches, tags, and trunk. You can navigate the repository with a web browser as described above, but cannot do any of the version control stuff that follows.

Checkout a Copy of the Trunk

This process brings a copy of the main code from the repository to your computer and places it under svn control. "Local Path" tells eSVN where you would like your copy of the source code to be located.

esvn checkout.jpg

You should see a bunch of text stream by like:

   svn checkout https://www.myroms.org/svn/src/trunk /home/ocean/src --username ocean 
   --password ****** --non-interactive 
   A /home/ocean/src/ROMS
   A /home/ocean/src/ROMS/License_ROMS.txt
   A /home/ocean/src/ROMS/Tangent
   A /home/ocean/src/ROMS/Tangent/tl_rho_eos.F
   A /home/ocean/src/ROMS/Tangent/tl_uv3dmix.F
   A /home/ocean/src/ROMS/Tangent/tl_def_his.F
   ...
   A /home/ocean/src/Compilers/UNICOS-mk-f90.mk
   A /home/ocean/src/Compilers/CYGWIN-g95.mk
   A /home/ocean/src/Compilers/OSF1-f90.mk
   A /home/ocean/src/Compilers/Darwin-ifort.mk
   A /home/ocean/src/Compilers/AIX-xlf.mk
   A /home/ocean/src/Compilers/SunOS-f95.mk
   A /home/ocean/src/makefile
   Checked out revision 11.
   successfully (0)