Changeset 10655
- Timestamp:
- 2019-02-08T21:17:34+01:00 (6 years ago)
- Location:
- utils/dev
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
utils/dev/README.rst
r10649 r10655 12 12 ------------------------------- 13 13 14 | As of now, the NEMO code is build from different sources in the repository, via SVN external definitions 15 which are special versioned properties specified on its sub-items (folders and file). 14 | As of now, the NEMO code is build from different sources in the repository, 15 via SVN external definitions which are special versioned properties specified on its sub-items 16 (folders and file). 16 17 | For more, read `the documentation on external definitions in the SVN book 17 18 <http://svnbook.red-bean.com/en/1.7/svn.advanced.externals.html>`_. 18 19 19 The *core code*, which is actively developed from one release to another, is still present and unique for a branch. 20 On one hand, the *core code*, which is actively developed from one release to another, 21 is still present and unique for a branch. 20 22 21 23 :./cfgs: Reference configurations … … 24 26 :./tests: Test cases 25 27 26 | On the other hand, the *complementary code*, defined by minor modifications between consecutive releases, 27 is managed apart from the default development organisation (``branches``, ``releases``, `tags` and ``trunk``). 28 | It has been extracted to another locations in the repository and can considered from now on as external sources. 28 | On the other hand, 29 the *complementary code*, defined by minor modifications between consecutive releases, 30 is managed apart from the default development organisation 31 (``branches``, ``releases``, `tags` and ``trunk``). 32 | It has been extracted to another locations in the repository and 33 can considered from now on as external sources. 29 34 30 35 :./arch: Settings for computing architecture … … 35 40 :./tools: User tools 36 41 37 Thanks to this, the *complementary code* can be shared between several branches. 42 .. note:: 43 44 The major benefit of this implementation is the convenient way of sharing code. 45 Part of the source code can be develop in one location, in-house or externally, 46 and distribute to several working copies. 38 47 39 48 External sources in working copy … … 56 65 .. important:: 57 66 58 | Regarding the main branches of NEMO development, 59 the default configuration for official releases and tagged snapshots will have fixed externals. 60 | However the trunk will always refer to the ``HEAD`` of the repository. 67 Regarding the main branches of NEMO development, 68 official releases and tagged snapshots will have fixed externals, 69 however the trunk will always refer to the ``HEAD`` of the repository. 70 71 .. note:: 72 73 | As we cannot add comments in the context of versioned properties, 74 the revision number of an external source could be a major information 75 for those would starting to scrutinize the code. 76 | Revision changes have to be limited it to what is strictly necessary, 77 i.e. only for the external(s) at stake, and 78 each definition must refer to an effective revision considered as reliable. 61 79 62 80 Developer perspective 63 81 --------------------- 64 82 65 | The external definitions are retained by branching operations so a development branch created from the trunk 66 will in the first place update its external sources to the latest. 67 | From that the developer has two options per each external 68 69 **Be isolated from unwanted commits** 70 Replace ``HEAD`` revision by a reliable number to be safe 71 but this external will be updated by hand. 72 **Be able to commit directly to the external** 73 Let ``HEAD`` revision setting, 74 in return you will receive all its updates. 75 76 .. hint:: 77 78 You can change your mind at any time and update the externals on a case-by-case basis. 79 80 The SVN commands for managing external definitions are below 83 | The external definitions are retained by branching operations so in the first place 84 a development branch created from the trunk will update its external sources to the latest. 85 | From that the developer makes a choice for each external in the development branch 86 87 +--------------------------+---------------------------------------------------------+ 88 | *Set explicit revision* | Isolated from unwanted commits | 89 | | | 90 | | Get back to or reproduce confidently a previous version | 91 +--------------------------+---------------------------------------------------------+ 92 | *Keep ``HEAD`` revision* | Modify directly the external and receive all updates | 93 | | | 94 | | No commit record in the meantime | 95 +--------------------------+---------------------------------------------------------+ 96 97 | Due to different attributes exposed above, 98 **it is strongly recommended to set explicit revisions on externals for a development branch**. 99 | Nevertheless the developer can have its reasons to have implicit revision for given item(s) and 100 can update the definitions on a case-by-case basis. 101 102 The SVN commands for managing external definitions are below, 103 modified externals are reported in the 2 :sup:`nd` column of ``svn {st,status}`` output. 81 104 82 105 .. code:: sh … … 90 113 .. warning:: 91 114 92 | Think about committing your new definitions to the repository. 93 | Modified externals are reported in the 2 :sup:`nd` column of ``svn {st,status}`` output. 115 Think about committing your new definitions 94 116 95 117 Recommended development environment … … 110 132 | Actually the script will checkout the repository in a slightly different manner from the usual way, 111 133 using the ``--depth`` and ``--set-depth`` SVN options in order to 112 download the sub-paths of the default development organisation in various depths (``branches``, ``releases``, ``tags`` and ``trunk``). 134 download the sub-paths of the default development organisation in various depths 135 (``branches``, ``releases``, ``tags`` and ``trunk``). 113 136 | In the end, the developer will have a versioned copy of the repository first levels with empty folders, 114 137 except for the `trunk` (``/NEMO/trunk``) and the last official release (``/NEMO/releases/release-X.X``) 115 138 which have been fully downloaded. 116 139 117 The benefits of this new approach are numerous :140 The benefits of this new approach are numerous 118 141 119 142 - **Possibility to work offline like git**: 120 create a development branch by copying the `trunk` locally and start coding without a first commit to the remote repository, 121 instead of creating the development branch remotely on the repository, then downloading it to begin to work. 143 create a development branch by copying the `trunk` locally and 144 start coding without a first commit to the remote repository, 145 instead of creating the development branch remotely on the repository, 146 then downloading it to begin to work. 122 147 - **Simple UNIX-like syntax for SVN commands** (``svn {add,cat,cp,ls,mv,rm} ...``) and 123 no more tedious URL scheme to use ( 148 no more tedious URL scheme to use (``svn+ssh://...``). 124 149 - **All developments handled in one common location** by 125 150 putting an end at the branches scattering with several isolated working copies … … 139 164 1. ``DEVELOPER_ID``: configure the working copy in developer mode, 140 165 i.e. URL in ``svn info`` begins with |DEV_URL| ... instead of |URL|, 141 so the developer can commit to the repository right away (switching can be made later). 142 2. ``repo``: download the whole layout of the repository instead of the default development organisation. 143 By default, the checkout is from root directory ``/NEMO`` with ``branches``, ``releases``, ``tags`` and ``trunk``. 166 so the developer can commit to the repository right away 167 (switching can be made later if needed). 168 2. ``repo``: download the whole layout of the repository instead of the default development organisation 169 to manage the development of the sources used as externals. 170 By default, 171 the checkout is from root directory ``/NEMO`` with ``branches``, ``releases``, ``tags`` and ``trunk``. 144 172 With ``repo`` argument, it does from the root of repository with ``/NEMO``, ``/utils``, ``/vendors``. 145 173 … … 216 244 - URL link(s) to selected ticket(s) will be provided in the email notification and the changeset page. 217 245 218 | To do so, you can use a word from this list ``addresses re references refs see`` followed by usual ticket link(s). 246 | To do so, 247 you can use a word from this list ``addresses re references refs see`` followed by usual ticket link(s). 219 248 | For instance 220 249 … … 226 255 ------------------------------- 227 256 228 | If a commit is a fix, you can close targeted ticket(s) with the commit operation without the need of a browser. 229 | For this, you can use a word from the list ``close closed closes fix fixed fixes`` followed by usual ticket link(s). 257 | If a commit is a fix, 258 you can close targeted ticket(s) with the commit operation without the need of a browser. 259 | For this, 260 you can use a word from the list ``close closed closes fix fixed fixes`` followed by usual ticket link(s). 230 261 | For instance 231 262 -
utils/dev/install_dev_env.sh
r10637 r10655 9 9 10 10 dir='NEMO_dev' 11 if [ "$2" == 'repo' ]; then root=''; else root='NEMO'; fi 11 12 if [ "$2" == 'repo' ]; then root='/'; else root='/NEMO'; fi 12 13 13 14 ## Copy of the repository with empty root directories 14 svn co --depth immediates http://forge.ipsl.jussieu.fr/nemo/svn/$root $dir 15 echo 'Checkout the repository from' $root 16 svn co --depth empty http://forge.ipsl.jussieu.fr/nemo/svn/$root $dir 17 echo 15 18 16 19 ## Switch to developer role if ID is provided 17 20 if [ -n "$1" ]; then 21 echo 'Switch from user to developer role (http:// => svn+ssh://)' 18 22 ssh-copy-id -i ~/.ssh/id_rsa.pub $1@forge.ipsl.jussieu.fr 2> /dev/null 19 svn sw --relocate http://forge.ipsl.jussieu.fr\20 svn+ssh://$1@forge.ipsl.jussieu.fr/ipsl/forge/projets \23 svn sw --relocate http://forge.ipsl.jussieu.fr \ 24 svn+ssh://$1@forge.ipsl.jussieu.fr/ipsl/forge/projets \ 21 25 NEMO_dev 26 echo 22 27 fi 23 28 24 29 if [ "$2" == 'repo' ]; then 25 svn up --set-depth immediates $dir/utils $dir/vendors 30 echo "With 'repo' arg, create a lightweight copy of the repository" 31 echo "for the developement of the sources used as 'externals'" 32 33 for item in utils/build/{arch,makenemo,mk} utils/tools \ 34 vendors/{AGRIF/dev,AGRIF/release-4.0,FCM,IOIPSL} ; do 35 # vendors/{AGRIF/dev,AGRIF/stable,FCM,IOIPSL} ; do 36 echo '¤' $item 37 svn up -q --parents $dir/$item 38 done 39 26 40 dir=$dir/'NEMO' 41 echo 27 42 fi 28 43 29 44 ## Get the 1st level tree under 'branches' and 'releases' 30 svn up --set-depth immediates $dir/branches $dir/releases 45 echo "Get empty development folders under '/NEMO/branches':" {UKMO,2018,2019} 46 svn up -q --set-depth empty --parents $dir/branches/{UKMO,2018,2019} 47 echo 31 48 32 49 ## Download trunk and last release 33 svn up --set-depth infinity $dir/trunk 34 svn up --set-depth infinity $dir/releases/release-3.6 50 echo 'Full download of 2 main branches' 51 echo "¤ '/NEMO/trunk'" 52 svn up -q $dir/trunk 53 54 echo "¤ latest in '/NEMO/releases'" 55 svn up -q --parents $dir/releases/release-4.0 35 56 36 57 exit 0
Note: See TracChangeset
for help on using the changeset viewer.