For the full CVS documentation, type "info cvs" in your Unix shell.
All shell commands below are given in sh- (bash-) syntax. Modify accordingly if you use another shell.
mkdir /it/project/fo/hipe/YOUR-USER-NAME ln -s /it/project/fo/hipe/YOUR-USER-NAME ~/hipe cd ~/hipeYou should now have a soft link named hipe from your current directory to a new directory with the same name as your Unix user name, under the main directory of the HiPE project. Below that directory, you will place, in step 4 below, your own checked-out copy (the directory called otp) of the Open Source Erlang + HiPE source code tree. You should keep all your HiPE code and related files under the directory that you can now find by either of the paths "~/hipe/YOUR-USER-NAME/" or "/it/project/fo/hipe/YOUR-USER-NAME/".
Note: If you are not a HiPE group member, or you just don't want to) create a directory under /it/project/fo/hipe/, you can just do the cvs checkout command in any other directory.
export CVSIGNORE='*.o *.beam'(add more entries to CVSIGNORE if you want).
cvs -d :pserver:firstname.lastname@example.org:/hipe export otp(similar for the module tests). You are now ready to roll.
cvs -d :METHOD:USER@cvs.srv.it.uu.se:/hipe loginwhere METHOD is either
cvs -d :METHOD:USER@cvs.srv.it.uu.se:/hipe checkout otp cvs -d :METHOD:USER@cvs.srv.it.uu.se:/hipe checkout tests
If you are not interested in some (or even all) of the things in the checked out directories, you can simply delete them - they are just copies, and you can get them back at any time later. You can also check out multiple copies of the same files, e.g. for different hacks or subprojects.
As soon as you add and check in a new file or subdirectory with CVS, all other HiPE members are able to get a copy of their own, if they want to.
Also note that in each subdirectory that has been checked out, you will find a directory called CVS. This contains a few files with bookkeeping information for CVS and should usually not be tampered with.
diff -u checkout -P update -d -P tag -cThis assures that you get any newly added directories (-d) when you do an update, and that no empty (typically obsolete) directories are created.
cvs add YOUR-NEW-FILE-OR-DIR cvs commit -m "Added this thing." YOUR-NEW-FILE-OR-DIRIf you don't give the -m "..." option to "cvs commit", CVS will start your $EDITOR to make you enter a log message. Each cvs commit always logs a message.
(You can use ci as an abbreviation for commit. You can also give an -m "..." option to cvs add; this is to give short description of the file itself, but it is not required.)
Note that cvs add does not work recursively on the contents of a directory, and that you must execute the cvs add command from within the directory of the file to be added.
cvs ci -m "Changed some stuff." FILEdoes this (like after cvs add above), and automatically bumps the CVS revision number. Preferably, you give a more useful log message than in this example.
Note that FILE does not have to be in the current directory, and if FILE is a directory name, CVS will update all its contents recursively, so be careful unless that is really what you want. In particular, leaving out FILE means the current directory (and recursively everything under it). This is the common behaviour for most CVS commands.
cvs admin -m1.42:'New message instead of the bad old one.'which replaces the log message in the repository. There cannot be any spaces between -m and the version number - the whole option must be contiguous, that's why you need the quotes.
cvs update FILEwill do precisely this. If you have edited FILE, CVS will simply merge the two versions, unless they collide (see CVS documentation on file conflicts), but your own changes are not committed until you yourself do a cvs commit.
Also remember that you can always backtrack to any previously committed version of a file, if you should commit a really stupid change.
cvs update -C FILEwhich will both rename your changed file to something like .#FILE.1.42 so you don't lose it, and replace it with a fresh copy from the repository.
rm NAME cvs remove NAME cvs ci -m "This file is no longer needed." NAME(Note that you remove the file first, and then tell CVS that it is removed; then you commit the change as usual.)
The file is now considered dead by CVS; it is still stored in the repository, though, and all previously committed versions can be retreived. You cannot reuse the file name in the same directory.
Beside the otp directory, there are several other "modules" under the same CVS repository, e.g. bm (benchmarks), cerl (Core Erlang), hipe_doc (HiPE documentation), etc., each containing the code for some subproject. You may create a new such "module" as follows, assuming that you have a directory with stuff which is not already in the CVS repository (or you have an empty directory):
cd YOUR-EXISTING-DIRECTORY cvs import -m "Initial import." MODULENAME VENDOR RELEASE:where MODULENAME is the base path used for placing your files in the repository. This is the path you will use to check out the sources again. Usually, it is simply the last part of YOUR-EXISTING-DIRECTORY. E.g., if you have stuff in ~/project_X, you would cd ~/project_X and type cvs import -m "bla bla" project_X VENDOR RELEASE.
Note that this adds everything in the directory and its subdirectories, recursively, to CVS. (So first remove things like temporary files, object files, etc.)
VENDOR and RELEASE are "tags" that are used only for special purposes, but they must be given. We suggest you use hipe and start, respectively, as in cvs import -m "..." project_X hipe start.
After you have done this, delete or rename your original directory (you should not need it again - all files have been copied into the repository), then cd to a suitable place and type cvs checkout MODULENAME. In the previous example: cd ~, then rm -rf project_X and cvs get project_X.
The difference between the old directory and the new one is that you now have the necessary CVS information in each subdirectory.
cvs tag my_new_project_root
cvs tag -b my_new_project(Note that CVS is too stupid to find the "root" revision for the new branch later on, even though it should be an easy thing. That's why we added our own root tag before we created the branch.)
If you now do cvs status on one of your files, you will notice that they are marked as "sticky", remembering that they belong to a particular branch. If you check in new changes, they will only be visible on this branch.
Now, you can also check out new copies of this branch, like this:
cvs checkout -r my_new_project ...and all the checked-out files will be "sticky".
To insert changes from the main "trunk" into your branch, use the -j flag with cvs update, as in
cvs update -j my_new_project_root -j my_new_project_join_1which will take the changes between the my_new_project_root point and the my_new_project_join_1 on the main trunk, and patch them into your working copies. (This might cause conflicts that you will have to resolve.) Then, (after testing...) check in the modifications on your branch. The my_new_project_join_1 version should be created just like we did with my_new_project_root, i.e., by checking out a fresh copy of the main trunk, testing it and then tagging it. Next time you join, you will use this point as the old version, as in
cvs update -j my_new_project_join_1 -j my_new_project_join_2and so on.
The same method is used for taking the changes made on your branch and including them on the main trunk, when you feel that the time is ready. First test and tag the code on your branch, e.g.:
cvs tag my_new_project_1Then check out a fresh copy of the main trunk, and do:
cvs update -j my_new_project -j my_new_project_1then resolve any conflicts, test and check in. Better tag this version as well:
cvs tag included_my_new_project_1
Note: If you screw up when setting a tag, just do cvs tag -d TAGNAME to remove the bad tag, and then try again. By default, branch tags cannot be deleted unless you give an additional flag to cvs tag -d. Deleting a branch tag by mistake can cause serious problems, so you are adviced to read the CVS manual first.
cvs update -A FILE
For just renaming a single file, an easy way is to make a copy of the file under the new name, add and check in the new file, then remove the old file (just as above) since it is not used anymore. The drawback of this is that the log of file changes remains with the old file, and the new file is regarded as, well..., a new file.
The easiest way to rename or move a file but keep the CVS log is the following: just make a copy of the *,v file that you find under $CVSROOT, to another name and/or place (remember to keep the ",v" extension on the new file). Then go back to your normal working directory and do cvs update to get the "new" file. Now you can remove the old file just like you remove any other file under cvs, with a message such as "renamed to ...".
If you rename or remove a directory in the repository this can cause havoc if other people still have this directory checked out. If you need to do this, then create a link from the old name to the new inside the repository - but note that this will prevent the lock files that cvs relies on from working - and keep the link there for a short period until everybody has had a chance to migrate to the new name. Also note that renaming/moving directories can make it impossible to check out older versions.