Changes between Version 19 and Version 20 of Developers/SVN_Quick Reference


Ignore:
Timestamp:
2017-06-07T20:17:18+02:00 (3 years ago)
Author:
nicolasmartin
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Developers/SVN_Quick Reference

    v19 v20  
    1 [[PageOutline]] 
     1= '''Working with SVN and tickets''' 
    22 
    3 = '''Working with SVN and tickets''' = 
     3[[PageOutline(2)]] 
     4 
    45Last edited at '''[[Wikinfo(changed_ts)]]''' by '''[[Wikinfo(changed_by)]]''' 
    56 
    6 ---- 
    77== How to get permissions for committing on the SVN repository 
    88 
     
    1515=== For external users 
    1616 
    17 Submit your contribution to the NEMO System Team by creating a [/newticket?type=Enhancement ticket] where you will present your proposal.[[BR]] 
     17Submit your contribution to the NEMO System Team by creating a [/newticket?type=Enhancement ticket] where you will present your proposal.\\ 
    1818Keep in mind that, despite the help we can offer, a certain amount of work from you will be need to implement your developments into the source code. 
    19 == How to create a new routine == 
    20 Use the template source:trunk/NEMOGCM/NEMO/OPA_SRC/module_example [[BR]] If not don't forget to set the SVN property of the routine in order to get the functionality of SVN Id keyword replacement 
    2119 
    22 {{{ 
     20== Document your developments before coding 
     21 
     22Follow the procedure described at [wiki:Developers/WorkingPractices] 
     23 
     24== How-to with SVN commands 
     25 
     26=== How to create a new routine 
     27 
     28Use the template source:trunk/NEMOGCM/NEMO/OPA_SRC/module_example \\ 
     29If not don't forget to set the SVN property of the routine in order to get the functionality of SVN Id keyword replacement 
     30 
     31{{{#!sh 
    2332svn propset svn:keywords Id New_routine.f90 
    2433}}} 
    25 == How to make a branch == 
    26 For branch naming conventions, see https://forge.ipsl.jussieu.fr/nemo/wiki/Developers/WorkingPractices#CreateaBranch 
    2734 
    28 {{{ 
    29 svn copy svn+ssh://yourloginforge@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk svn+ssh://yourloginforge@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/dev_r1720_SBC -m "Create a specific branch for the New Surface Module" 
     35=== How to make a branch 
     36 
     37For branch naming conventions, see wiki:Developers/WorkingPractices#Startthecoding 
     38 
     39{{{#!sh 
     40svn copy svn+ssh://"your_forge_login"@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk svn+ssh://"your_forge_login"@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/dev_r1720_SBC -m "Create a specific branch for the New Surface Module" 
    3041}}} 
     42 
    3143For 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 work-plan,for instance: 
    3244 
    33 {{{ 
    34 svn copy svn+ssh://yourloginforge@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk svn+ssh://yourloginforge@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/2011/dev_r1720_LOCEAN1_mpp -m "Create a specific branch  for mpp evolution" 
     45{{{#!sh 
     46svn copy svn+ssh://"your_forge_login"@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk svn+ssh://"your_forge_login"@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/2011/dev_r1720_LOCEAN1_mpp -m "Create a specific branch  for mpp evolution" 
    3547}}} 
    36 == How to make a commit == 
     48 
     49=== How to make a commit 
     50 
    3751Extract with svn+http protocol 
    3852 
    39 {{{ 
    40 svn co svn+ssh://yourloginforge@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/dev_001_SBC 
     53{{{#!sh 
     54svn co svn+ssh://"your_forge_login"@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/dev_001_SBC 
    4155}}} 
    42 Then in the appropriate directory : export SVN_EDITOR=vi      (ksh, bash, to put in .profile or .bash_profile) or setenv SVN_EDITOR vi        (tsch, to put in .login) 
    4356 
    44 {{{ 
    45 svn ci  -m [ "#ticket_number : bla bla ... ] [ files list ] 
     57Then in the appropriate directory : 
     58 
     59{{{#!sh 
     60# Tip: set your editor vi, vim, emacs, nano, ... 
     61export SVN_EDITOR="your_favourite_editor" # for sh  and other related shells, interesting to include it in ~/.profile or ~/.bash_profile) 
     62setenv SVN_EDITOR="your_favourite_editor" # for csh  "    "      "      ""  ,      "      ""    "    "" "" ~/.login                     ) 
     63# Commit and write the log message (ticket link #.... and so on) in your editor 
     64svn ci 'files list' 
     65# or directly from the command line of the shell session 
     66svn ci  -m 'log message with ticket link #.... and so on' 'files list' 
    4667}}} 
    47 == How to make a tag == 
    48 {{{ 
    49 svn copy svn+ssh://yourloginforge@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk  svn+ssh://yourloginforge@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/tags/nemo_v2_3 -m "Tagging nemo_v2_3" 
     68 
     69=== How to make a tag 
     70 
     71{{{#!sh 
     72svn copy svn+ssh://"your_forge_login"@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk  svn+ssh://"your_forge_login"@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/tags/nemo_v2_3 -m "Tagging nemo_v2_3" 
    5073}}} 
    51 == How to make a merge == 
     74 
     75=== How to make a merge 
     76 
    5277To get all changes from the revision 746 to the current one (HEAD) on a specific directory 
    5378 
    54 {{{ 
    55 cd ./NEMO/OPA_SRC/IOM (you already downloaded the branche you are working on) 
    56 svn merge -r 746:HEAD svn+ssh://yourloginforge@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk/NEMO/OPA_SRC/IOM -m "Merge my local IOM directory with the trunk repository " 
     79{{{#!sh 
     80cd ./NEMO/OPA_SRC/IOM # (you have already downloaded the branch you are working on) 
     81svn merge -r 746:HEAD svn+ssh://"your_forge_login"@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk/NEMO/OPA_SRC/IOM -m "Merge my local IOM directory with the trunk repository " 
    5782}}} 
    58 == How to make an update of a given file between 2 different branches e.g trunk and tags directories == 
     83 
     84=== How to make an update of a given file between 2 different branches e.g trunk and tags directories 
     85 
    5986Suppose 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: 
    6087 
    61 {{{ 
     88{{{#!sh 
    6289cd ./modeles/NEMO/OPA_SRC/SBC/ 
    6390svn merge -r 1196:1214 http://forge.ipsl.jussieu.fr/nemo/svn/trunk/NEMO/OPA_SRC/SBC/sbcssm.F90 
    6491}}} 
    65 == How to get information about the sources downloaded == 
     92 
     93=== How to get information about the sources downloaded 
     94 
    6695To get information such as the PATH/URL you are working on, .i.e. trunk, branches .. and so on 
    6796 
    68 {{{ 
     97{{{#!sh 
    6998cd ./NEMO 
    7099svn info 
    71100}}} 
     101 
    72102To get all commits/''revision'' performed/''associated'' on/''to'' your working repository since its creation 
    73103 
    74 {{{ 
     104{{{#!sh 
    75105cd ./NEMO 
    76106svn log --verbose --stop-on-copy 
    77107}}} 
    78 == Switch from user to developer == 
     108 
     109=== Switch from user to developer 
     110 
    79111The following command is set for the trunk, adapt as required for your developing branch. 
    80 {{{ 
    81 svn switch --relocate http://forge.ipsl.jussieu.fr/nemo/svn/trunk/NEMOGCM svn+ssh://{your_forge_login}@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk/NEMOGCM 
     112 
     113{{{#!sh 
     114svn switch --relocate http://forge.ipsl.jussieu.fr/nemo/svn/trunk/NEMOGCM svn+ssh://"your_forge_login"@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk/NEMOGCM 
    82115}}} 
    83 == Switch from a branch to the trunk (your working copy was based on a given branch which has been moved to the trunk == 
    84 {{{ 
     116 
     117=== Switch from a branch to the trunk (your working copy was based on a given branch which has been moved to the trunk 
     118 
     119{{{#!sh 
    85120svn switch http://forge.ipsl.jussieu.fr/nemo/svn/trunk/NEMOGCM 
     121}}} 
    86122 
    87 }}} 
    88123Comments: takes some time and asks if conflicts 
    89124 
    90 == How to delete a branch == 
     125=== How to delete a branch 
    91126 
    92 {{{ 
    93 svn del svn+ssh://{your_forge_login}@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/2016/dev_rxxx_branch_name  --message "Delete defunct branch" 
     127{{{#!sh 
     128svn del svn+ssh://"your_forge_login"@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/2016/dev_rxxx_branch_name  --message "Delete defunct branch" 
    94129}}} 
    95  
    96 == How to create a ticket wiki page == 
    97 In your browser, open https://forge.ipsl.jussieu.fr/nemo/wiki/ticket/xxxx with xxxx the ticket number and choose NEMOTicketTemplate or in your ticket add the markup wiki:ticket/xxxx and follow the link 
    98  
    99 ----