by Trond Trosterud, Børre Gaup, Sjur N. Moshagen
We first cover cvs on victorio, then cvs on another Linux machine, then cvs on Windows, and finally cvs on the Mac.
CVS, or Concurrent Version System, is a program that keeps track of different versions of the same files. This is done by keeping an original of the files in a different place. Thereafter each user must check out a copy of the original, and work on that copy. After the work is done,the new version of the file must be checked in to the repository again. Thereafter, all workers will receive the new and updated version of the file when they check it out.
Be sure to always have the latest version of the project files, by giving the command cvs update (or cvs up) whenever you log in. When you have worked on a file, check in the file 'filename' with the following command:
cvs ci -m "Write a short log command here" filename
If you want to write a longer log command, write
cvs ci filename
and you will get an emacs window where you can write your command. When you are done, write C-x-c as you always do in emacs, and the log command will be saved.
Always check in the files at the end of the day. If you know that other people are working on the same file, you should check in more often than that. You should also check in after you have done major revisions. Remember to compile the program before you check in, so that you know you do not check in a defect file.
The best way to learn to write good log messages is to read other log messages. Pick a file (e.g. twol-sme.txt, sme-lex.fst), and read the log (the command is cvs log filename | less). If the log message tells you what you want to know, then it is a good log message.
That was the crash course, here come some more details.
The first session you get yourself a version of the project, with the command cvs checkout gt. All subsequent sessions you should go to the gt directory (in your home directory, write "cd gt"), and start the session by the command cvs update -dP. The reason for this is to ensure that you start out with the most recent version of the files and folders.
The most important cvs commands are found below, with comments in parentheses after each command.
Then work hard on e.g. the file called file.txt. Save the file you worked on. Then the file must be checked in (by "cvs commit") to make it available to the other workers. Check in at least once a day, in order to avoid conflicts arising from other people working on files that do not (yet) contain your updates.
Then cvs asks you to write a log comment. Do that. Then write 'ctrl x ctrl c' (i.e., quit emacs). cvs ci -m "short log comment" filename if all you want to write is "short log comment".
There is an alternative way of checking in files. If you have worked on the file in emacs (as we do in this project), you may write C-x C-q instead of the normal emacs command C-x C-c. Then you get a buffer asking for a log text. Terminate you log text with C-c C-c, and, voila, the file is checked in in cvs. (This method works for RCS as well).
Other commands:
The official CVS manual is http://www.cvshome.org/docs/manual/cvs.html, also known as 'the Cederqvist Manual'.
CVS Pocket Reference
You may also write info cvs on the command line, that manual is actually quite ok.
You need a username in the master cvs server, victorio.uit.no, and cvs group membership. All persons associated with the project do have this. The following line is automatically executed in /etc/profile; only those who do not have bash as shell might need to set it manually (and we all have a bash shell on victorio).
export CVSROOT=/usr/local/cvs/repository
'remote use' means that you check out the cvs files to a machine different from victorio.uit.no. You then work offline on your local machine (at home, or on travel). Then, returning to a place where you are online, you may check in and update your cvs files as normal. In this way, you have two sandboxes (i.e.: you have two copies of the source files): One copy on victorio, and one copy on your own local computer. Note that these two sandboxes are independent of each other.
You need a ssh client in your local computer that can connect to victorio. If you have Linux or Mac OSX this is already in place. You also need a username in the master cvs server, victorio.uit.no, and cvs group membership in victorio. Then you need to set up your local machine. The following lines should be added into your local initialization file (this is the file .profile for bash on Linux, on Mac OSX).
export CVSROOT=:ext:username@victorio.uit.no:/usr/local/cvs/repository
export CVS_SSH=ssh
Another (much more cumbersome) way is to specify the repository attributes on each command line:
You are then prompted for your password to victorio. You can leave out your remote (victorio) username if your local username and username in victorio are the same.
That is all! Then you run cvs as described above: cvs update to update, etc. You will be prompted for password at every occasion, but otherwise it is the same procedure as for local work (if there are many changes done, it might be easier to first copy all the files to victorio via scp, and thereafter copy them to the sandbox and do cvs update there).
Here we assume that you already have an account at victorio.uit.no, and that you are able to use it via putty.exe on your Windows machine, and that you are sitting on your windows machine now.
To be able to use CVS you need the program TortoiseCVS, which can be downloaded from their homepage, www.tortoisecvs.org (when we migrate to svn there will also be a tortoiseSVN waiting for us). Just download the program and store it into your Program Folder
When the program is installed, go to the folder where you want to keep the language technology files (e.g. My Documents). In that folder, right-click with the mouse on an empty spot in the folder. You will note that the context-sensitive menu has some additions in the middle, where it reads CVS and something. Choose the CVS Checkout. You will then get a panel, where you fill in your account data.
Now you may edit the files, e.g. with EditPad Lite, Notepad++ or XMLEditor. When you have edited them you will note that the green symbol attached to the file symbol has turned orange. This means you should check in. Right click on the file icon, and choose check in. Write a log message, and click OK.
The general principles are the same for CVS usage here as elsewhere: Always update before you start working (right-click, and CVS Update), and always check in when you are done with your work, minimum once a day.
There also is a User Guide (in a strange format).
CVS has been built-in to MacOS X since the very first day, and the basic procedures are exactly as described above for Linux outside victorio.
There are a couple of excellent graphical clients available for MacOS X. The one used in our projects is Concurrent Versions Librarian (CVL). More detailed instructions on how to set-up and check-out from victorio using CVL can be found on another page.
If you have committed a file as 'dead', that is marked it as removed, and commited that change, the file is moved to the attic. Sometimes you may want to bring it back into life again, and to do that you should follow the procedure outlined here (this is taken from the CVS FAQ-O-Matic):
a84-230-135-66: sjur$ cvs status ulikestavelsesverb.xml =================================================================== File: no file ulikestavelsesverb.xml Status: Up-to-date Working revision: No entry for ulikestavelsesverb.xml Repository revision: 1.2 /.../gram/sma/Attic/ulikestavelsesverb.xml,v
a84-230-135-66:~/.../gram/sma sjur$ cvs up -r 1.1 -p ulikestavelsesverb.xml > ulikestavelsesverb.xml cvs update: use `cvs add' to create an entry for ulikestavelsesverb.xml
a84-230-135-66:~/.../gram/sma sjur$ cvs add ulikestavelsesverb.xml cvs add: Re-adding file `ulikestavelsesverb.xml' (in place of dead revision 1.2). cvs add: use 'cvs commit' to add this file permanently
a84-230-135-66:~/.../gram/sma sjur$ cvs ci "Resurrected this file from the dead ..." cvs commit: Examining . Checking in ulikestavelsesverb.xml; /.../gram/sma/ulikestavelsesverb.xml,v <-- deleted_file new revision: 1.3; previous revision: 1.2 done
What if you get an error message like the following?
You type cvs co gt, as you have been told. The machine answers:
cvs update: No CVSROOT specified! Please use the '-d' option.
Then answer with the following magic spell:
cvs -d /usr/local/cvs/repository/ co gt
Why you have to do this I do not know.
Last modified: $Date: 2008-11-05 18:52:54 +0100 (ons, 05 nov 2008) $, by $Author: boerre $