Diva SVN

From GHER

Revision as of 15:33, 15 June 2016 by Swat (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Reference book: http://svnbook.red-bean.com/

Also check the page GHER SVN page.

Contents

How to start?

What you need to do if to install and work on the code of Diva.

Download a new project (checkout)

svn checkout svn+ssh://username@modb.oce.ulg.ac.be/home/svn/repos/diva

where username has to be replaced by your corresponding name on MODB.

Modify the code

A few examples of things you can do:

  • Add newly created file into subversion
svn add filename
  • Create a new directory
svn mkdir newdirectory
  • Remove an unused file
svn rm filename
  • Move a file into another directory
svn mv filename newdirectory

etc.

Save the modification (commit)

svn commit -m 'message'

where message explains what has been modified (ex: 'added new scripts')

Update your version

svn update

Create a new release

A new release will consist of a copy of the trunk into a new directory (inside tags).

Command

svn copy svn+ssh://username@modb.oce.ulg.ac.be/home/svn/repos/diva/trunk 
svn+ssh://username@modb.oce.ulg.ac.be/home/svn/repos/diva/tags/diva-4.7.1 -m 'release 4.7.1'

Create the tar archive

tar --exclude=".*" -vczf diva-4.7.1.tgz diva-4.7.1

Upload on modb

The latest version of the code has to be made available at http://modb.oce.ulg.ac.be/mediawiki/index.php/DIVA#How_to_get_the_code.3F

while the older versions are copied at http://modb.oce.ulg.ac.be/mediawiki/index.php/Diva_old_versions

Development of the code

When working on significant changes, it may be useful to create a branch of the code.

Create a branch

In this example, I created a branch where I use environment variables for the directories.

svn copy svn+ssh://username@modb.oce.ulg.ac.be/home/svn/repos/diva/trunk/ 
svn+ssh://username@modb.oce.ulg.ac.be/home/svn/repos/diva/branches/diva_env_var_charles -m 'Introduce environment variables'

Merge branch with trunk

Once the modifications on the branch are finished, it is time to merge with the trunk.

svn merge svn+ssh://username@modb.oce.ulg.ac.be/home/svn/repos/diva/branches/diva_env_var_charles  
svn+ssh://username@modb.oce.ulg.ac.be/home/svn/repos/diva/trunk

Follow the modifications on the subversions

Get information

If you want to obtain information about different subversions:

  1. svn info --> to obtain the number of the last change
  2. svn log --> provide the information
svn info svn+ssh://username@modb.oce.ulg.ac.be/home/svn/repos/diva/tags/diva-4.4.2 | grep 'Last Changed Rev'
--> 2387
svn info svn+ssh://username@modb.oce.ulg.ac.be/home/svn/repos/diva/tags/diva-4.4.1 | grep 'Last Changed Rev'
--> 2371


svn log -v -q -r 2371:2387 svn+ssh://username@modb.oce.ulg.ac.be/home/svn/repos/diva/trunk
-->
r2379 | ctroupin | 2012-01-10 22:36:04 +0100 (Tue, 10 Jan 2012)                                                  
Changed paths:                                                                                                   
D /diva/trunk/src/Fortran/divacompile                                                                         
A /diva/trunk/src/Fortran/divacompile_options                                                                 
R /diva/trunk/src/Fortran/divacompileall                                                                      
D /diva/trunk/src/Fortran/divahccompile                                                                       
A /diva/trunk/src/Fortran/readme

Difference between two subversions

To see what differs from one subversion to another.

svn diff svn+ssh://username@modb.oce.ulg.ac.be/home/svn/repos/diva/tags/diva-4.4.2/ 
svn+ssh://username@modb.oce.ulg.ac.be/home/svn/repos/diva/trunk/
Personal tools