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

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

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


Revision 1.2 - (hide annotations) (download) (as text)
Thu Dec 4 16:20:41 2003 UTC (20 years, 5 months ago) by edhill
Branch: MAIN
Changes since 1.1: +7 -7 lines
File MIME type: text/xml
 o fixes based on comments from our group meeting today
   - tested "export CVSROOT=':pserver:cvsanon@mitgcm.org:/u/gcmpack'"
     and verified that it works

1 edhill 1.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     <title>MITgcm: <!--ADDTITLE--></title>
18     <style type="text/css">
19     span.c2 {font-size: 110%}
20     div.c1 {text-align: center}
21     </style>
22     </head>
23    
24     <body>
25    
26     <center>
27     <h3>Obtaining the MITgcm Source using CVS</h3>
28     </center>
29    
30     <h4>Using CVS "pserver" for Anonymous Access</h4>
31    
32     <p>The most convenient way to get local copies of the MITgcm source code is
33     to use the CVS "pserver" mechanism. This method only allows you to "check
34     out" (or obtain a local copy) of the source. It does not provide a
35     mechanism for "committing" or "checking in" changes (please see below).
36     Using CVS pserver from the command line requires just a three
37     commands:</p>
38    
39     <blockquote>
40     Using a Bourne, "bash", or "sh-compatible" shell:
41     <pre>
42 edhill 1.2 $ export CVSROOT=':pserver:cvsanon@mitgcm.org:/u/gcmpack'
43 edhill 1.1 $ cvs login
44 edhill 1.2 ( enter the CVS password: "cvsanon" )
45 edhill 1.1 $ cvs co MITgcm MITgcm_contrib
46     </pre><br />
47    
48     Using a "C", "csh", or "tcsh" shell:
49     <pre>
50 edhill 1.2 $ setenv CVSROOT ':pserver:cvsanon@mitgcm.org:/u/gcmpack'
51 edhill 1.1 $ cvs login
52 edhill 1.2 ( enter the CVS password: "cvsanon" )
53 edhill 1.1 $ cvs co MITgcm MITgcm_contrib
54     </pre>
55     </blockquote>
56    
57     <p>Note that you will only need to perform the "cvs login" once. And for
58     convenience, you may want to add the CVSROOT variable to your shell's
59     environment (that is, define it within your "~/.bashrc" or "~/.chsrc"
60     files).</p>
61    
62    
63     <h4>Getting Parts of the Source "Tree"</h4>
64    
65     <p>The above commands demonstrate how to check out all of the MITgcm code
66     and the "contributed" (that is, unsupported by often useful) information
67     within the "MITgcm_contrib" directory. In many cases, this is overkill
68     and can result in long download times. To reduce the volume of
69     information downloaded and thereby speedup the download times, one can
70     select one of the following pre-defined "aliases" that will provide a
71     sub-set of the entire MITgcm source "tree":</p>
72    
73     <table align="center" border="0" cellpadding="10" width="90%" summary="CVS
74     aliases">
75     <tr bgcolor="#00cccc">
76     <td width="25%">Alias Name</td>
77     <td>Information (directories) Contained</td>
78     </tr>
79     <tr bgcolor="#bbffdd">
80     <td width="25%">MITgcm_code</td>
81     <td>Only the source code -- none of the verification examples.</td>
82     </tr>
83     <tr bgcolor="#bbddff">
84     <td width="25%">MITgcm_verif_basic</td>
85 edhill 1.2 <td>Source code plus a small set of the verification examples
86     ("global_ocean.90x40x15", "aim.5l_cs", "hs94.128x64x5",
87     "front_relax").</td>
88 edhill 1.1 </tr>
89     <tr bgcolor="#bbffdd">
90     <td width="25%">MITgcm_verif_atmos</td>
91     <td>Source code plus all of the atmospheric examples.</td>
92     </tr>
93     <tr bgcolor="#bbddff">
94     <td width="25%">MITgcm_verif_ocean</td>
95     <td>Source code plus all of the oceanic examples.</td>
96     </tr>
97     <tr bgcolor="#bbffdd">
98     <td width="25%">MITgcm_verif_all</td>
99     <td>Source code plus all of the verification examples.</td>
100     </tr>
101     <!--
102     <tr bgcolor="#bbddff">
103     <td width="25%"></td>
104     <td></td>
105     </tr>
106     <tr bgcolor="#bbffdd">
107     <td width="25%"></td>
108     <td></td>
109     </tr>
110     -->
111     </table>
112    
113    
114     <h4>Getting Specific Releases or "Checkpoints"</h4>
115    
116     <p>As shown within the <a
117     href="http://dev.mitgcm.org/cgi-bin/viewcvs.cgi/MITgcm/doc/tag-index"> CVS
118     Code Browser</a>, the MITgcm code is continuously undergoing updates. At
119     points during the development (typically, after work has been done and the
120     source code has passed the <a href="testing/latest.html">verification
121     tests</a>), a release or checkpoint "tag" is created. These tags are a
122     convenient mechanism for referring to different times or points within the
123     development. One can check out these versions using the "-r TAG_NAME" CVS
124     option such as: </p>
125    
126     <blockquote>
127     <pre>
128     $ cvs co -r release1_p5 MITgcm
129     $ cvs co -r checkpoint52a_post MITgcm
130     </pre>
131     </blockquote>
132    
133     <p>By default (that is, when no tag is specified), CVS will retrieve the
134     latest version of all files.</p>
135    
136    
137     <h4>Show changes that YOU have made</h4>
138    
139     <p>If you are running into difficulties it is very useful to see the changes
140     that you yourself have made since obtaining the code. From within
141     your working directory:</p>
142    
143     <blockquote>
144     <pre>cvs diff</pre>
145     </blockquote>
146    
147     <p>will show the differences between your version and the version that you
148     checked out. It acts recursively on all directories below your current
149     directory. You can limit the operation to just one file or directory by
150     specifying those as arguments:</p>
151    
152     <blockquote>
153     <pre>cvs diff <i>file</i></pre>
154     </blockquote>
155    
156     <h4>Show changes to the repository that you don't have</h4>
157    
158     <p>The source code evolves continuously and you should try to stay up to
159     date. To see what needs to be updated:</p>
160    
161     <blockquote>
162     <pre>cvs -n update</pre>
163     </blockquote>
164    
165     <p>behaves just as "cvs update" but doesn't actually change anything. This
166     is a useful way of summarizing the state of your code. The meaning of the
167     output is summarized in the next topic.</p>
168    
169     <h4>Getting updates from the repository</h4>
170    
171     <p>You can download and merge updates from the repository to bring you
172     working code up to date:</p>
173    
174     <blockquote>
175     <pre>cvs update -d -P</pre>
176     </blockquote>
177    
178     <p>will work recursively on all files in the current directory and below.
179     To update just a specific file or directory:</p>
180    
181     <blockquote>
182     <pre>cvs update <i>file</i></pre>
183     </blockquote>
184    
185     <p>You can also update to a specific version, just as you could check out
186     a specific version.</p>
187    
188     <blockquote>
189     <pre>cvs update -d -P -r release1_p5</pre>
190     </blockquote>
191    
192     <p>If you checked out a specific version and want to update to the very
193     latest use the -A option will remove associated with a specific version as
194     follows:</p>
195    
196     <blockquote>
197     <pre>cvs update -d -P -A</pre>
198     </blockquote>
199    
200     <p>"cvs update" produces output to the terminal with the following
201     meanings:</p>
202    
203     <table align="center" border="0" cellpadding="10" width="90%" summary="CVS
204     update codes">
205     <tr bgcolor="#00cccc">
206     <td width="20%">Return Code</td>
207     <td>Description</td>
208     </tr>
209     <tr bgcolor="#bbffdd">
210     <td width="20%">U <i>file</i></td>
211     <td>indicates that <i>file</i> was brought up to date with the
212     repository or that it exists in the repository but not in your work
213     space</td>
214     </tr>
215     <tr bgcolor="#bbddff">
216     <td width="20%">P <i>file</td>
217     <td>does exactly as above but uses the "patch" method</td>
218     </tr>
219     <tr bgcolor="#bbffdd">
220     <td width="20%">M <i>file</i></td>
221     <td>means the <i>file</i> was modified in your work space. Any
222     additional changes from the repository were merged in
223     successfully</td>
224     </tr>
225     </tr>
226     <tr bgcolor="#bbddff">
227     <td width="20%">C <i>file</i></td>
228     <td>means a merge is necessary because both the your copy and the
229     repository have changed <b>but</b> there is a conflict between the
230     changes</td>
231     </tr>
232     <tr bgcolor="#bbffdd">
233     <td width="20%">? <i>file</i></td>
234     <td>means the file exists in your work space but not on the
235     repository</td>
236     </tr>
237     </table>
238    
239     <p>When conflicts arise, the sections of code are both kept and surrounded
240     by &lt;&lt;&lt;&lt;&lt;, ===== and >>>>> indicators. You need to examine
241     these lines of the files and resolve the conflict.</p>
242    
243     <h4>Wow! CVS is so good, where can I learn more?</h4>
244    
245     <p>The <a href="http://www.loria.fr/~molli/cvs/doc/cvs_toc.html">basic
246     manual</a> is a good reference. There is also an <a
247     href="http://web.mit.edu/afs/athena.mit.edu/project/gnu/doc/html/cvs_toc.html">online
248     tutorial</a> as well as an <a
249     href="http://www.loria.fr/~molli/cvs/cvstrain/cvstrain.html">training
250     manual</a>. For those who prefer the good old fashioned book there's <a
251     href="http://cvsbook.red-bean.com/">"Open Source Development With
252     CVS"</a>.</p>
253    
254     </body>
255     </html>
256    

  ViewVC Help
Powered by ViewVC 1.1.22