|
|
Last updated: 16 Apr 2003
Using WinCVS
If you have not done so already, read the following documentation on
setting up WinCVS for use in the lab and at home.
There is also documentation available here
from wincvs.org on how to use WinCVS.
Creating a New Repository
- Create a folder on your h: drive and either place a dummy file into
it or copy your project files that you want to add to the repository
into it. (CVS requires that at least one file be added to the repository
before you can start using it.)
For example: Create a folder named H:\Spring2003\tcss342\
and place an empty text file called dummy.txt in the folder.
- Select Create/Import Module from the file menu. Select the
folder you have created and press ok.
A file filter screen will pop up. Press 'Continue'.
- Type in a name for this module (WinCVS will create a corresponding
directory in your cvs repository using this name) and press ok. This
will add this folder and the files in it to the repository.
For faculty accessible repositories, follow the instructions
given to you by your instructor. He or she will probably tell you
to name the folder according to your class number (like tcss342.)
- Move or delete the folder you have created.
If you added a dummy file to the repository, delete your local
copy of the directory (the one you created on your h: drive, h:\spring2003\tcss342.
If instead you copied real project files, then just rename your
project folder. If you get a message stating that access is denied
when you try to rename or delete you folder, then in cvs double click
on a different folder in the modules window
- Next select Create/Checkout Module from the file menu. Type
in the name of the module that you just created, and set the path to
the local folder to checkout to H:\Spring2003 (or some other location)
This will download the file(s) that you checked in to your h: drive.
In WinCVS, the module folder you just checked out will have a
black check mark on it.
Adding files to the Repository
To add files or folders to the repository, first either move them to your
cvs module (the folder with the black check mark) or create them in the
folder. Files that are not part of the repository will show up with a
question mark, and folders will not have a black check mark in WinCVS.
Note: you may not want to add all files or folders to the repository.
It is not recommended to add *.class files, or other compiled code,
or any other extra files created by BlueJ, JBbuilder, etc.
- Adding a folder to the repository:
- In your cvs module, lets say you want to add a folder called homework1
to the repository. First create the folder in Windows.
- Next, in WinCVS select the folder (it will not have a black check
mark) and either select Modify/Add Selection from the file
menu, or press the add button (the one with the red plus) on the tool
bar.
- Adding a file or files to the repository:
- Select your file(s) in WinCVS and press the add button again (not
the add binary, binary files (*.jpg, *.class, *.exe, etc are treated
separately) Your file(s) will now show up red and marked with an
'A'
- Select modify/commit selection (or the button with the red arrow)
Type a message in ("initial check-in of hw1.java") and
press ok.
Viewing Changes to a File Using Diff
If you are unsure of what changes were made on a modified file, (you don't
remember changing it) or you want to see changes between older revisions,
select the file in question and press query/diff selection check to see
that compare your local file with the same remote revision. In the bottom
window, a 'diff' of your file will be displayed. The red lines are the
old code that changed, and the blue lines are what the red lines changed
to.
Getting a Clean Copy of a File
If after running a diff on a file, you discovered that the file was changed
accidentally, and you want to get rid of all the changes without checking them
in, then select the file, and press modify/update selection. On the update
dialog, check the box "get the clean copy" This will wipe all of your changes
and replace it with the fresh version from the server. If you selected the
wrong file, or you decided later that you did want those changes, cvs has made
a copy of you file for you. If you were working on hw1.java (version 1.2) and
you decided to get the clean copy of the file, you will notice a new file
called .#hw2.java.1.2 which is a back-up copy of the file you just wiped.
Checking in Modified Files
After you have modified a file and you are satisfied with the changes,
save your file, and open up WinCVS. Your changed file will show up in
red.
- Select the folder that holds the files that you changed and press
modify/update selection.
This will verify with the server that these files have actually
changed, and if you are working on shared code, it will check to see if
anyone had changed any of the files between the time you first check them
out, and now. Your changed files will show up in the list on the bottom
with a magenta 'M'.
- If there are not any conflicts (read the next section if your file
is marked with 'C' instead of just red) select your file(s) and press
the commit button. Add an appropriate log message and press ok.
You can either select and commit each file individually to personalize
each message, or just give the group of files a message. These log messages
are what show up when you are looking for older versions of your code.
Conflict Resolution
If you performed an update on a file or folder, and any of your files
were marked with a red 'C' there is a conflict between updates that
needs to be resolved.
- Open the file, and search for a section that looks like the following:
Original File:
public class DieRoll
{
public int rollDie(int face)
{
return (int)(Math.random() * face) + 1;
}
}
File with Conflict:
public class DieRoll
{
<<<<<<< DieRoll.java
public static double rollDie(int face)
=======
public int rollDie(int face)
>>>>>>> 1.2
{
return (double)(Math.random() * face) + 1;
}
}
- Remove the incorrect section, and the diff flags, and re-update the file.
public class DieRoll
{
public int rollDie(int face)
{
return (double)(Math.random() * face) + 1;
}
}
If there are more conflicts, continue to deal with them until when you run an update, the
file comes back marked modified, then commit your changes.
Change Log
21 Apr 2003 |
Original document |
Hours
| Support Information |
News |
Policies | Emergencies
|