Use Eclipse CVS plug-in
You will use Eclipse CVS-plug-in work on this project and complete your tasks. Simply click the java file you want to edit in the “Package Explorer” on the top-left side, and do your work on the right side view as shown in Figure 14.
Figure 14 Open a file and edit it
Simply hover your mouse over a file and right click your mouse, choose “Team” then click “Shown History”, you will see the history of the chosen file on the right hand side window as shown in Figure 15. Choose 1.24 and 1.23 at the same time, right click your mouse and click “Compare with Each Other ”, you will see two revisions of the same in two sub-windows also shown in Figure 15.
Figure 15 Show history, compare different revisions
Commit your codes. When you finish your work with any files, you need to upload your works onto the CVS repository (commit your changes onto the repository). To do so, simply hover your mouse over “blackjack” or over the specific file you just finished editing, and right click your mouse and choose “Team” then click “Commit”. The instruction is shown in Figure 16.
Figure 16 Commit your changes
Sometimes you may encounter warnings or problems when committing your changes, the reason of the conflict is that your teammates are also working on the same file and commit their works before your doing so. To solver such conflict and to commit your work, one solution is to update the project to the latest version before you commit your works. Simply hover your mouse over the project “blackjack” and right click the mouse, choose “Team” and click “Update”, as shown in Figure 17. After updating to the latest version, the project will contain all other’s works, and you just need to add your works in the files and commit again works).
Figure 17 Update to the latest version
When updating or committing you may encounter conflicts. A conflict occurs when you have locally modified a resource for which a more recent revision is available in the repository. In this situation you can choose to do one of the following:
(1) You can take the change from the branch, discarding your local work. This could occur if you have made unintended changes locally, or if you realize that the revision in the repository is better than yours. Overwriting your local changes should be done with caution since you are in essence throwing work out.
(2) You can commit your change, subsuming the revision in the repository. This should be done with great caution since you are in essence throwing away someone else’s work.
(3) You can merge your work and the repository resource, saving locally the merged resource. You may then later choose to commit this merged result.
Typically, you will want to take the third option, that is to merge, because of the loss of work issues with the other two choices.
Performing a Team > Update will automatically merge into your local resource differences with the repository resource. This works fine provided there are no lines with conflicting changes. If there are, CVS inserts special markup in the file to indicate those lines which could not be merged. If there is any conflict, inside a file with conflicts, there are one or more conflict sections. Each one begins with “<<<<<<<”, followed by the section as found in your local file, followed by “=======”, followed
by the other conflicting version in the repository, followed by “>>>>>>>”. An conflict example is shown in the Figure 18. You need to review both your local changes and remote changes in the repository to understand the conflict and resolve the conflict by merging both changes together manually and removing all the conflict markups. After that, you can commit the changes to the repository.
by the other conflicting version in the repository, followed by “>>>>>>>”. An conflict example is shown in the Figure 18. You need to review both your local changes and remote changes in the repository to understand the conflict and resolve the conflict by merging both changes together manually and removing all the conflict markups. After that, you can commit the changes to the repository.
Figure 18 Merge Conflict





