How to use the SourceForge.net CVS repository David Miller 14/06/2005 First off, CVS is quite different from anything I've used before so I'll assume that it is the same for you too. I guess that you can think of it as FTP with lots of bells and whistles. I would recommend reading through this document: https://sourceforge.net/docman/display_doc.php?docid=14033&group_id=1 before doing anything, although it lists lots of commands that we might not use (at least all the time), it still gives a good overview of how things work. The general philosophy seems to be to upload your changes often, i.e. for each bug fixed upload and also to download often, i.e. get the latest version before you start working. This avoids over-writing other people's code and getting in a mess. Another good resource is this free book: http://cvsbook.red-bean.com/ available to download as a PDF file. From page 17 to 87 are the most useful but it is quite detailed. It may be better as a reference guide. Once you have theory down it's a case of finding the software. I spent quite a long time trying to work out how to use a piece of GUI software called WinCVS, the documentation to which is quite out of date. Therefore I would recommend avoiding it. I then look at a command line cvs interface and Len tried out a package called Tortoise CVS which is a GUI way of doing things. Here is how to use both, so you can decide which suits you best. Please read through both anyway to get a feel for how CVS works. CVS - The comand line way Probably the easiest way to do this is to install Cygwin, but this installs lots of unnecessary files with it. Instead I suggest using the following two pieces of software and a DOS prompt. To get this to work you need to first grab the CVSNT package which is a cvs client for Windows. This can be found at: http://www.cvsnt.com/cvspro You will then need a ssh command line client (not PuTTY) to interface with this. http://sshwindows.sourceforge.net/ Will install a client (and server if you so wish) onto your computer. Check that the directories where cvs.exe and ssh.exe are in your path. You can check this by just running cvs or ssh with no arguments, it should give you a usage guide. To download the latest sources from scratch you can type: cvs -d:ext:@cvs.sf.net:/cvsroot/distanceengines checkout If you are a registered developer use as your SourceForge username, otherwise use: cvs -d:pserver:anonymous@cvs.sf.net:/cvsroot/distanceengines checkout To do it anonymously, but you will not be able to upload changes (commit) easily if you use this. And it will create a new directory with all the files from the server. Once you have edited what you need you can then upload back to the server. In the top level of the project (eg C:\dev\distance\mrds-1.2) type cvs commit -m "A short message saying what you did" You need not worry about adding a date or your name as CVS will handle this. As mentioned above it is worth doing this regularly (once per bug/feature removed/added) and also running: cvs update -dP from the top level of the project. This should ask you for your username/password if you checked out the code as a developer. Otherwise it will just download the updates. As with the previous command you should do this regularly to, ideally before you start working on each bug/feature. Other more advanced commands like add and remove are not really necessary at the moment (at least). If you are going about this you may find the "Open Command Line here" PowerTool from the MicroSoft site: http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx which adds an extra context menu item to open a DOS prompt where you like (courtesy of Len). CVS - The GUI way Tortoise CVS is a Windows shell extension which gives you extra items in your context menu for CVS commands. To startwith you'll need to download the package available from: http://www.tortoisecvs.org/download.shtml This should install like any Windows program, and will require that you restart. You might like to perform a custom install to avoid installing lots of extra languages/icon sets. There is user documentation installed which should cover most things, I'm mainly just paraphrasing from there. First create a new folder whereyou want you CVS code to live. Then right click in this folder and press "CVS Checkout...", you can then set the parameters, ignore the top box asking for CVSROOT as this can be changed in the drop down menus as follows: Protocol = Secure shell (:ext:) Server = cvs.sourceforge.net Ignore port Repository folder = cvsroot/distanceengines Username = your SourceForge username You should then type the module title in the module box, for some reason SourceForge makes it hard to use the modules file to keep a record of your modules. This shouldn't really be too much of a problem, as you can use the web CVS site to see what all the modules are called (see below for address). Once this is done you should just be able to press okay from there and get all the code downloaded. If you get fed up of it asking for your password all the time you can use Pageant, available here: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html to store your private key. It is pretty straight forward to use, just run the program add your private key and then make sure that it runs when you boot your computer (i.e put a shortcut in the Startup folder) but change the Target (available in the properties box of the shortcut) to '"C:\Program Files\ssh\pageant.exe" SourceForge-CVS.ppk' or your equivalent. If you don't have a key then you can use PuTTYgen (available from the same site) to create one, upload the public part to SourceForge, then store the private one on your PC. [Note from Len: I had trouble with this until I generated a key of type SSH2 DSA (under Parameters in PuTTYgen). I also found it best to do the following to upload the public key: - log on to my SourceForge account (http://sourceforge.net/account/) - click on Edit SSH keys (near the bottom of the page) - in PuTTygen (assuming the key is loaded), highlight the text in the box under "Publickey for pasting into OpenSSH authorized keys file" - copy this text and paste it into the Authorized keys page on the account web page. - click Update on the web page, and check it has recognized 1 key - wait an hour or more before trying TortoiseCVS again -- if it has worked the CVS will no longer prompt you for a password - I also found life to be easier if I didn't use a Key Passphrase with my key, as it saves me having to type the passphrase into the computer each time I boot up and Pagent fires up. Let's face it - this stuff isn't top secret! ] You can now go about editing the files and right clicking to commit the changes and download the updates. Finally, some things to bear in mind. If you have an old version of Cygwin installed or RTools, you might have a problem with DLLs (as Len did) so the best thing to do would be to update cygwin1.dll or alternatively just stick with TortoiseCVS. It might seem like cvs is taking a while to login. This is because of the SSH authentication, be patient :) Also, the changes will not appear immediately in the html cvs pages (http://cvs.sourceforge.net/viewcvs.py/distanceengine), it might take about 10-15 minutes. Added 16/06/2005: If you have an error when trying to compile CVS files (specifically to do with CR/LF problems) then this is usually because the file was supposed to be in binary mode rather than ASCII. To fix this you need to delete the file from the repository then upload the new one in binary mode. To do this in TortoiseCVS (which I guess is what most people will be using): - Right click on the file - Click remove - Commit the changes - Put the new file in place - Click add... - Make sure that in the popup window it is in binary format - Commit the changes Then update and try and compile, this should work fine. That should be about it. Any problems, discrepancies etc to dlm22@st-andrews.ac.uk.