Use CVSNT to use CVS - 4 in Eclipse. Practice CVS

xiaoxiao2021-03-06  86

Section 4 Practice CVS

Submit the code

Now I add an output statement "System.out.Println (" First Modification ");", save. Then select the HelloWorld.java file in the "Pack Explorer" on the right, right click, select "Group" -> Submit "in the pop-up menu.

After the submission is shown, it can be seen that the CVS repository has reflected the change of files after submission.

2. Update the code from the resource library

Now delete the statement in HelloWorld.java "System.out.Println (" First Modification ");", then save.

Right-click HelloWorld.java file -> Replace the latest content of -> Head, you can see the deleted code is restored.

Or, right-click HelloWorld.java file -> Group -> and repository synchronization, select "Copy the current change to the left" button, then save, you can see the deleted code is reduced.

3. Examine the project

Right-click "Hello World CVS" in "CVS Resource Library", select "Check out for ..."

Fill in the "Project Name" in the "Detected" dialog box: Hello World CVS TWO, then click "Finish".

In this way, these two projects point to a CVS repository, which is likely to generate submission conflicts.

4. Conflict

Simplify, refer to the Hello World CVS project as a project 1, Hello World CVS TWO is called item 2. Note The current version of the current two projects is 1.2.

Add a statement in item 1 "System.out.Println (" Project 1 First Modification ");"; Project 2 Add a

Statement "System.out.Println (" Project 2 First Modification ");".

Submit the HelloWorld.java of the project 1, pay attention to the version turned 1.3.

At this time, the HelloWorld.java submitted to the project 2 will have a mistake, as follows:

This is due to the update revision (version 1.3) in the repository (version 1.3), and the version is conflicted when the version 2 of 1.2 is submitted.

5. Resolve conflicts

Merge project 2's work with resource library resources and saves the merged resources in a local manner. You can then choose to submit the result of this merge.

Right-click on the HelloWorld.java 1.2-> Group -> Update ...

Note that the version of the item 2 has become 1.3. After the update conflict has been marked, you can choose whether or not the content in the repository, then save, then the item 2 can submit the merged version. After submission, the version of the project 2 and the repository becomes 1.4.

转载请注明原文地址:https://www.9cbs.com/read-107723.html

New Post(0)