/[MITgcm]/mitgcm.org/front_content/using_cvs.xml
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.14 - (show annotations) (download) (as text)
Wed May 11 17:45:01 2011 UTC (10 years, 4 months ago) by jmc
Branch: MAIN
Changes since 1.13: +26 -22 lines
File MIME type: text/xml
add option "-P" to all "cvs co" instruction

1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
4 <html xmlns="http://www.w3.org/1999/xhtml">
5 <head>
6 <meta name="generator" content="HTML Tidy, see www.w3.org" />
7 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
8 <base href="http:/mitgcm.org" />
9
10 <!-- Hinting for menu generation -->
11 <meta name="add_name_0" content="Source Code" />
12 <meta name="add_name_1" content="Using CVS" />
13 <meta name="add_name_2" content="" />
14 <meta name="add_title" content="Using CVS" />
15 <!-- Hinting for menu generation -->
16
17 <style type="text/css">
18 span.c2 {font-size: 110%}
19 div.c1 {text-align: center}
20 </style>
21 </head>
22
23 <body>
24
25 <center>
26 <h3>Obtaining the MITgcm Source using CVS</h3>
27 </center>
28
29 <h4>Using CVS "pserver" for Anonymous Access</h4>
30
31 <p>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:</p>
37
38 <pre>
39 $ export CVSROOT=':pserver:cvsanon@mitgcm.org:/u/gcmpack'
40 $ cvs login
41 ( enter the CVS password: "cvsanon" )
42 $ cvs co -P MITgcm
43 </pre>
44
45 <p>Using a "C", "csh", or "tcsh" shell the commands are:</p>
46
47 <pre>
48 $ setenv CVSROOT ':pserver:cvsanon@mitgcm.org:/u/gcmpack'
49 $ cvs login
50 ( enter the CVS password: "cvsanon" )
51 $ cvs co -P MITgcm
52 </pre>
53
54 <p>using the "-P" option to check-out ("<i>cvs co -P</i>") prevents
55 to download unnecessary empty directories.</p>
56
57 <p>A large amount of additional (optional!) content is available
58 from the <i>MITgcm_contrib</i> directory; much of it is specific to certain
59 setups (eg. high-res setups, in-development material that is not yet part
60 of the "main" code, etc ...).
61 But rather than checking out the full content of MITgcm_contrib
62 ("<i>cvs co -P MITgcm_contrib</i>"), which takes a long time to download
63 (particularly from remote locations), we recommend to download only the
64 specific part of interest, e.g.: "<i>submesoscale</i>" directory,
65 which can be checked out using:</p>
66
67 <pre>
68 $ cvs co -P MITgcm_contrib/submesoscale
69 </pre>
70
71 <p>Note that you will only need to perform the "cvs login" once. And for
72 convenience, you may want to add the CVSROOT variable to your shell's
73 environment (that is, define it within your "~/.bashrc" or "~/.chsrc"
74 files).</p>
75
76
77 <h4>Getting Parts of the Source "Tree"</h4>
78
79 <p>The above commands demonstrate how to check out all of the MITgcm code
80 and the "contributed" (that is, unsupported but occasionally useful)
81 information within the "<i>MITgcm_contrib</i>" directory. In many cases,
82 this is overkill and can result in long download times.
83 To reduce the volume of information downloaded and thereby speedup the
84 download times, one can select one of the following pre-defined "aliases"
85 that will provide a sub-set of the entire MITgcm source "tree":</p>
86
87 <table align="center" border="0" cellpadding="10" width="90%" summary="CVS
88 aliases">
89 <tr bgcolor="#00cccc">
90 <td width="25%">Alias Name</td>
91 <td>Information (directories) Contained</td>
92 </tr>
93 <tr bgcolor="#bbffdd">
94 <td width="25%">MITgcm_code</td>
95 <td>Only the source code -- none of the verification examples.</td>
96 </tr>
97 <tr bgcolor="#bbddff">
98 <td width="25%">MITgcm_verif_basic</td>
99 <td>Source code plus a small set of the verification examples
100 ("aim.5l_cs", "hs94.128x64x5", "ideal_2D_oce", "lab_sea",
101 "tutorial_baroclinic_gyre", "tutorial_global_oce_latlon"
102 and "tutorial_plume_on_slope").</td>
103 </tr>
104 <tr bgcolor="#bbffdd">
105 <td width="25%">MITgcm_tutorials</td>
106 <td>Source code plus all of the tutorials examples.</td>
107 </tr>
108 <tr bgcolor="#bbddff">
109 <td width="25%">MITgcm_verif_all</td>
110 <td>Source code plus all of the verification examples.</td>
111 </tr>
112 <!--
113 <tr bgcolor="#bbffdd">
114 <td width="25%">MITgcm_verif_atmos</td>
115 <td>Source code plus all of the atmospheric examples.</td>
116 </tr>
117 <tr bgcolor="#bbddff">
118 <td width="25%">MITgcm_verif_ocean</td>
119 <td>Source code plus all of the oceanic examples.</td>
120 </tr>
121 <tr bgcolor="#bbddff">
122 <td width="25%"></td>
123 <td></td>
124 </tr>
125 <tr bgcolor="#bbffdd">
126 <td width="25%"></td>
127 <td></td>
128 </tr>
129 -->
130 </table>
131
132 <p>It is important to note that the CVS aliases above cannot be used in
133 conjunction with the CVS <i>-d DIRNAME</i> option. However, the MITgcm
134 directories they create can be changed to a different name following the
135 check-out:</p>
136 <pre>
137 $ cvs co -P MITgcm_verif_basic
138 $ mv MITgcm MITgcm_verif_basic
139 </pre>
140
141 <h4>Getting Specific Releases or "Checkpoints"</h4>
142
143 <p>As shown within the
144 <!-- <a href="http://mitgcm.org/cgi-bin/viewcvs.cgi/MITgcm/doc/tag-index">CVS Code Browser</a> -->
145 <a href="http://mitgcm.org/viewvc/MITgcm/MITgcm/doc/tag-index">CVS Code Browser</a>
146 , the MITgcm code is continuously undergoing updates. At
147 points during the development (typically, after work has been done and the
148 source code has passed the <a href="./testing.html">verification
149 tests</a>), a release or checkpoint "tag" is created. These tags are a
150 convenient mechanism for referring to different times or points within the
151 development. One can check out these versions using the "-r TAG_NAME" CVS
152 option such as: </p>
153
154 <pre>
155 $ cvs co -P -r release1_p5 MITgcm
156 $ cvs co -P -r checkpoint52a_post MITgcm
157 </pre>
158
159 <p>By default (that is, when no tag is specified), CVS will retrieve the
160 latest version of all files.</p>
161
162
163 <h4>Show changes that YOU have made</h4>
164
165 <p>If you are running into difficulties it is very useful to see the changes
166 that you yourself have made since obtaining the code. From within
167 your working directory:</p>
168
169 <pre>
170 cvs diff
171 </pre>
172
173
174 <p>will show the differences between your version and the version that you
175 checked out. It acts recursively on all directories below your current
176 directory. You can limit the operation to just one file or directory by
177 specifying those as arguments:</p>
178
179 <pre>
180 cvs diff <i>file</i>
181 </pre>
182
183
184 <h4>Show changes to the repository that you don't have</h4>
185
186 <p>The source code evolves continuously and you should try to stay up to
187 date. To see what needs to be updated:</p>
188
189 <pre>
190 cvs -n update
191 </pre>
192
193 <p>behaves just as "cvs update" but doesn't actually change anything. This
194 is a useful way of summarizing the state of your code. The meaning of the
195 output is summarized in the next topic.</p>
196
197 <h4>Getting updates from the repository</h4>
198
199 <p>You can download and merge updates from the repository to bring you
200 working code up to date:</p>
201
202 <pre>
203 cvs update -d -P
204 </pre>
205
206 <p>will work recursively on all files in the current directory and below.
207 To update just a specific file or directory:</p>
208
209 <pre>
210 cvs update <i>file</i>
211 </pre>
212
213 <p>You can also update to a specific version, just as you could check out
214 a specific version.</p>
215
216 <pre>
217 cvs update -d -P -r release1_p5
218 </pre>
219
220 <p>If you checked out a specific version and want to update to the very
221 latest use the -A option will remove associated with a specific version as
222 follows:</p>
223
224 <pre>
225 cvs update -d -P -A
226 </pre>
227
228 <p>"cvs update" produces output to the terminal with the following
229 meanings:</p>
230
231 <table align="center" border="0" cellpadding="10" width="90%" summary="CVS
232 update codes">
233 <tr bgcolor="#00cccc">
234 <td width="20%">Return Code</td>
235 <td>Description</td>
236 </tr>
237 <tr bgcolor="#bbffdd">
238 <td width="20%">U <i>file</i></td>
239 <td>indicates that <i>file</i> was brought up to date with the
240 repository or that it exists in the repository but not in your work
241 space</td>
242 </tr>
243 <tr bgcolor="#bbddff">
244 <td width="20%">P <i>file</td>
245 <td>does exactly as above but uses the "patch" method</td>
246 </tr>
247 <tr bgcolor="#bbffdd">
248 <td width="20%">M <i>file</i></td>
249 <td>means the <i>file</i> was modified in your work space. Any
250 additional changes from the repository were merged in
251 successfully</td>
252 </tr>
253 </tr>
254 <tr bgcolor="#bbddff">
255 <td width="20%">C <i>file</i></td>
256 <td>means a merge is necessary because both the your copy and the
257 repository have changed <b>but</b> there is a conflict between the
258 changes</td>
259 </tr>
260 <tr bgcolor="#bbffdd">
261 <td width="20%">? <i>file</i></td>
262 <td>means the file exists in your work space but not on the
263 repository</td>
264 </tr>
265 </table>
266
267 <p>When conflicts arise, the sections of code are both kept and surrounded
268 by &lt;&lt;&lt;&lt;&lt;, ===== and >>>>> indicators. You need to examine
269 these lines of the files and resolve the conflict.</p>
270
271 <h4>Wow! CVS is so good, where can I learn more?</h4>
272
273 <p>The <a
274 href="http://web.mit.edu/afs/athena.mit.edu/project/gnu/doc/html/cvs_toc.html">basic
275 manual</a> is a good reference.
276 For those who prefer the good old fashioned book there's
277 <a href="http://cvsbook.red-bean.com/">"Open Source Development With CVS"</a>.</p>
278
279 </body>
280 </html>
281

  ViewVC Help
Powered by ViewVC 1.1.22