Use CVSNT to use CVS in Eclipse

xiaoxiao2021-03-06  18

Use CVSNT to use CVS - 1 in Eclipse. Install and configure CVSNT CVS full name Concurrent version System, mainly used to manage source code, documentation, etc. generated in the development process, record their update history, so that the development team members can Better collaboration. The CVS version control system uses a C / S architecture. CVS Server can support Linux, Windows 2000 / XP / 2003, and some Unix (such as SUN Solaris et al.), CVS Client also has a corresponding version on Linux, Windows, and UNIX.

In Eclipse has built-in CVS Client, Eclipse's documentation It is recommended to install CVS Server on the operating system of Linux, UNIX, but in most people's development, CVS Server for Windows is still the most convenient and fast way. Although it may be more stable than Linux, UNIX version.

Software you need to prepare before formal configuration:

1, Eclipse http://blog.9cbs.net/javamxj/archive/2004/10/11/131952.aspx

The latest version is 3.0.1

2, CVS Server for Windows http://www.cvsnt.com/cvspro/

The latest version is 2.0.51D (Note: For how to use under the CVSNT 2.0.58d version, please refer to http://blog.9cbs.net/javamxj/archive/2005/01/05/240726.aspx)

main content:

1. Install and configure CVSNT; 2, configure CVS Client; 3 in Eclipse, create a CVS instance; 4, practice CVS;

First quarter installation and configuration CVSNT

CVSNT can be installed directly in the installer.

Configuring CVS Server

1. Start -> All Programs -> Cvsnt -> Service Control Panel, the following window appears:

(The default status after installation is running)

2. Switch to the reositories page, click the "Add" button to create a project library, here I create a D: / cvsfile directory,

Click OK, a dialog box appears, click "Yes".

3. Switch to the Advanced page: Select the following:

Be sure to select two items of use local users for pserver and preted to be a unix CVS Server. The former is required to use the CVS Server's local user with Windows to perform permission authentication. If domain user permissions are used, then all client developers are You must log in to the Windows domain to connect to CVS Server, which is more troublesome. The latter is to force CVS Server for Windows to simulate unix CVS Server, only such Eclipse can connect to CVS Server for Windows!

4. After confirming, restart CVS Service and CVS Lock Service.

Second: Configuring CVS Client in Eclipse

1. After running Eclipse 3, perform the functions shown below:

Or, open the "Window" menu -> "Open Perspective" -> "CVS Resource Library Research"

2. Right click on the blank of the CVS Resource Library window and select "New" -> "Resource Location"

3. Configure the CVS repository as follows

Host: The host name of the CVS server can also be its IP address, because it is a local host, so fill in the "localhost" repository path: "Switching the Repositories page" in the "Install and Configure CVSNT" in the previous section "Name" item;

In this case "/ cvsfile".

Certification: "Control Panel" -> "User Account": Select a username and password that already exists or creates a new account.

You can also right-click on "My Computer" icon -> Management -> Computer Management -> Local User and Group -> User: Create a new account, I created a "mmm" account in this case.

Connection Type: Select "PServer" is the most frequently used CVS remote access method.

4. After completing the configuration, the window is as follows.

Section III Create a CVS instance

1. First create a new project "Hello World CVS" in Eclipse, build a "helloWorld" class (Note 1), just simply output the statement "HelloWorld!".

2. Share this local project into the repository. Open the Java view, select this item, right click -> Group -> Sharing Project:

After the prompt window, press "Next" until there is a "Add to CVS Version Control" dialog box, click "Details", you can choose which resources added to the CVS repository, here no choice "/ Hello World CVS / BIN "directory (it's not a source code), then click" Yes ".

The "Submit" dialog appears, you can choose not to add a comment, but it is best to add. (Note that each submission will prompt to enter a comment, which is very important, as a description and prompt of each state.)

After completing all local files, then you can use the powerful version of the CVS.

Note 1: When I first started the package name "cvs.test", the problem occurred when the project was shared, and the question was changed to "cvs1.test" in CVS. . The reason is to create a CVS directory when using the "cvs.test" package name, and sharing the repository, also create a CVS directory, and the result directory name conflicts. So the package is not used separately with CVS.

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.

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.

Section III Create a CVS instance

1. First create a new project "Hello World CVS" in Eclipse, build a "helloWorld" class (Note 1), just simply output the statement "HelloWorld!".

2. Share this local project into the repository. Open the Java view, select this item, right click -> Group -> Sharing Project:

After the prompt window, press "Next" until there is a "Add to CVS Version Control" dialog box, click "Details", you can choose which resources added to the CVS repository, here no choice "/ Hello World CVS / BIN "directory (it's not a source code), then click" Yes ".

The "Submit" dialog appears, you can choose not to add a comment, but it is best to add. (Note that each submission will prompt to enter a comment, which is very important, as a description and prompt of each state.)

After completing all local files, then you can use the powerful version of the CVS.

Note 1: When I first started the package name "cvs.test", the problem occurred when the project was shared, and the question was changed to "cvs1.test" in CVS. . The reason is to create a CVS directory when using the "cvs.test" package name, and sharing the repository, also create a CVS directory, and the result directory name conflicts. So the package is not used separately with CVS.

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 (" Item 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.

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 ...

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

New Post(0)