Subversion: Difference between revisions

From WikiROMS
Jump to navigationJump to search
Line 14: Line 14:
To check-out the files from the ROMS repository '''trunk''' (latest version), enter (notice https instead of http):
To check-out the files from the ROMS repository '''trunk''' (latest version), enter (notice https instead of http):


     <span class="red">svn checkout <nowiki>https://www.myroms.org/svn/src/trunk</nowiki> mydir</span>  
     <span class="red">svn checkout <nowiki>https://www.myroms.org/svn/src/trunk</nowiki> MyDir</span>  


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:
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''':


     <span class="red">svn checkout --username joe_roms <nowiki>https://www.myroms.org/svn/src/trunk</nowiki> mydir</span>
     <span class="red">svn checkout --username joe_roms <nowiki>https://www.myroms.org/svn/src/trunk</nowiki> MyDir</span>


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:
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:


     <span class="red">svn checkout <nowiki>https://www.myroms.org/svn/src</nowiki> mydir</span>
     <span class="red">svn checkout <nowiki>https://www.myroms.org/svn/src</nowiki> MyDir</span>


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 [http://svnbook.red-bean.com/ svn book].
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 [http://svnbook.red-bean.com/ svn book].

Revision as of 14:03, 29 April 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 returning to a previous version if changes don't do what was expected. All the ROMS/TOMS files are stored on www.myroms.org/svn in a repository named src. Users can check out the most recent version to their local machines with a svn client. Since this is the official version of the code, only the developers are allowed to change this repository. However, users can have their own repository on their local computer.

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.

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:

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.

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)