Changes between Initial version and Version 1 of gbgp_branches


Ignore:
Timestamp:
2015-10-21T13:47:15Z (9 years ago)
Author:
Dave Offiler
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • gbgp_branches

    v1 v1  
     1== Branches ==
     2
     3Developments to GBGP should be made from, and committed to, a [http://svnbook.red-bean.com/en/1.0/ch04.html#svn-ch-4-sect-1 branch] rather than directly to the latest trunk version. This allows changes to be tested before merging the required changes back into the trunk. The trunk therefore represents a stable 'next potential release' state for GBGP. Branches can be temporary and might be for working on resolving a specific Trac Ticket.
     4
     5'''Creating a branch'''
     6
     7To create a branch of {{{gbgp_src}}} from the trunk use the [http://svnbook.red-bean.com/en/1.0/re07.html svn copy ''SRC DST''] command:
     8{{{
     9svn copy https://svn.romsaf.org/gbgp/gbgp_src/trunk https://svn.romsaf.org/gbgp/gbgp_src/branches/dev/Share/<branch_name>
     10}}}
     11where <branch name> is a name of your choice which should reflect what you are working on. This prompts a text editor where you should describe the purpose of the new branch.
     12
     13By default it is assumed that you wish to branch from the latest change version of the trunk. The ''-r'' flag can be used to specify the trunk revision from which a branch is required if this is not the latest. The ''-m'' flag could also be used when creating a branch to describe the contents of the branch.
     14{{{
     15svn copy [-r revision] SRC DST [-m "some text here"]
     16}}}
     17
     18Similar branches may be created to store user versions of {{{gbgp_doc}}} or {{{gbgp_test}}} as required.
     19
     20'''Checking out a branch'''
     21
     22To make developments, the branch needs to be checked out to the local working SVN directory for editing as above, specifying the path name for the required branch, e.g.:
     23{{{
     24svn checkout https://svn.romsaf.org/gbgp/gbgp_src/branches/dev/Share/<branch_name> ${HOME}/<SVN_working_dir>/<branch_name>
     25}}}
     26
     27'''Working in a branch'''
     28
     29Code developments are then done within a branch as normal.
     30To view the local changes made to a branch, use the [http://svnbook.red-bean.com/en/1.0/re26.html svn status] command.
     31
     32
     33'''Committing changes to a branch'''
     34
     35When changes to a branch are ready to be updated in the repository, the code needs to be committed using the [http://svnbook.red-bean.com/en/1.0/re05.html svn commit] command.
     36{{{
     37svn commit -m "Some text here to describe the changes"
     38}}}
     39This will prompt a list of the changes to be committed.
     40
     41When you are satisfied that all the changes you require to your branch have been committed and the GBGP Development Team are satisfied that it will be part of the next release, these changes will be merged back into the trunk by GBGP Admin.
     42
     43'''Keeping up to date with changes to trunk'''
     44
     45At some stage it may be necessary to update the trunk with latest developments while a user is still working in a particular branch. Users will be notified of any changes to trunk.
     46
     47In order to keep a branch up to date with the latest version of the trunk while you are working on your branch, you may want to bring in the changes that have been made to the main trunk. This can be done using the [http://svnbook.red-bean.com/en/1.0/re16.html svn merge] command. You must first change directory to your branch's working copy: e.g.
     48{{{
     49cd ${HOME}/<SVN_working_dir>/<branch name>
     50}}}
     51For a branch was created or last updated at revision ''NNNN'', the following command will merge all changes made in trunk since that revision into your branch.
     52{{{
     53svn merge -r NNNN:HEAD https://svn.romsaf.org/gbgp/gbgp_src/trunk
     54}}}
     55When you do this, you should see the list of updates that have been made to the trunk since you last brought in any changes (or since you branched). Note that this only results in changes to your working copy so you might want to commit them to the repository.
     56
     57It is useful to preview the files which will be changed on performing a merge before going ahead using:
     58{{{
     59cd ${HOME}/<SVN_working_dir>/<branch name>
     60svn merge --dry-run -r NNNN:HEAD https://svn.romsaf.org/gbgp/gbgp_src/trunk
     61}}}
     62
     63The merge command can be used separately on subdirectories and files within a branch as required.
     64
     65If a conflict arises between the local copy of a file and the trunk copy to be merged, several versions of that file will be created (e.g. ''file.f90'', ''file.f90.merge-left.rNNNN'', ''file.f90.merge-right.rMMMM''). In general, you will wish to replace the old version of a file (''file.f90.merge-left.rNNNN'') with the latest version from trunk (''file.f90.merge-right.rMMMM''). This can be done manually, and use the [http://svnbook.red-bean.com/en/1.0/re24.html svn resolved] command to indicate that the conflict has been addressed. This will tidy up the files created on merge.
     66
     67Further information on branches are available in
     68[http://svnbook.red-bean.com/en/1.0/ch04.html#svn-ch-4-sect-1 SVN reference: Branching and Merging]
     69
     70[https://trac.romsaf.org/ropp/wiki/gbgp_repository Back]