CSE 401: Compilers

[Home] [Admin] [Details] [Help] [Other]

Help / Groups and RCS


Group Files

Each student group will be assigned a unix "group ID", e.g. 401z, and a directory will be created for you in /projects/instr/cse401/98au/401z. Use this directory to hold files you need to share with your group-mates. Remember that files you create here need to be made "group readable" and/or "group writable", but should not have "world" access. sanjuan% cd /projects/instr/cse401/98au sanjuan% ls -lg total 13 drwxrwx--x 3 root 401a 512 Apr 11 20:04 401a/ ...etc... drwxrwx--x 4 root 401z 512 Apr 11 17:21 401z/ sanjuan% cd 401z sanjuan% cp ~/foo.c foo.c sanjuan% ls -lg total 3 -rw------- 1 ruzzo 401z 7 Apr 12 20:41 foo.c sanjuan% ### Add read, write, exec/search to group, remove from others: sanjuan% chmod g+rwX,o-rwx * sanjuan% ls -lg total 3 -rw-rw---- 1 ruzzo 401z 7 Apr 12 20:41 foo.c sanjuan%

RCS Access control

It is highly recommended that you use RCS ("Revision Control System") to control simultaneous access and to provide a version history. If you don't, then you risk having large portions of your work disappear when one of your partners writes over the same file you were working on. Very briefly, using RCS involves registering all files in your project and then checking them out to use them, and checking them in when finished. Here's one way that you can set up your directory for version control.
  1. Create a directory called RCS in your group's project directory, and a symbolic link to it from your working directory: cd /projects/instr/cse401/98au/401z mkdir RCS cd ~/myfavoritecourse/pl0 ln -s /projects/instr/cse401/98au/401z/RCS RCS
  2. Get the base project files: cp /cse/courses/cse401/CurrentQtr/pl0_base/* ~/myfavoritecourse/pl0
  3. Register all the files with RCS. cd ~/myfavoritecourse/pl0 foreach foo (*) ci -u -t-$foo $foo end You only need to do this once for each file. If you create a new file you should check it via the ci line above or clicking on Tools->Version Control->Register in emacs.

  4. The procedure above will leave you with a read-only copy of each file. To edit a file, say scanner.c, you need to "check out" a "locked" copy of it, then check it back in when you're finished. co -l scanner.c emacs scanner.c <...edit & test to your heart's content...> ci -u scanner.c Alternatively, it's easy to check files in and out using emacs; simply visit the file and then hit C-x C-q (control-x control-q). (Use the menus if you forget). Note that if you haven't registered the file, the emacs mode-line won't say RCS and C-x C-q will simply toggle the read-only status of the file.

    If you try to check out a file that someone's already using, RCS and/or emacs will let you know who. Otherwise, it will give you the lock to the file and nobody else will be able to check out that file until you check it back in.

  5. RCS itself will not automatically give your partners a file that you check back in. This is a feature; they can choose when they want to synchronize their files with the master versions. (For example, if they know that you've checked in a buggy module that can't yet compile, but they still want to keep working on their own part which isn't dependent on it.)

    If you want to make sure that all of your files are the most current versions, you can run:

    co RCS/* Alternatively, the following may work on some systems (the Indy's?): rsync -v
  6. Some hints:

Thanks to Ben Wong for a preliminary version of this info.


401admin at cs.washington.edu (Last modified: 10/20/98)

Netscape-HTML Checked!