This page will help you get started in setting up Eclipse to work with your cs164 CVS repository on the instructional machines. For complete and excellent documention on the details of using CVS in Eclipse, see the online help. Go to Help -> Help Contents, and then on the left-side of the screen, select Workbench User Guide -> Tasks -> Working in the team environment.
Note that these instructions do not make use of group accounts; that method of using CVS is incompatible with Eclipse.
You must choose one of the instructional accounts in your group to host the repository. You must also choose a secret name for a directory, known only to the people in your group (this is to prevent others from reading your repository). Given this secret (from now on referred to as SECRET), the person whose account is hosting the repository should run the following commands from his/her home directory:
chmod g+x .These commands create the repository directory with the appropriate permissions. Next, you have to initialize the repository by running the two following commands (ACCOUNT is the account name and SECRET is the secret):
mkdir share
chmod 711 share
cd share
mkdir SECRET
chmod 711 SECRET
cd SECRET
mkdir cvsroot
chmod 770 cvsroot
setenv CVSROOT /home/cc/cs164/fa03/class/ACCOUNT/share/SECRET/cvsrootThat's it! Your repository is ready to use.
cvs init
First, you need to open the "CVS Repository Browsing" perspective. Go to Window -> Open Perspective, and choose "CVS Repository Browsing" (if it does not appear in the list, go to "Other..." and choose it from there). You should see a view called "CVS Repositories" on the left side of the Eclipse window.
Right-click in the "CVS Repositories" view and select New -> Repository Location. An "Add CVS Repository" dialog should appear. Fill in the following values in the dialog (ACCOUNT is the account storing the repository and SECRET is the previously chosen secret directory name):
Once you have your repository set up in Eclipse, you can add a project to the repository as follows. Right click on the project in the Package Explorer view, and go to "Team -> Share Project...". A "Share Project" dialog should appear. In the dialog, select "Use existing project location:", and choose the repository that you previously created, and then click Next. In the next screen, you can leave "Use project name as module name" checked, or choose a new name for the module if you'd like. Click Next and then Finish; Eclipse will connect to the repository and do some initial setup (it may take a minute), after which the Synchronize view should appear.
The Synchronize view is a great way of seeing the differences betwen your local copy of your code and the copy in the repository. This first time, you'll have to add your files to the repository. To just add all your files, right-click on the project folder in the view (the top node in the tree) and select "Add To Version Control." Instead of question marks next to all the files, you should now see little orange marks. Finally, right click on the project folder again and select "Commit..." to commit your changes; you can enter a comment indicating this is an initial checkin of the code if you like.
See this page for screenshots of this process.
Once you've added your project to the repository, you (or your partner) may want to check out the project on a different computer. To do this, first set up the repository in the CVS Repository Browsing perspective as described above. Then, open the list under the repository in the CVS Repositories view, and then open the HEAD list. You should see your project listed. Right click on the project folder, and select "Check Out As Project." If you added the project as described above, then that should be it! You should now see the project in the Java perspective.
NOTE: It is possible to run into a UNIX permissions problem at this step, preventing the checkout. If this occurs, the person whose account hosts the repository should log in and run the following commands (PROJNAME is the name of your project):
cd share/SECRET/cvsrootIn general, you may have to do this whenever directories are added to the repository.
chmod -R 770 PROJNAME
See here for an example of commiting a changed file to the repository. In general, when you want to synch up with the repository, right-click on your project in the Package Explorer, and go to "Team -> Synchronize with Repository...". This should pop up the Synchronize view, showing the differences with the repository. To get an update from the repository, right-click on a file and choose "Update," and to commit changes to a file, right-click on it and choose "Commit." You can use the up and down arrows in the view to graphically view the differences between the local file and the repository.