moodle/lang/sv/docs/cvs.html

161 lines
8.0 KiB
HTML

<html>
<head>
<title>Moodle Docs: How to use CVS</title>
<link rel="stylesheet" href="../theme/standard/styles.php" type="TEXT/CSS">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.sectionheading {
font-size: medium;
font-weight: bold;
font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
border: 1px dotted;
padding: 10px;
background-color: #EEEEEE;
}
-->
</style>
</head>
<body bgcolor="#ffffff">
<h2>Using CVS to access and update Moodle source code</h2>
<blockquote>
<p>CVS is the Concurrent Versioning System. It's a commonly used way of storing
source code because it keeps versions of all files so that nothing is ever
lost, and usage by different people is tracked. It also provides ways to merge
code if two or more people are working on the same file. All code and all
versions are stored on a central server (in the case of Moodle, at <a target="_top" href="http://www.sf.net/">Sourceforge</a>).
</p>
<p>If you just want to access the current CVS version of Moodle with read-only access then
you don't need this page - just follow the simpler CVS instructions on the <a target="_top" href="http://moodle.org/download">Moodle download page</a>.</p>
<p>To use <a target="_top" href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/moodle/moodle/">Moodle's
CVS archive</a> (as a <a target="_top" href="http://sourceforge.net/project/memberlist.php?group_id=30935">developer
with write access</a>), you first need to have an <a href="http://sourceforge.net/account/register.php">account
on Sourceforge</a>. For the examples on this page, let's assume your username
is <strong><font color="#990000">myusername</font></strong> and your password
is <strong><font color="#990000">mypassword</font></strong>. Take special note of the
sourceforge instructions to <a target="_top" href="http://sourceforge.net/docman/display_doc.php?docid=768&group_id=1#develhomedir">create your CVS home directory</a> - something you have to
do with every new account to "enable" it for CVS. Basically you just have to use ssh to interactively connect to cvs.sourceforge.net.</p>
<p>Once you have
a working Sourceforge account, contact <a
target="_top" href="http://moodle.org/user/view.php?id=1&course=1">Martin Dougiamas</a> so he can give you write access
to particular Moodle directories.</p>
<p>To avoid being prompted for <strong><font color="#990000">mypassword</font></strong>
every time you run a CVS command, follow the <a target="_top" href="http://sourceforge.net/account/editsshkeys.php">Sourceforge
directions for using authorized keys</a>. This step is optional, but it can
make your CVS experience a lot nicer.</p>
<p>With that done, you should have all the permissions you need, so you just
need to set up your machine and download the current sources so you can start
working on them. Below are instructions for Unix and Windows systems.</p>
<h3 class="sectionheading">1. Using CVS on Unix</h3>
<blockquote>
<p>Sourceforge CVS uses ssh as a transport layer for security, so you will
have to set this CVS_RSH environment variable in your Unix shell:</p>
<blockquote>
<pre><strong>setenv CVS_RSH ssh</strong> (for csh, tcsh etc)</pre>
<pre><strong>export CVS_RSH=ssh</strong> (for sh, bash etc)</pre>
</blockquote>
<p>It's best to put this in your .bashrc or .cshrc so you don't have to type
it all the time. Then, check out Moodle using this (all one line): </p>
<blockquote>
<pre><strong>cvs -z3 -d:ext:myusername@cvs.moodle.sourceforge.net:/cvsroot/moodle co moodle</strong></pre>
</blockquote>
<p>Don't try to do run this first CVS command into an existing moodle directory
- start fresh with a new directory.</p>
<p>Note that you will be prompted for <strong><font color="#990000">mypassword</font></strong>
for each command unless you set up <a target="_top" href="http://sourceforge.net/account/editsshkeys.php">authorized
keys</a></p>
<p>Now, you should have a new 'moodle' directory. You can rename it and move
it around if you like. Go into it: </p>
<blockquote>
<pre><strong>cd moodle </strong></pre>
</blockquote>
<p>All the latest Moodle files should be in there. You can now change files
in your copy. To compare your files against the main CVS copy on the server
use cvs diff, eg: </p>
<blockquote>
<pre><strong>cvs diff -c config-dist.php
cvs diff -c lang</strong></pre>
</blockquote>
<p>To fetch the latest updates from the server use: </p>
<blockquote>
<pre><strong>cvs update -dP</strong> </pre>
</blockquote>
<p>To copy your new files back to the server you would do something like:
</p>
<blockquote>
<pre><strong>cd lang/ca
cvs commit</strong> </pre>
</blockquote>
<p>You will be prompted to add some comments (depends on your default text
editor) ... add a meangingful comment and close the editor ... the files
will be sent to Sourceforge and stored. Done! </p>
<p>To save more time you can put default arguments into a file called .cvsrc
in your home directory. For example, mine contains: </p>
<blockquote>
<pre><strong>diff -c
update -dP</strong> </pre>
</blockquote>
<p>Try 'cvs help' for more details ... </p>
<p>&nbsp;</p>
</blockquote>
<h3 class="sectionheading">2. Using CVS on Windows</h3>
<blockquote>
<p>First, you need to download a completely fresh copy of Moodle using your
developer account.</p>
<blockquote>
<p> 1. Get TortoiseCVS from <a target="_top" href="http://www.tortoisecvs.org/">tortoisecvs.org</a>
and install it, then reboot.<br>
<br>
2. Find or create a new folder somewhere where you want Moodle to be downloaded
to.<br>
<br>
3. Right-mouse-click that folder and choose &quot;<strong>CVS Checkout</strong>&quot;
from the menu. You should see a dialog box.<br>
<br>
4. Copy this text into the CVSROOT field (using your own username!):</p>
<blockquote>
<pre> :ext:<font color="#990000">myusername</font>@cvs.moodle.sourceforge.net:/cvsroot/moodle</pre>
</blockquote>
<p><br>
5. Press the button: &quot;<strong>Fetch list...</strong>&quot;.<br>
<br>
6. To the right of the button you should see a list of modules: choose
&quot;<strong>moodle</strong>&quot; from that list.<br>
<br>
7. Press the button: &quot;<strong>OK</strong>&quot; and everything should
be downloaded.<br>
</p>
</blockquote>
<p>A dialog box should show all the files being downloaded, and after a while
you should have a complete copy of Moodle. After this first checkout, you
can fetch the latest updated files from the CVS server:</p>
<blockquote>
<p> 1. Right-mouse-click on your Moodle folder (or any file) and select
&quot;<strong>CVS Update</strong>&quot;. <br>
</p>
</blockquote>
<p>After modifying files (you will note they change from green top red!),
you can commit them back to the CVS server like this:</p>
<blockquote>
<p> 1. Right-mouse-click on your Moodle folder (or any file) and select
&quot;<strong>CVS Commit...</strong>&quot;.<br>
<br>
2. In the dialog box, type a clear description of the changes you are
committing. <br>
<br>
3. Click &quot;OK&quot;. Your changes will be sent to the server.<br>
</p>
</blockquote>
</blockquote>
<p>&nbsp;</p>
<p align="center">Good luck!</p>
<p>&nbsp;</p>
</blockquote>
<p align="CENTER"><font size="1"><a href="." target="_top">Moodle Documentation</a></font></p>
<p align="CENTER"><font size="1">Version: $Id$</font></p>
</body>
</html>