| CVS Usage |
| Tuesday, 13 September 2005 | |||||||||||
|
To keep track of changes and different versions of the GROMACS source code we use CVS, Concurrent Version System. CVS is free software and available on all major platforms. You can find manuals, source code and a lot of other CVS information at www.cvshome.org. If you are using Linux it should be trivial to install a cvs package, but it is probably already present on your system. Anonymous CVS read-only accessThe latest development version of the Gromacs source is available via anonymous CVS. You do not need any special account to retrieve the source, but of course it is read-only. We are usually quite conservative when commiting changes, so the CVS version should be functional and without major bugs, but it is entirely unsupported. We appreciate if you point out bugs or problems, but since this is development software it might take a while to fix them. In other words, check your results VERY carefully if you use CVS for any kind of production runs.Use the following commands to retrieve the latest CVS source: (The whole command from 'cvs' to 'login' (and 'gmx' the second time) should be on one line - your browser might wrap the lines in the window below. Just hit return when you are prompted for a password)
This will create a "gmx" subdirectory with all the Gromacs sources. To create the configure script files you should now run the "./bootstrap" script in the gmx directory. To do this you might need to install or upgrade your versions of autoconf and automake to those provided on this site. Check the developer tools section in the menu to the left! If you don't give any special command you will check of the HEAD branch, which is the main development branch, heading for the next major Gromacs version. If you only want to check or work with the most recent bugfixes in the stable revision tree you should switch 'branch' to the patches for the stable version instead. This is easy; just write
in the top gmx directory. The -A flag is just to make sure we remove all sticky tags - a normal 'update' will only get you the most recent version of the branch you are currently working with. You cannot commit any changes as an anonymous user. If you would like to have a bugfix or other modification incorporated into the source it is best to post it to the gmx-developers mailing list. PLEASE NOTE: To avoid confusing normal users, try to post all CVS-related questions to the gmx-developers list and not the general gmx-users list. You can also get out the LaTeX source for the manual by checking out the module "doc", and our local regression test suite as the module "gmxtest". . Read-Write access with a user IDIf you have been given full write access to the repository, you should have a user name and password. Since the pserver method above transfers all passwords in clear text we are running it in read-only mode. This means you need to use ssh as an external authentication method for CVS if you want to write to CVS. There is built-in support for this, ut we must first tell it which method to use. For bash/zsh-style shells:
or for csh/tcsh shells:
It is a good idea to assign this environment variable into your login files so you don't have to do it every time you use cvs. It will not interfere with CVS pserver usage on cvs.gromacs.org or other servers. Now execute ssh with the "ext" authentication method (external):
You can get rid of the password prompt completely if you add your public key to the file ~/.ssh/authorized_keys on the server. Use ssh-keygen on the machine you will log in from if you haven't got a key yet. Some tips for using CVSThere are a couple of things you might need to know in order to get started. anonymous access:
Brief Guide to Commonly Used CVS CommandsDoug Wright, last update August 29, 1995 Quick Reference
Advanced Commands/Hints
Topics covered below
Checking Out a Module for the First TimeTo check out something for the first time use a command like this: cvs co beget or if the repository is on a remote computer: cvs -R co beget CVS will create a directory called 'beget' in your current working directory and copy all of the files and subdirectories associated with the module 'beget' into it. All of the remaining CVS commands must be issued from the 'beget' directory. Commiting Your Changes to the Main RepositoryYou can edit any of the files you want, and when you are ready to commit your changes to the master repository do, cvs commit CVS will at some point start an editor (vi or emacs depending on your environment variables) and ask you to enter some text that will be stored as part of a history of changes. If this is successful, then your versions of the files will be copied back to the main site so that everyone can access them. Getting Updates and Merging Changes from Different UsersIf someone else changes the files while you are working on your own copy, you must update your copy with the command cvs update to get the new versions. You can chose to update your files at any time. Before committing any files, CVS will check to see if you need to do an update. If you do, CVS prints a message and aborts the commit. If someone else has changed a file that you have also changed, CVS will attempt to merge the new changes into your file. If it is unsuccesful at doing so it will alert you to a 'conflict.' If there is a conflict, the new file will contain sections that have both your changes and the other persons changes. These sections will be flagged by lines like >>>>>>>>>>>> and <<<<<<<<<<<< The user must then look at the conflicting regions, choose what is correct and edit the file. Adding New files to an Existing ModuleIf you create new files, you have to tell CVS to put them into the repository. First do, cvs add newfile1 newfile2 then do a 'cvs commit'. The 'add' command alerts CVS to commit the named files at the next invocation of cvs commit. Reverting to Old Versions of Files (Tags)Every time you commit a file to CVS it increments a revision number. The first commit is 1.1 then 1.2 and 1.3 etc. (I don't know if or how it ever gets to 2.1). To revert to an old version of a file you can use the version number as a tag as in cvs co -r 1.6 bbsim/dat/dcha.db to check out version 1.6 of dcha.db. You could also use the update command cvs update -r 1.6 dcha.db but be careful that you don't commit the old version on top of the current version. To see what version number the current file is do cvs status dcha.db You can also revert to files that were tagged as a particular version by the user. For example cvs co -r v200 bbsim/dat would check out all of the files in dat that were tagged by somebody as version v200. To see what user tags have been created do cvs history -Ta -n bbsim Retagging a previous version and adding to itThe following will make "new_tag" which will be the same as "last_tag" even though you are working with the HEAD. cvs rtag -r last_tag new_tag gnmuon Don't use tag or it will tag the current directory stuff too. OK, now you can update the files from HEAD that you want to include in the "new_tag": cvs tag -F new_tag file1 file2 file3 |
|||||||||||
| Next > |
|---|




