Personal tools
You are here: Home / cm / Wiki / Introduction to CVS
Navigation
Log in


Forgot your password?
 

Introduction to CVS

<h1>Cmiss CVS Overview</h1>

<h2>Setup</h2>

<p>See Setting Up for CMISS CVS Access for CMISS-specific settings. </p>

<h2>Help</h2>

<p>Use <b>cvs h</b> for a list of cvs subcommands, <b>cvs -H <i>subcommand</i></b> for help on a subcommand, or <b>cvs --help-options</b> for help on global cvs options, or check the <a href="http://ximbiot.com/cvs/manual/">documentation</a>.

</p><h2>cvs checkout</h2> <p>This command gets you started with cvs. Before you can do much with cvs you need to `checkout' a working directory. The working directory is made in the current directory and is given the same name as the repository unless specified with the <b>-d</b> option. Go where you want the base of your working directory to be and checkout the things you want to edit. </p><p>Examples </p><ul><li><b>cvs checkout examples/e/e1</b> makes the working directory

`examples/e/e1' and checks out all subdirectories and files in this part of the repository tree. </li><li><b>cvs checkout cm/source/fe26.f</b> makes the working directory `cm/source' and checks out file `fe26.f' from repository `cm/source' into the working directory. </li><li><b>cvs checkout -d . cm/source/fe26.f</b> This makes the current directory a working directory for repository `cm/source' and checks out file `fe26.f' into the current directory.</li></ul>

<p> If you have created a working directory by checking out a subset of files (i.e. you have specified files not a directory), then you can check out and release more files with <b>cvs update</b> described below. </p><p> The <a href="http://ximbiot.com/cvs/manual/"> documentation on cvs checkout</a> describes further options.

</p><h2>cvs update</h2> <p>This command gets your checked out code up to date. It will automatically merge anyone elses changes to the repository into your code. It is guaranteed to preserve anything you have done. You start <b>cvs update</b> at any point in a checked out tree and it will recursively descend through any cvs controlled sub directories too.

</p><p>Many suffixes are ignored (all *.o *~ files etc. are ignored). Every other file is compared to the repository. If nothing has changed locally or in the repository it is passed over silently. In each other case a symbol is used to explain the status/changes. </p><ul><li>A means that you have scheduled the file for addition.</li><li>R means that you have scheduled the file for removal.</li><li>M means that you have made some modifications that aren't checked in.</li><li>? means that the file is unknown by CVS.</li><li>U means that your file has been updated with changes from the repository.</li><li>C means that your changes conflict with those that someone else has made. Your original file is preserved as .#{filename}.{version}. CVS does the best job it can and leaves the rest up to you, bracketed by &gt;&gt;&gt;&gt;&gt; ===== &lt;&lt;&lt;&lt;&lt;. Sometimes this is easy to resolve, sometimes you need to compare your .# file with the previous repository version and add your changes to the latest repository version as in an old style merge. </li></ul>

<p>Example </p><pre>esu48:blackett 1582% cvs update<br>cvs update: Updating .<br>M cmgui.c<br>M cmgui.imake<br>? date.h<br>? yesterday<br>? cmgui_sgi.make<br>? object<br>? cmgui.imake.perl<br>? cmgui_sgiperl.depend<br>? cmgui_sgi_memorycheck.make<br>? cmgui_sgiperl.make<br>? cmgui_sgi_memorycheck.depend.tmp<br>? object.list<br>? cmgui_sgioptimised.make<br>? cmgui_sgif90.make<br>? cmgui_linux.make<br>? unemap_sgi.make<br>? cmgui_linux_optimised.make<br>? unemap_linux.make<br>cvs update: Updating comfile<br>M comfile/comfile_window.c<br>cvs update: Updating command<br>M command/cmiss.c<br>M command/cmiss.h<br>M command/parser.c<br>? command/cmiss_modify_new.c<br>A command/f90_interpreter.h<br>A command/f90_interpreter.c<br>? command/Perl_cmiss.pmh<br>? command/Perl_cmiss<br>? command/perl_interpreter.h<br>cvs update: Updating finite_element<br>cvs update: Updating general<br>M general/child_process.c<br>M general/image_utilities.c<br>? general/image_utilities.c.new<br>cvs update: Updating graphics<br>M graphics/import_graphics_object.c<br>M graphics/import_graphics_object.h<br>M graphics/texture.c<br>? graphics/scene_viewer.c.conflict<br>cvs update: Updating link<br>cvs update: Updating mirage<br>? mirage/tracking_socket_linux_test_log<br>? mirage/tracking_socket_linux_test<br>? mirage/tracking_socket_test.c<br>? mirage/tracking_socket_test_log<br>? mirage/tracking_socket_test<br>cvs update: Updating slider<br>cvs update: Updating user_interface<br>M user_interface/filedir.c<br>M user_interface/message.c<br></pre> <p>The <b>-n</b> option for cvs prevents cvs from modifying any files. <b>cvs -n update</b> shows what a <b>cvs update</b> would do, and is therefore useful for giving the status of the working directory.

</p><p>If an entire working directory has been checked out (i.e. a directory has been specified for <b>cvs checkout</b>), <b>cvs update</b> will check out any new files that have been added to the repository.

</p><p>If only a subset of files have been checked out into the working directory, additional files may be checked out using <b>cvs update <i>file</i></b>. If you no longer want a file in your working directory it can be released using <b>cvs update -r 0 <i>file</i></b>. This command updates the revision of <i>file</i> in your working directory to revision 0. Revision 0 does not exist so it removes <i>file</i> from your working directory. If you have made changes to <i>file</i>, it will not be deleted and a conflict will be reported.

</p><p> The <a href="http://ximbiot.com/cvs/manual/"> documentation on cvs update</a> describes further options.

</p><h2>cvs log</h2> <p>This command tells you about changes that have been made to the repository. </p><p>The <b>-d</b> option allows you to list changes between a range of dates. (D1 &lt; D2 for all changes between a range of dates, D for latest since a certain date). CVS understands lots of date formats including yesterday, "last week", </p><p>Examples </p><ul><li><b>cvs log ${CMISS_EXAMPLES}/e/ea/ea1/cmiss_input/example_ea1.com</b> Lists all changes

to this file as recorded by cvs . </li><li><b>cvs log -d "&gt;yesterday" ${CMISS_EXAMPLES}/e/ea/ea1/cmiss_input/example_ea1.com</b> Lists all changes to this file since yesterday. </li><li><b>cvs log -d "yesterday" ${CMISS_EXAMPLES}/e/ea/ea1/cmiss_input/example_ea1.com</b> Lists just the lastest change made to this file before yesterday. </li><li><b>cvs log -d "10 jun 2000&gt;15 apr 2000" ${CMISS_EXAMPLES}/e/ea/ea1/cmiss_input/example_ea1.com</b> Lists changes to this file between the 15 April and the 10th of June. </li></ul>

<p> The <a href="http://ximbiot.com/cvs/manual/"> documentation on cvs log</a> describes further options.

</p><h2>Making changes</h2>

<p>When committing changes to files, provide a log message that describes the change and why it was made. </p>

<ul><li>To add a directory
<br>1. Simply add it to cvs <b>'cvs add <i>dirname</i>'</b></li>
<li>To add a file
<br>1. Tell cvs you are going to add the file with <b>'cvs add -m "<i>description of file</i>" <i>filename</i>'</b> <br>2. Run <b>'cvs update'</b><br>3. Commit your changes with <b>'cvs commit -m "Initial revision of a cvs example" filename'</b> <br></li><li>4. After committing new files, you need to compile the global cmiss immediately.
</li><li>To remove a file
<br>1. Remove the file using <b>'rm filename'</b> <br>2. Tell cvs that you are going to remove the file with <b>'cvs remove filename'</b> <br>3. Run <b>'cvs update'</b> <br>4. Commit your changes with <b>'cvs commit -m "Removed as this is superseded by filename2" filename'</b></li><li>Checking in changes <br>1. Run <b>'cvs update'</b> <br>2. Commit your changes with <b>'cvs commit -m "Added streamlines to provide the ability to follow the path of a particle" filename'</b> or <b>'cvs commit -m "Added a Hunter correction as the solution would diverge when A was much greater than B." filename'</b></li></ul>

<p>If you don't supply a message with your commit, cvs will start an editor for you to write and save a log message before exiting. cvs looks for an editor in the environment variables CVSEDITOR then EDITOR. If you don't like using vi, then make sure you set one of these variables to your favourite editor.

</p>