Changes between Version 19 and Version 20 of Developers/SVN_QuickReference
- Timestamp:
- 2017-06-07T20:17:18+02:00 (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Developers/SVN_QuickReference
v19 v20 1 [[PageOutline]] 1 = '''Working with SVN and tickets''' 2 2 3 = '''Working with SVN and tickets''' = 3 [[PageOutline(2)]] 4 4 5 Last edited at '''[[Wikinfo(changed_ts)]]''' by '''[[Wikinfo(changed_by)]]''' 5 6 6 ----7 7 == How to get permissions for committing on the SVN repository 8 8 … … 15 15 === For external users 16 16 17 Submit your contribution to the NEMO System Team by creating a [/newticket?type=Enhancement ticket] where you will present your proposal. [[BR]]17 Submit your contribution to the NEMO System Team by creating a [/newticket?type=Enhancement ticket] where you will present your proposal.\\ 18 18 Keep 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 replacement21 19 22 {{{ 20 == Document your developments before coding 21 22 Follow the procedure described at [wiki:Developers/WorkingPractices] 23 24 == How-to with SVN commands 25 26 === How to create a new routine 27 28 Use the template source:trunk/NEMOGCM/NEMO/OPA_SRC/module_example \\ 29 If 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 23 32 svn propset svn:keywords Id New_routine.f90 24 33 }}} 25 == How to make a branch ==26 For branch naming conventions, see https://forge.ipsl.jussieu.fr/nemo/wiki/Developers/WorkingPractices#CreateaBranch27 34 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 37 For branch naming conventions, see wiki:Developers/WorkingPractices#Startthecoding 38 39 {{{#!sh 40 svn 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" 30 41 }}} 42 31 43 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 work-plan,for instance: 32 44 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 46 svn 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" 35 47 }}} 36 == How to make a commit == 48 49 === How to make a commit 50 37 51 Extract with svn+http protocol 38 52 39 {{{ 40 svn co svn+ssh:// yourloginforge@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/dev_001_SBC53 {{{#!sh 54 svn co svn+ssh://"your_forge_login"@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/dev_001_SBC 41 55 }}} 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)43 56 44 {{{ 45 svn ci -m [ "#ticket_number : bla bla ... ] [ files list ] 57 Then in the appropriate directory : 58 59 {{{#!sh 60 # Tip: set your editor vi, vim, emacs, nano, ... 61 export SVN_EDITOR="your_favourite_editor" # for sh and other related shells, interesting to include it in ~/.profile or ~/.bash_profile) 62 setenv SVN_EDITOR="your_favourite_editor" # for csh " " " "" , " "" " "" "" ~/.login ) 63 # Commit and write the log message (ticket link #.... and so on) in your editor 64 svn ci 'files list' 65 # or directly from the command line of the shell session 66 svn ci -m 'log message with ticket link #.... and so on' 'files list' 46 67 }}} 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 72 svn 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" 50 73 }}} 51 == How to make a merge == 74 75 === How to make a merge 76 52 77 To get all changes from the revision 746 to the current one (HEAD) on a specific directory 53 78 54 {{{ 55 cd ./NEMO/OPA_SRC/IOM (you already downloaded the brancheyou 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 80 cd ./NEMO/OPA_SRC/IOM # (you have already downloaded the branch you are working on) 81 svn 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 " 57 82 }}} 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 59 86 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: 60 87 61 {{{ 88 {{{#!sh 62 89 cd ./modeles/NEMO/OPA_SRC/SBC/ 63 90 svn merge -r 1196:1214 http://forge.ipsl.jussieu.fr/nemo/svn/trunk/NEMO/OPA_SRC/SBC/sbcssm.F90 64 91 }}} 65 == How to get information about the sources downloaded == 92 93 === How to get information about the sources downloaded 94 66 95 To get information such as the PATH/URL you are working on, .i.e. trunk, branches .. and so on 67 96 68 {{{ 97 {{{#!sh 69 98 cd ./NEMO 70 99 svn info 71 100 }}} 101 72 102 To get all commits/''revision'' performed/''associated'' on/''to'' your working repository since its creation 73 103 74 {{{ 104 {{{#!sh 75 105 cd ./NEMO 76 106 svn log --verbose --stop-on-copy 77 107 }}} 78 == Switch from user to developer == 108 109 === Switch from user to developer 110 79 111 The 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 114 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 82 115 }}} 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 85 120 svn switch http://forge.ipsl.jussieu.fr/nemo/svn/trunk/NEMOGCM 121 }}} 86 122 87 }}}88 123 Comments: takes some time and asks if conflicts 89 124 90 == How to delete a branch ==125 === How to delete a branch 91 126 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 128 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" 94 129 }}} 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 link98 99 ----