= SubVersioN basics customized for NEMO [[PageOutline(2-3)]] Last edited at '''[[Wikinfo(changed_ts)]]''' by '''[[Wikinfo(changed_by)]]''' {{{#!box type='note' width='75em' Here we assumed that you are working locally with the default development organisation of the NEMO reference (trunk + branches + releases in your working directory), \\ if not browse to [wiki:Developers#Recommendeddevelopmentinstallation Developers homepage] }}} == 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 [wiki:Developers/DevelopingCodeChanges]. {{{#!sh svn copy trunk@${PEGREV} branches/$year/'dev_r'${PEGREV}_$NameOfNewBranch }}} === Mirror a different branch (hazardous) 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. {{{#!sh svn sw URL[@$PEGREV] [$WCPATH] }}} == Manage versioned items === Add a new NEMO routine Use the template from [source:/NEMO/trunk/src/OCE/module_example] {{{#!sh svn copy src/OCE/module_example src/$PATH/$routine.{f90,F90,h90} }}} {{{#!comment Explanation missing for available extensions }}} === Add a new item / Remove a item {{{#!sh svn {add,del} $WCPATH }}} === Info / Status / Log Display information about a local or remote item {{{#!sh svn info $WCPATH[@$PEGREV] }}} Display the current state of the working copy wrt the one mirrored in the repository {{{#!sh svn status [-[qu]] [$WCPATH] }}} Display all commits performed to your working repository since its creation {{{#!sh svn log --verbose --stop-on-copy $WCPATH }}} === Revert local changes {{{#!sh svn revert [--depth {empty,files,immediates,infinity}] $WCPATH }}} == Manage versioned properties on items === `svn:keywords` for commit infos on routines 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) {{{#!sh svn pset svn:keywords Id $WCPATH }}} === `svn:mime-type` for syntax highlighting and merging process Most of versioned files \\ If you want to apply a specific === `svn:executable` for executable permissions of shell scripts {{{#!sh svn {pset,pdel} svn:executable $WCPATH }}} === `svn:externals` for defining external sources == Merging sources Apply the differences between two sources to a working copy path {{{#!sh svn merge $WCPATH1@$REV1 $WCPATH2@$REV2 [$WCPATH] }}} == Commit changes to the repository {{{#!sh svn ci [-m 'log message in one line'] items }}} ==== Then in the appropriate directory {{{#!sh # 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`)''' {{{#!sh svn ci --include-externals ... }}} ---- With the new layout of the repository, some may encounter downloading or updating issues with {{{#!sh svn co -r $REV $URL }}} Use instead the more robust syntax {{{#!sh svn co $URL@$PEGREV }}} See ​http://svnbook.red-bean.com/en/1.7/svn.advanced.pegrevs.html for more.