Using CVS to access and updateAiM source code

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 AiM, at Sourceforge).

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 theAiM download page.

To use AiM's CVS archive (as a developer with write access), you first need to have an account on Sourceforge. For the examples on this page, let's assume your username is myusername and your password is mypassword. Take special note of the sourceforge instructions to create your CVS home directory - 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.

To avoid being prompted for mypassword every time you run a CVS command, follow the Sourceforge directions for using authorized keys. This step is optional, but it can make your CVS experience a lot nicer.

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.

1. Using CVS on Unix

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:

setenv CVS_RSH ssh (for csh, tcsh etc)
export CVS_RSH=ssh (for sh, bash etc)

It's best to put this in your .bashrc or .cshrc so you don't have to type it all the time. Then, check outAiM using this (all one line):

cvs -z3 -d:ext:myusername@aimmath.cvs.sourceforge.net:/cvsroot/aimmath co AIM

Don't try to do run this first CVS command into an existingAiM directory - start fresh with a new directory.

Note that you will be prompted for mypassword for each command unless you set up authorized keys

Now, you should have a new 'AiM' directory. You can rename it and move it around if you like. Go into it:

cd AiM 

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:

cvs diff -c monitor.html
cvs diff -c doc

To fetch the latest updates from the server use:

cvs update -dP 

To copy your new files back to the server you would do:

cvs commit 

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!

To save more time you can put default arguments into a file called .cvsrc in your home directory. For example, mine contains:

diff -c 
update -dP

Try 'cvs help' for more details ...

 

2. Using CVS on Windows

First, you need to download a completely fresh copy ofAiM using your developer account.

1. Get TortoiseCVS from tortoisecvs.org and install it, then reboot.

2. Find or create a new folder somewhere where you wantAiM to be downloaded to.

3. Right-mouse-click that folder and choose "CVS Checkout" from the menu. You should see a dialog box.

4. Copy this text into the CVSROOT field (using your own username!):

 :ext:gustav_delius@aimmath.cvs.sourceforge.net:/cvsroot/aimmath


5. Write AIM into the "Module:" field at the bottom of the dialog box.

7. Press the button: "OK" and everything should be downloaded.

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:

1. Right-mouse-click on yourAiM folder (or any file) and select "CVS Update".

After modifying files (you will note they change from green top red), you can commit them back to the CVS server like this:

1. Right-mouse-click on your Moodle folder (or any file) and select "CVS Commit...".

2. In the dialog box, type a clear description of the changes you are committing.

3. Click "OK". Your changes will be sent to the server.

 

Good luck!

 


Adapted from the Moodle CVS instructions on moodle.org

Last modified: Wednesday, 20 September 2006, 05:43 PM