Changes between Initial Version and Version 1 of Doc/Tools/External/SvnBasic


Ignore:
Timestamp:
03/24/14 16:19:02 (10 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Doc/Tools/External/SvnBasic

    v1 v1  
     1{{{ 
     2#!html 
     3<h1> Basic commands to manage source versions: Subversion (<code>svn</code>)</h1> 
     4}}} 
     5 
     6 [[PageOutline]] 
     7 
     8## How to find help ## 
     9 
     10General help : 
     11 
     12{{{ 
     13#!sh 
     14svn help 
     15}}} 
     16 
     17Help for a specific command (e.g. {{{add}}}) 
     18 
     19{{{ 
     20#!sh 
     21svn help add 
     22}}} 
     23 
     24## How to create a workspace from a file repository ## 
     25 
     26In one of your directories, from a file repository identified by a URL: 
     27 
     28{{{ 
     29#!sh 
     30svn checkout URL directory 
     31}}} 
     32 
     33## How to find out about your workspace's status  ## 
     34 
     35To find out if a file has been modified since your last update ({{{checkout}}} or {{{update}}}) : 
     36{{{ 
     37#!sh 
     38svn status [namefile] 
     39}}} 
     40 
     41To find out if your file has been modified in its present state : 
     42{{{ 
     43#!sh 
     44svn status -u [namefile] 
     45}}} 
     46 
     47If a file's content has been modified, this will be shown in the 1st column. If a file's property has been modified, this will be shown in the 2nd column. 
     48 
     49 A:: 
     50    the file has been added in your workspace. It does not exist in the file repository. 
     51 D:: 
     52  the file has been deleted from your directory. It still exists in the file repository. 
     53 M:: 
     54  the file has been modified in your workspace. It is different than the file in the repository 
     55 
     56## How to find out the repository's status ## 
     57 
     58If you want to find out the changes that have been made in the svn sources repository : 
     59 
     60{{{ 
     61#!sh 
     62svn log -rHEAD:BASE 
     63}}} 
     64 
     65To find out all revisions (version number and message) related to a file ; 
     66{{{ 
     67#!sh 
     68svn log [namefile] 
     69}}} 
     70 
     71This information can be accessed via the related [wiki:DocKexterntools#forge forge] with the `Timeline` tag. 
     72 
     73 
     74## How to update your workspace ## 
     75 
     76[[NoteBox(warn, It is not recommended to update your workspace unless you have previously spoken with the persons in charge of each model components\, configurations or tools.)]] 
     77{{{ 
     78#!sh 
     79svn update [namefile] 
     80}}} 
     81 
     82Example : 
     83{{{ 
     84#!sh 
     85svn update toto 
     86U toto 
     87}}} 
     88 
     89The '''svn update''' command returns a letter (U, A, D, R, G or C) and the file name concerned. Below is the meaning of these letters : 
     90 U:: 
     91   The file has been updated properly. There is no conflict. 
     92 A:: 
     93   The file has been added to your directory, it did not exist before. 
     94 D:: 
     95   The file has been deleted from your directory. 
     96 R:: 
     97   The file has been replaced in your directory. 
     98 G:: 
     99   You have changed the original file and these changes are not in conflict with the update. 
     100 C:: 
     101   There are conflicts between the update and you own changes. You must therefore open the file and solve the problems by hand. 
     102 
     103## How to add a svn version identifier in a file header ## 
     104 
     105Add the following line in the file's header : 
     106 
     107{{{! $Id$}}} 
     108[[BR]] 
     109or according to type of file (shell script, makefile, etc.) 
     110[[BR]] 
     111{{{# $Id$}}} 
     112 
     113Then type the following command lines : 
     114 
     115{{{ 
     116#!sh 
     117svn propset svn:keywords "Id" *.f90 
     118}}} 
     119 
     120This modification will be taken into account in the repository in the next  [#Propagerlesmodificationsdesonespacedetravailaudépôt "commit"] of this file. 
     121 
     122## How to add a directory or a file to your workspace ## 
     123 
     124{{{ 
     125#!sh 
     126svn add newnamefile 
     127}}} 
     128 
     129This modification will be taken into account in the repository in the next  [#Propagerlesmodificationsdesonespacedetravailaudépôt "commit"] of this file. 
     130 
     131## How to delete a file ## 
     132 
     133{{{ 
     134#!sh 
     135svn delete namefile 
     136}}} 
     137 
     138This modification will be taken into account in the repository in the next  [#Propagerlesmodificationsdesonespacedetravailaudépôt "commit"] of this file. 
     139 
     140## How to propagate the changes from your workspace to the repository ## 
     141 
     142'''This is only possible if the repository has been retrieved as administrator with ({{{svn checkout svn+ssh://...}}}) ''' 
     143 
     144{{{ 
     145#!sh 
     146svn commit --message "explication modification" [namefile] 
     147}}} 
     148 
     149If {{{namefile}}} does not appear in the command, all modified ({{{M}}}), added ({{{A}}}) or deleted ({{{D}}}) files in the current workspace will be taken into account. 
     150Files identified by the sign {{{!}}} and {{{?}}} by {{{svn status}}} will not be taken into account. 
     151 
     152## How to change the status of a version retrieved with svn ## 
     153 
     154If you retrieved a model in read-only mode ({{{svn export ...}}}) and if you want to perform a "commit" on it, you can change the status of this version. Here is an example with igcmg: 
     155{{{ 
     156#!sh 
     157svn switch --relocate http://forge.ipsl.jussieu.fr/igcmg/svn svn+ssh://login@forge.ipsl.jussieu.fr/ipsl/forge/projets/igcmg/svn 
     158}}} 
     159