# Contents of /mitgcm.org/front_content/using_cvs.xml

Mon Feb 16 02:27:33 2004 UTC (17 years, 7 months ago) by edhill
Branch: MAIN
Changes since 1.5: +9 -1 lines
File MIME type: text/xml
 o update CVS aliases


 1 5 6 7 8 9 10 11 12 13 14 15 16 17 21 22 23 24 25
26

Obtaining the MITgcm Source using CVS

27
28 29

Using CVS "pserver" for Anonymous Access

30 31

The most convenient way to get local copies of the MITgcm source code is 32 to use the CVS "pserver" mechanism. This method only allows you to "check 33 out" (or obtain a local copy) of the source. It does not provide a 34 mechanism for "committing" or "checking in" changes (please see below). 35 Using CVS pserver from the command line requires just a three commands. 36 Using a Bourne, "bash", or "sh-compatible" shell they are:

37 38
39  $export CVSROOT=':pserver:cvsanon@mitgcm.org:/u/gcmpack' 40$ cvs login
41  ( enter the CVS password: "cvsanon" )
42  $cvs co MITgcm MITgcm_contrib 43 44 45 Using a "C", "csh", or "tcsh" shell the commands are: 46 47 48$ setenv CVSROOT ':pserver:cvsanon@mitgcm.org:/u/gcmpack'
49  $cvs login 50 ( enter the CVS password: "cvsanon" ) 51$ cvs co MITgcm MITgcm_contrib
52
53 54

Note that you will only need to perform the "cvs login" once. And for 55 convenience, you may want to add the CVSROOT variable to your shell's 56 environment (that is, define it within your "~/.bashrc" or "~/.chsrc" 57 files).

58 59 60

Getting Parts of the Source "Tree"

61 62

The above commands demonstrate how to check out all of the MITgcm code 63 and the "contributed" (that is, unsupported by often useful) information 64 within the "MITgcm_contrib" directory. In many cases, this is overkill 65 and can result in long download times. To reduce the volume of 66 information downloaded and thereby speedup the download times, one can 67 select one of the following pre-defined "aliases" that will provide a 68 sub-set of the entire MITgcm source "tree":

69 70 72
Alias NameInformation (directories) Contained
MITgcm_codeOnly the source code -- none of the verification examples.
MITgcm_verif_basicSource code plus a small set of the verification examples 83 ("global_ocean.90x40x15", "aim.5l_cs", "hs94.128x64x5", 84 "front_relax", and "plume_on_slope").
MITgcm_verif_atmosSource code plus all of the atmospheric examples.
MITgcm_verif_oceanSource code plus all of the oceanic examples.
MITgcm_verif_allSource code plus all of the verification examples.
73 74 75 76 77 78 79 80 81 82 85 86 87 88 89 90 91 92 93 94 95 96 97 98 108 109 110

It is important to note that the CVS aliases above cannot be used in 111 conjunction with the CVS -d DIRNAME<\it> option. However, the MITgcm 112 directories they create can be changed to a different name following the 113 check-out:

114
115  $cvs co MITgcm_verif_basic 116$ mv MITgcm MITgcm_verif_basic
117
118 119

Getting Specific Releases or "Checkpoints"

120 121

As shown within the CVS 123 Code Browser, the MITgcm code is continuously undergoing updates. At 124 points during the development (typically, after work has been done and the 125 source code has passed the verification 126 tests), a release or checkpoint "tag" is created. These tags are a 127 convenient mechanism for referring to different times or points within the 128 development. One can check out these versions using the "-r TAG_NAME" CVS 129 option such as:

130 131
132  $cvs co -r release1_p5 MITgcm 133$ cvs co -r checkpoint52a_post MITgcm
134
135 136

By default (that is, when no tag is specified), CVS will retrieve the 137 latest version of all files.

138 139 140

Show changes that YOU have made

141 142

If you are running into difficulties it is very useful to see the changes 143 that you yourself have made since obtaining the code. From within 144 your working directory:

145 146
147  cvs diff
148
149 150 151

will show the differences between your version and the version that you 152 checked out. It acts recursively on all directories below your current 153 directory. You can limit the operation to just one file or directory by 154 specifying those as arguments:

155 156
157  cvs diff file
158
159 160 161

Show changes to the repository that you don't have

162 163

The source code evolves continuously and you should try to stay up to 164 date. To see what needs to be updated:

165 166
167  cvs -n update
168
169 170

behaves just as "cvs update" but doesn't actually change anything. This 171 is a useful way of summarizing the state of your code. The meaning of the 172 output is summarized in the next topic.

173 174

175 176

You can download and merge updates from the repository to bring you 177 working code up to date:

178 179
180  cvs update -d -P
181
182 183

will work recursively on all files in the current directory and below. 184 To update just a specific file or directory:

185 186
187  cvs update file
188
189 190

You can also update to a specific version, just as you could check out 191 a specific version.

192 193
194  cvs update -d -P -r release1_p5
195
196 197

If you checked out a specific version and want to update to the very 198 latest use the -A option will remove associated with a specific version as 199 follows:

200 201
202  cvs update -d -P -A
203
204 205

"cvs update" produces output to the terminal with the following 206 meanings:

207 208 210
Return CodeDescription
U fileindicates that file was brought up to date with the 217 repository or that it exists in the repository but not in your work 218 space
P filedoes exactly as above but uses the "patch" method
M filemeans the file was modified in your work space. Any 227 additional changes from the repository were merged in 228 successfully
C filemeans a merge is necessary because both the your copy and the 234 repository have changed but there is a conflict between the 235 changes
? filemeans the file exists in your work space but not on the 240 repository
211 212 213 214 215 216 219 220 221 222 223 224 225 226 229 230 231 232 233 236 237 238 239 241 242 243 244

When conflicts arise, the sections of code are both kept and surrounded 245 by <<<<<, ===== and >>>>> indicators. You need to examine 246 these lines of the files and resolve the conflict.

247 248

249 250

The basic 251 manual is a good reference. There is also an online 253 tutorial as well as an training 255 manual. For those who prefer the good old fashioned book there's "Open Source Development With 257 CVS".

258 259 260 261