Source Code Control Procedure
You may customize this procedure as necessary for your team.
The tool our team uses for source code control is CVS. Below are
brief
directions for setting up your account and using CVS. Please read
the
CVS documentation.
CVS is not intuitively obvious and you need to understand proper use or
you can easily destroy your work. Also your CM person should be
able to assist if you have difficulties. If you are new to UNIX, you'll
need to learn how to manage your files and use a text editor such as
pico
or vi.
Here is a
beginning unix tutorial
and a
quick command reference
to get you started.
Initial Setup Of Your Hornet Account And Source Download
-
SSH to Hornet.csc.calpoly.edu
-
Login to your Hornet account.
-
Edit your configuration file
Type: vi .mycshrc
- Add the following line to the bottom of the file,
right below
the other SETENV line.
Replace the letter "X" with the digit
that corresponds to your team number.
setenv CVSROOT ~team-jdX/cvsroot
- Save the file and exit vi
-
Create a directory to hold source files
Type: mkdir 206Project
- Make the source code directory the current directory
Type: cd 206Project
- Check out the source code and download the files to your account,
Type: cvs co .
(yes, the last character IS a period)
To Update Source Code
-
Login to your Hornet account.
-
Navigate to your 206Project directory
-
Update your files with the latest files from the repository
Type: cvs update
- Perform unit development work.
- Hornet has a JDK, so you can edit the files on Hornet using a
UNIX editor
such as pico or vi, and then compile them with the javac
command.
-
Alternatively, download the files to your personal computer, make
changes,
test them, and then upload them back to Hornet.
- (Important) Before committing your changes, check once
more to make sure you have the
latest files
Type: cvs update
If someone else has updated the files, you will have to "merge" your
changes with theirs. If you skip this step you will destroy
someone else's work.
-
Commit changes and upload them to the repository
Type: cvs commit
- You will be prompted to update the CVS log. Be sure to
enter an accurate
and complete description of your changes. The Change Manager will
periodically check the CVS log and issue penalties for missing or
inadequate log messages.
-
Your source code changes will now be merged in with the rest of the
project's
code.
Putting the version into the file
By placing the cvs tag $Id in the source file,
when you commit the file, CVS will replace the tag with
the file ID, which includes the version number.
You can even put this in a String constant, and then
display it.