mirror of
https://github.com/moodle/moodle.git
synced 2025-01-24 00:58:33 +01:00
142 lines
7.0 KiB
HTML
142 lines
7.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">
|
|
</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 this case, at <a href="http://www.sf.net/">Sourceforge</a>).
|
|
</p>
|
|
<p>To use <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/moodle/moodle/">Moodle's
|
|
CVS archive</a> (as a <a 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>. Once you have
|
|
a Sourceforge account, contact me (<a
|
|
href="http://dougiamas.com/">Martin Dougiamas</a>) so I can give you write access
|
|
to particular 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 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>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 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> </p>
|
|
</blockquote>
|
|
<h3>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 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 "<strong>CVS Checkout</strong>"
|
|
from the menu. You should see a dialog box.<br>
|
|
<br>
|
|
4. Copy this text into the CVSROOT field:</p>
|
|
<blockquote>
|
|
<pre> :ext:<font color="#990000">myusername</font>@cvs.moodle.sourceforge.net:/cvsroot/moodle</pre>
|
|
</blockquote>
|
|
<p><br>
|
|
5. Press the button: "<strong>Fetch list...</strong>".<br>
|
|
<br>
|
|
6. To the right of the button you should see a list of modules: choose
|
|
"<strong>moodle</strong>" from that list.<br>
|
|
<br>
|
|
7. Press the button: "<strong>OK</strong>" 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
|
|
"<strong>CVS Update</strong>". <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
|
|
"<strong>CVS Commit...</strong>".<br>
|
|
<br>
|
|
2. In the dialog box, type a clear description of the changes you are
|
|
committing. <br>
|
|
<br>
|
|
3. Click "OK". Your changes will be sent to the server.<br>
|
|
</p>
|
|
</blockquote>
|
|
</blockquote>
|
|
<p> </p>
|
|
<p align="center">Good luck!</p>
|
|
<p> </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: features.html,v 1.2 2001/12/09
|
|
10:34:19 martin Exp $</font></p>
|
|
</body>
|
|
</html>
|