Changes between Version 20 and Version 21 of Documentation/UserGuide/CommitOnTrunk


Ignore:
Timestamp:
2024-05-18T17:30:11+02:00 (6 weeks ago)
Author:
luyssaert
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/UserGuide/CommitOnTrunk

    v20 v21  
    3030 * if the trusting fails after commit, the commit should be reverted if a correction could not be done directly. 
    3131 
    32 == Basic use of SVN == 
    33 See also the section '''svn''' on the [wiki:Documentation/UserGuide]. 
    34 === Create a new file === 
    35 Add a new file to the svn repository either by coping an existent, renaming or adding a new file.  
    36  
    37 {{{ 
    38 svn cp file1 file2 
    39 or 
    40 svn mv file1 file2 
    41 or create first the file2 and then add it 
    42 svn add file2 
    43 }}} 
    44  
    45 All these commands will only add locally the file. To finally add them to the repository you must commit: 
    46  
    47 {{{ 
    48 svn -u stat 
    49 svn ci 
    50 }}} 
    51  
    52 Example if you forgot to create ORCHIDEE_OL in your branch. First, under svn, copy ORCHIDEE_OL from a close version of your branch, then extract it to your working directory (where you develop your version). There copy/modify your configuration files, add them to svn and eventually commit:  
    53  
    54 {{{ 
    55 svn cp svn://forge.ipsl.jussieu.fr/orchidee/branches/ORCHIDEE_2_2/ORCHIDEE_OL svn://forge.ipsl.jussieu.fr/orchidee/branches/ORCHIDEE-SP-MIP/ORCHIDEE_OL 
    56 cd $workdir/ORCHIDEE-SP-MIP/ 
    57 svn co svn://forge.ipsl.jussieu.fr/orchidee/branches/ORCHIDEE-SP-MIP/ORCHIDEE_OL ORCHIDEE_OL  
    58 cp -r $newconfig/OOL_SEC_STO_SPMIP ORCHIDEE_OL/OOL_SEC_STO_SPMIP 
    59 svn add ORCHIDEE_OL/OOL_SEC_STO_SPMIP 
    60 svn -u stat 
    61 svn ci 
    62 }}} 
    63  
    64 === Activate revision information === 
    65 If you added a new file, make sure also to activate the commit information in the header, after activation this should be done automatically at each commit. Add in the beginning of the file the following keywords :  
    66 {{{ 
    67 !! $HeadURL$ 
    68 !! $Date$ 
    69 !! $Revision$ 
    70 }}} 
    71   
    72 Activate substitution by using propset and commit the file: 
    73 {{{ 
    74 svn propset svn:keywords "Date Revision HeadURL" file2.f90 
    75 svn ci file2.f90 
    76 }}} 
    77  
    78  
    79 After the commit it should look something like:  
    80 {{{ 
    81 !! $HeadURL: svn://forge.ipsl.jussieu.fr/orchidee/trunk/ORCHIDEE/src_sechiba/file2.f90 $ 
    82 !! $Date: 2015-09-21 13:37:38 +0200 (lun. 21 sept. 2015) $ 
    83 !! $Revision: 2928 $ 
    84  
    85 }}} 
    86  
    87  
    88 === Update a branch with changes done in the trunk === 
    89 First make sure that all changes in the branch have been committed. No local changes should exist in the folder.  
    90 In a terminal, go to the directory with the source code for the branch: 
    91 {{{ 
    92 cd modipsl/modeles/ORCHIDEE    # in the branch 
    93 }}} 
    94  
    95 Determine the revision interval x1:X2 with changes done on the trunk that you want to integrate in the branch 
    96 Check first with --dry-run which files are affected: 
    97 {{{ 
    98 svn merge --dry-run -r x1:x2 svn://forge.ipsl.jussieu.fr/orchidee/trunk/ORCHIDEE 
    99 }}} 
    100  
    101 Then do the real merge: 
    102 {{{ 
    103 svn merge -r x1:x2 svn://forge.ipsl.jussieu.fr/orchidee/trunk/ORCHIDEE 
    104 }}} 
    105 If files gives conflicts, you can answer p for postpone and resolve them manually after finishing the command merge. The command svn merge will not commit any changes. All changes will be done locally and you need to validate by svn diff and svn ci to commit.  
    106  
    107  
    108  
    109 === Merge changes done on a branch into the trunk === 
    110 The same command svn merge can be used to merge a branch into the trunk. For this case, install locally the trunk and go to that folder. The svn command will look something like folllwing: 
    111 {{{ 
    112 cd modipsl/modeles/ORCHIDEE    # in the trunk 
    113 svn merge -r x1:x2 svn://forge.ipsl.jussieu.fr/orchidee/branches/ORCHIDEE-TOTO/ORCHIDEE 
    114 }}}