⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cvs.html

📁 有趣的模拟进化的程序 由国外一生物学家开发 十分有趣
💻 HTML
字号:
<html><title>Setting up the CVS</title><body bgcolor="#FFFFFF" text="#000000" link="#0000AA" alink="#0000FF" vlink="#000044"><h2 align=center>Setting up the CVS</h2><p>Since we have multiple people doing programming on avida, we are using<a href="http://www.sourceforge.net">SourceForge</a> to keep the project organized.  The developmental version of avida is maintained there usinga program called the "Concurrent Versions System" or CVS.  This document willtell you how to setup your account so that you will be able to use the CVS. I'll also give you some instruction on how the CVS works, but you can skipthat if you want, and the next document will tell you what you need to typeif all you want to do is pull avida out of the CVS.  Click<a href="http://sourceforge.net/projects/avida/">here<a> if you want to godirectly to the Avida project page on SourceForge (this is not needed todownload the source).<h3>Configuring the CVS</h3><p>The CVS software now comes with virtually all flavors of Unix and Linux.  Ifyou are using a system that does not have it, you may need to look intodownloading it first.  The rest of this document assumes that you do haveCVS available to you.<p>The first thing you need to do is determine what kind of "shell" you areusing.  The shell determines how your command line works, and how youconfigure "environment variables" that let programs know where things are.In this case, you are going to need to set an environment variable to letCVS know where the software repository is, and what protocol to use toaccess it.  To begin with, type "<tt>echo $SHELL</tt>" on the command line.<p>If the response is /bin/tcsh, you should:<p><ol><li>In your home directory, open the file .cshrc in a text editor.<p><li>Move to the end of the file, and add in the lines:<p><tt>&nbsp;&nbsp;&nbsp;setenv CVSROOT anonymous@cvs.avida.sourceforge.net:/cvsroot/avida<br>&nbsp;&nbsp;&nbsp;setenv CVS_RSH ssh</tt><p>This will set the needed environment variables.  To be able to make changesto the Avida sourcecode directly, you need to get an account on SourceForge,and then substitute your account name for "anonymous" above.  You then needto be added as a developer on the project, so make sure to talk with one ofthe project admin's first.<p><li>Save the document and exit your text editor.<p><li>One the command line, type "<tt>source .cshrc</tt>" to update the    environment variables for the shell that you're currently logged into.    All new shells that you open in the future will automatically read this    file.</ol><p>If your shell is /bin/bash, you should:<p><ol><li>In your home directory, open the file .bashrc in a text editor.<p><li>Move to the end of the file, and add in the lines:<p><tt>&nbsp;&nbsp;&nbsp;CVSROOT="anonymous@cvs.avida.sourceforge.net:/cvsroot/avida"<br>&nbsp;&nbsp;&nbsp;CVS_RSH=ssh<br>&nbsp;&nbsp;&nbsp;export CVSROOT<br>&nbsp;&nbsp;&nbsp;export CVS_RSH<br></tt><p> Where you replace username with your own account name from myxo. This willset the needed environment variables.<p><li>Save the document and exit your text editor.<p><li>One the command line, type "<tt>source .bashrc</tt>" to update theenvironmentvariables for the shell that you're currently logged into.  All new shellsthat you open in the future will automatically read this file.</ol><p>I'm not as familiar with other shells, so if you are using another one,you're on your own.<p>Test to make sure this worked.  Type "<tt>echo $CVSROOT</tt>" on thecommand line, and make sure the result is the one you entered above.Do the same for "<tt>echo $CVS_RSH</tt>".<h3>How to use a CVS</h3><p>Once you have your environment variables straight, the CVS is very easy touse.  The way you send a command to the CVS is by typing"<tt>cvs <i>command</i></tt>" where you replace <i>command</i> by the commandyou wish to issue.  To get a brand new project called "ecoli_racing" out ofthe CVS, you would type "<tt>cvs get ecoli_racing</tt>".  It would pull allof the files from the CVS, and place them in your current directory.<p>When a project is downloaded from the CVS, it will also create a newsub-directory inside of each project-directory, called CVS/.  This letsfuture CVS commands know the status of all your files and what project theyare part of, so you should never need to tell it again.<p>Here are some of other commands that you can execute inside of a projectthat you have retrieved from the CVS:<table cellpadding=5><tr><td valign=top><b><tt>cvs&nbsp;update</tt></b>&nbsp;&nbsp;&nbsp;    <td>This command will incorporate all changes anyone else has made in        the project since last time you downloaded it.  If you have made any        changes to the project yourself, it will merge those changes        (discussed more below).<tr><td valign=top><b><tt>cvs status</tt></b>    <td>This command will tell you the status of each file in the CVS.  It        will let you know if you have made changes to it ("locally modified"),        if someone else has made changes ("needs update"), or both ("needs        merge").<tr><td valign=top><b><tt>cvs commit</tt></b>    <td>You would use this command to commit all of the changes you have        made to the sourcecode so that everyone else can use them.  Do not        do this lightly!!!  Remember, that any bugs that are introduced into        the code this way will now affect everyone.  Fortunately, the CVS        has a logging system that will allow us to back out of any problematic        changes, but as long as everyone is careful, that shouldn't be        necessary.<tr><td valign=top><b><tt>cvs diff <filename></tt></b>    <td>This command will show you any differences between the file that        you have and the current version of the file in the CVS.<tr><td valign=top><b><tt>cvs help</tt></b>    <td>Prints a list of all available CVS commands, with a brief description        of each.</table><p>If you are just using the CVS in order to have the most up-to-date versionof avida, than you should never have any problems with it.  An occasional"<tt>cvs update</tt>" when you need a newly implemented feature should dothe trick.  However, if you are going to edit the code (even if you neverplan to commit your changes) there are some other things you need to worryabout.<p>In particular, what happens if both you and someone else edit the sourcecode at the same time?  Well, in fact the CVS is very good at handling this.If they are two different files, then there is no problem at all.  If theyare even the <i>same</i> file, but different sections of it, this isn't aproblem either -- the CVS will typically merge the changes smoothly andcorrectly.  The real problem is when two people edit the same part of thesame file.<p>When this happens and you try to update, the CVS will say "Warning: conflictshave occured".  As the individual files scoll by, it will let you know whichones need to be manually merged.  After the update, when you edit the file,you will see that there will be a ">>>>>>>>>>" on one line in the file,followed by your edits, then a "===========" and the other persons edits,and finally a "<<<<<<<<<<<" to indicate the end of the other persons edits.It is now your job to merge your edits with theirs.  In the case of avida,I'd be happy to help with this if it ever ends up being a problem.  Most ofthe time this is caused by two people trying to fix the same bug, and you canjust choose one edit or the other and either will work just fine.<p>For more information on the CVS, see this<a href="http://wwwinfo.cern.ch/asd/cvs/tutorial/cvs_tutorial_toc.html">tutorial</a>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -