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 (diff) – NEMO

Changes between Version 51 and Version 52 of Developers/SVN_QuickReference


Ignore:
Timestamp:
2018-11-09T01:41:15+01:00 (5 years ago)
Author:
nicolasmartin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Developers/SVN_QuickReference

    v51 v52  
    1 = SubVersioN basics customized for NEMO 
     1= SubVersioN basics 
     2 
     3Last edition on '''[[Wikinfo(changed_ts)]]''' by '''[[Wikinfo(changed_by)]]''' 
    24 
    35[[PageOutline(2-3)]] 
    46 
    5 Last edited at '''[[Wikinfo(changed_ts)]]''' by '''[[Wikinfo(changed_by)]]''' 
     7{{{#!sh 
     8## Definitions 
    69 
    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 
    1018}}} 
    1119 
    12 == Branching 
     20== !Branching/Merging 
    1321 
    14 === Create a branch 
     22{{{#!th 
     23Create a branch 
     24}}} 
     25{{{#!td 
     26   {{{#!sh 
     27   $ svn copy {${URL},${WCPATH}}[@${REV}] {${URL},${WCPATH}} 
     28   }}} 
     29}}} 
     30|- 
     31{{{#!th 
     32Update to a different URL 
     33}}} 
     34{{{#!td 
     35Mirror a different branch $i.e$ traversing branch in the same repository (__hazardous!! __) 
     36   {{{#!sh 
     37   $ svn switch ${URL}[@${REV}] [${WCPATH}] 
     38   }}} 
    1539 
    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]. 
     40Relocate 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 
     47Merging sources 
     48}}} 
     49{{{#!td 
     50Apply the differences between two sources to a working copy path 
    1751 
    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   }}} 
    2855}}} 
    2956 
    3057== Manage versioned items 
    3158 
    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) 
    3862}}} 
    39  
    40 {{{#!comment 
    41 Explanation missing for available extensions 
     63{{{#!td 
     64   {{{#!sh 
     65   $ svn {add,del} ${WCPATH} 
     66   }}} 
    4267}}} 
    43  
    44 === Add a new item / Remove a item 
    45  
    46 {{{#!sh 
    47 svn {add,del} $WCPATH 
     68|- 
     69{{{#!th 
     70Info / Status / Log 
    4871}}} 
    49  
    50 === Info / Status / Log 
    51  
     72{{{#!td 
    5273Display information about a local or remote item 
    5374 
    5475{{{#!sh 
    55 svn info $WCPATH[@$PEGREV] 
     76$ svn info [{${WCPATH},${URL}}][@${REV}] 
    5677}}} 
    5778 
    58 Display the current state of the working copy wrt the one mirrored in the repository 
     79Display the current state of the working path wrt the one mirrored in the repository 
    5980 
    6081{{{#!sh 
    61 svn status [-[qu]] [$WCPATH] 
     82$ svn status [-[qu]] [${WCPATH}] 
    6283}}} 
    6384 
    64 Display all commits performed to your working repository since its creation 
     85Display all commits performed to your working path since its creation 
    6586 
    6687{{{#!sh 
    67 svn log --verbose --stop-on-copy $WCPATH 
     88$ svn log --verbose --stop-on-copy ${WCPATH} 
     89}}} 
     90}}} 
     91|- 
     92{{{#!th 
     93Revert local changes 
     94}}} 
     95{{{#!td 
     96   {{{#!sh 
     97   $ svn revert  ${WCPATH} 
     98   }}} 
    6899}}} 
    69100 
    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 
     134Single external example 
     135   {{{#!sh 
     136   $ svn propset svn:externals ${URL}[@${REV}] ${WCPATH} 
     137   }}} 
     138Multi externals example using an editor 
     139   {{{#!sh 
     140   $ svn propedit svn:externals ${WCPATH} 
     141   }}} 
     142}}} 
     143 
     144=== Delete a property 
    71145 
    72146{{{#!sh 
    73 svn revert [--depth {empty,files,immediates,infinity}] $WCPATH 
     147$ svn propdel ${SVN_PROPERTY} ${WCPATH} 
    74148}}} 
    75149 
    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 
    81151 
    82152{{{#!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 
    112154}}} 
    113155 
     
    118160{{{#!sh 
    119161# Commit and write the log message (ticket link #.... and so on) in your editor 
    120 svn ci files_list 
     162$ svn ci files_list 
    121163# `svn ci` without files list will commit all modified files recursively from the current directory 
    122164# or directly from the command line of the shell session 
    123 svn ci -m 'log_message' files_list 
     165$ svn ci -m 'log_message' files_list 
    124166# Tip: set your editor for SVN for multi-lines commit message 
    125167# 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'  
    127169# for csh  "    "      "      ""  ,      "      ""    "    "" "" ~/.login                     ) 
    128 setenv SVN_EDITOR='your_favourite_editor' 
     170$ setenv SVN_EDITOR='your_favourite_editor' 
    129171}}} 
    130172 
     
    134176 
    135177{{{#!sh 
    136 svn ci --include-externals ...  
     178$ svn ci --include-externals ...  
    137179}}} 
    138180 
     
    142184 
    143185{{{#!sh 
    144 svn co -r $REV $URL 
     186$ svn co -r ${REV} ${URL} 
    145187}}} 
    146188 
     
    148190 
    149191{{{#!sh 
    150 svn co $URL@$PEGREV 
     192$ svn co ${URL}@${REV} 
    151193}}} 
    152194 
    153 See ​http://svnbook.red-bean.com/en/1.7/svn.advanced.pegrevs.html for more. 
     195See ​http://svnbook.red-bean.com/en/1.7/svn.advanced.REVs.html for more.