Changes between Version 51 and Version 52 of Developers/SVN_QuickReference
- Timestamp:
- 2018-11-09T01:41:15+01:00 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Developers/SVN_QuickReference
v51 v52 1 = SubVersioN basics customized for NEMO 1 = SubVersioN basics 2 3 Last edition on '''[[Wikinfo(changed_ts)]]''' by '''[[Wikinfo(changed_by)]]''' 2 4 3 5 [[PageOutline(2-3)]] 4 6 5 Last edited at '''[[Wikinfo(changed_ts)]]''' by '''[[Wikinfo(changed_by)]]''' 7 {{{#!sh 8 ## Definitions 6 9 7 {{{#!box type='note' width='75em' 8 Here we assumed that you are working locally with the default development organisation of the NEMO reference (trunk + branches + releases in your working directory), \\ 9 if not browse to [wiki:Developers#Recommendeddevelopmentinstallation Developers homepage] 10 ${REV} # SVN revision number 11 12 ${URL} # web address of a path in the SVN repository (URL scheme + relative path in the repository) 13 ## URL scheme depends on your role 14 ##- user: http://forge.ipsl.jussieu.fr/nemo/svn 15 ##- developer svn+ssh://${ID}@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn 16 17 ${WCPATH} # Working Copy PATH 10 18 }}} 11 19 12 == Branching20 == !Branching/Merging 13 21 14 === Create a branch 22 {{{#!th 23 Create a branch 24 }}} 25 {{{#!td 26 {{{#!sh 27 $ svn copy {${URL},${WCPATH}}[@${REV}] {${URL},${WCPATH}} 28 }}} 29 }}} 30 |- 31 {{{#!th 32 Update to a different URL 33 }}} 34 {{{#!td 35 Mirror a different branch $i.e$ traversing branch in the same repository (__hazardous!! __) 36 {{{#!sh 37 $ svn switch ${URL}[@${REV}] [${WCPATH}] 38 }}} 15 39 16 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 [wiki:Developers/DevelopingCodeChanges]. 40 Relocate to a different URL $i.e$ keep the same branch but move to a new server or URL scheme 41 {{{#!sh 42 $ svn switch --relocate ${URL1}[@${REV1}] ${URL2}[@${REV2}] 43 }}} 44 }}} 45 |- 46 {{{#!th 47 Merging sources 48 }}} 49 {{{#!td 50 Apply the differences between two sources to a working copy path 17 51 18 {{{#!sh 19 svn copy trunk@${PEGREV} branches/$year/'dev_r'${PEGREV}_$NameOfNewBranch 20 }}} 21 22 === Mirror a different branch (hazardous) 23 24 Your working copy was based on your initial dev. branch and you want to update to a different branch, conflicts are unavoidable and will be pretty complicated to resolve. 25 26 {{{#!sh 27 svn sw URL[@$PEGREV] [$WCPATH] 52 {{{#!sh 53 $ svn merge {${URL1},${WCPATH1}}[@${REV1}] {${URL1},${WCPATH2}}[@${REV2}] [${WCPATH}] 54 }}} 28 55 }}} 29 56 30 57 == Manage versioned items 31 58 32 === Add a new NEMO routine 33 34 Use the template from [source:/NEMO/trunk/src/OCE/module_example] 35 36 {{{#!sh 37 svn copy src/OCE/module_example src/$PATH/$routine.{f90,F90,h90} 59 {{{#!th 60 !Add/Remove a item \\ 61 (file or folder) 38 62 }}} 39 40 {{{#!comment 41 Explanation missing for available extensions 63 {{{#!td 64 {{{#!sh 65 $ svn {add,del} ${WCPATH} 66 }}} 42 67 }}} 43 44 === Add a new item / Remove a item 45 46 {{{#!sh 47 svn {add,del} $WCPATH 68 |- 69 {{{#!th 70 Info / Status / Log 48 71 }}} 49 50 === Info / Status / Log 51 72 {{{#!td 52 73 Display information about a local or remote item 53 74 54 75 {{{#!sh 55 svn info $WCPATH[@$PEGREV]76 $ svn info [{${WCPATH},${URL}}][@${REV}] 56 77 }}} 57 78 58 Display the current state of the working copywrt the one mirrored in the repository79 Display the current state of the working path wrt the one mirrored in the repository 59 80 60 81 {{{#!sh 61 svn status [-[qu]] [$WCPATH]82 $ svn status [-[qu]] [${WCPATH}] 62 83 }}} 63 84 64 Display all commits performed to your working repositorysince its creation85 Display all commits performed to your working path since its creation 65 86 66 87 {{{#!sh 67 svn log --verbose --stop-on-copy $WCPATH 88 $ svn log --verbose --stop-on-copy ${WCPATH} 89 }}} 90 }}} 91 |- 92 {{{#!th 93 Revert local changes 94 }}} 95 {{{#!td 96 {{{#!sh 97 $ svn revert ${WCPATH} 98 }}} 68 99 }}} 69 100 70 === Revert local changes 101 == Manage versioned SVN properties on items 102 103 === Set properties 104 105 {{{#!th 106 `svn:keywords`: log record of last commit in routine 107 }}} 108 {{{#!td 109 {{{#!sh 110 $ svn propset svn:keywords Id on ${WCPATH} 111 }}} 112 }}} 113 |- 114 {{{#!th 115 `svn:mime-type`: syntax highlighting and merging process 116 }}} 117 {{{#!td 118 119 }}} 120 |- 121 {{{#!th 122 `svn:executable`: executable permissions of shell scripts 123 }}} 124 {{{#!td 125 {{{#!sh 126 $ svn propset svn:executable on ${WCPATH} 127 }}} 128 }}} 129 |- 130 {{{#!th 131 `svn:externals`: defining external sources 132 }}} 133 {{{#!td 134 Single external example 135 {{{#!sh 136 $ svn propset svn:externals ${URL}[@${REV}] ${WCPATH} 137 }}} 138 Multi externals example using an editor 139 {{{#!sh 140 $ svn propedit svn:externals ${WCPATH} 141 }}} 142 }}} 143 144 === Delete a property 71 145 72 146 {{{#!sh 73 svn revert [--depth {empty,files,immediates,infinity}] $WCPATH 147 $ svn propdel ${SVN_PROPERTY} ${WCPATH} 74 148 }}} 75 149 76 == Manage versioned properties on items 77 78 === `svn:keywords` for commit infos on routines 79 80 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) 150 == Push changes to the repository 81 151 82 152 {{{#!sh 83 svn pset svn:keywords Id $WCPATH 84 }}} 85 86 === `svn:mime-type` for syntax highlighting and merging process 87 88 Most of versioned files \\ 89 If you want to apply a specific 90 91 === `svn:executable` for executable permissions of shell scripts 92 93 {{{#!sh 94 svn {pset,pdel} svn:executable $WCPATH 95 }}} 96 97 === `svn:externals` for defining external sources 98 99 100 == Merging sources 101 102 Apply the differences between two sources to a working copy path 103 104 {{{#!sh 105 svn merge $WCPATH1@$REV1 $WCPATH2@$REV2 [$WCPATH] 106 }}} 107 108 == Commit changes to the repository 109 110 {{{#!sh 111 svn ci [-m 'log message in one line'] items 153 $ svn ci [-m 'log message in one line'] items 112 154 }}} 113 155 … … 118 160 {{{#!sh 119 161 # Commit and write the log message (ticket link #.... and so on) in your editor 120 svn ci files_list162 $ svn ci files_list 121 163 # `svn ci` without files list will commit all modified files recursively from the current directory 122 164 # or directly from the command line of the shell session 123 svn ci -m 'log_message' files_list165 $ svn ci -m 'log_message' files_list 124 166 # Tip: set your editor for SVN for multi-lines commit message 125 167 # for sh and other related shells, interesting to include it in ~/.profile or ~/.bash_profile) 126 export SVN_EDITOR='your_favourite_editor'168 $ export SVN_EDITOR='your_favourite_editor' 127 169 # for csh " " " "" , " "" " "" "" ~/.login ) 128 setenv SVN_EDITOR='your_favourite_editor'170 $ setenv SVN_EDITOR='your_favourite_editor' 129 171 }}} 130 172 … … 134 176 135 177 {{{#!sh 136 svn ci --include-externals ...178 $ svn ci --include-externals ... 137 179 }}} 138 180 … … 142 184 143 185 {{{#!sh 144 svn co -r $REV $URL 186 $ svn co -r ${REV} ${URL} 145 187 }}} 146 188 … … 148 190 149 191 {{{#!sh 150 svn co $URL@$PEGREV 192 $ svn co ${URL}@${REV} 151 193 }}} 152 194 153 See http://svnbook.red-bean.com/en/1.7/svn.advanced. pegrevs.html for more.195 See http://svnbook.red-bean.com/en/1.7/svn.advanced.REVs.html for more.