New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Developers/SVN_QuickReference – NEMO
wiki:Developers/SVN_QuickReference

Version 40 (modified by nicolasmartin, 6 years ago) (diff)

--

SubVersioN basics customized for NEMO

Last edited at Wikinfo(changed_ts)? by Wikinfo(changed_by)?

Error: Failed to load processor box
No macro or processor named 'box' found

Branching

Create a branch

For development branches, we tend to add one level of subdirectory corresponding to the current year, and an additional item in the name corresponding to the workplan. For branch naming conventions, see Developers/DevelopingCodeChanges.

svn copy trunk branches/'Current_year'/'Name_of_the_new_branch'

Switch to the trunk (hazardous)

Your working copy was based on a given branch and you want to mirror a new branch, conflicts unavoidable and pretty complicated to resolve.

svn sw 'URL[@PEGREV] [PATH]'

Delete a branch

svn del 'Path/to/the/branch/to/delete'

Manage versioned items (file / folder)

Add a new NEMO routine

Use the template from NEMO/trunk/src/OCE/module_example

svn copy trunk/src/OCE/module_example branches/'Current_year'/'dev_branch'/'path/to/the/new/routine.{f90, F90, h90}'

Add a new item / Remove a [remote] item

svn add 'PATH...'
svn del '{PATH..., URL...}'

Manage versioned properties on items

svn:keywords for commit infos

If the svn:keywords property is not defined on a NEMO routine, set it in order to get the functionality of $Id keyword replacement in all committed files with the commit informations (URL, author, date and revision)

svn pset svn:keywords Id 'path/to/the/new/routine.{f90, F90, h90, sh}'

svn:mime-type for syntax highlighting

Most of versioned files
If you want to apply a specific

svn:executable for shell scripts

svn pset svn:executable 'path/to/the/script'.sh
svn pdel svn:executable 'path/to/the/script'.sh

svn:externals for external sources

Merging

Update item between branches

Suppose the downloaded NEMO directory corresponds to the tag nemo_v3 (i.e. from http://forge.ipsl.jussieu.fr/nemo/svn/tags/nemo_v3/NEMO); the current revision number of the file sbcssm.F90 is 1196. To get the new revision (which has been committed on the trunk http://forge.ipsl.jussieu.fr/nemo/svn/trunk/NEMO ) with the revision number 1214:

svn merge 'sourceWCPATH1@REV1 sourceWCPATH2@REV2 [WCPATH]'

To get all changes from the revision 746 to the current one (HEAD) on a specific directory

# (you have already downloaded the branch you are working on)
cd ./NEMO/OPA_SRC/IOM
svn merge -r 746:HEAD -m 'Merge my local IOM directory with the trunk repository'                               \
          svn+ssh://'your_forge_login'@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk/NEMO/OPA_SRC/IOM \

Revert local changes / Commit changes to the repository

svn co [-m 'log message in one line'] items
Error: Failed to load processor box
No macro or processor named 'box' found

Then in the appropriate directory

# Commit and write the log message (ticket link #.... and so on) in your editor
svn ci files_list
# `svn ci` without files list will commit all modified files recursively from the current directory
# or directly from the command line of the shell session
svn ci -m 'log_message' files_list
# Tip: set your editor for SVN for multi-lines commit message
# for sh  and other related shells, interesting to include it in ~/.profile or ~/.bash_profile)
export SVN_EDITOR='your_favourite_editor' 
# for csh  "    "      "      ""  ,      "      ""    "    "" "" ~/.login                     )
setenv SVN_EDITOR='your_favourite_editor'

Push modified external items from a working copy

Use explicit option with SVN commit command, think that no revision has to be set on related ext def (equivalent to @HEAD)

svn ci --include-externals ... 

Information about the sources

To get information such as the PATH/URL you are working on, .i.e. trunk, branches .. and so on

cd ./NEMO && svn info

To get all commits/revision performed/associated on/to your working repository since its creation

cd ./NEMO && svn log --verbose --stop-on-copy

With the new layout of the repository, some may encounter downloading or updating issues with

svn co -r REV URL

Use instead the more robust syntax

svn co URL@PEG (REV ~ PEG)

See ​http://svnbook.red-bean.com/en/1.7/svn.advanced.pegrevs.html for more.