CVS interface feature description in Eclipse (iii)

Source: Internet
Author: User
Tags commit

Original address: http://hi.baidu.com/xublog/blog/item/8eab160264428f094afb512b.html 5.4.9 processing concurrent updates for the same file

First, let's discuss a protocol that is proposed to be used to modify the operation. When you use resources in your workspace, your actions are independent of the CVS repository. Because the changes that occurred in the repository may have occurred without your knowledge, it is important that you do not commit any changes if updates have not been checked in the repository to replace your changes. Team | Update ... The operation updates the local copy of the project with any changes in the repository that supersede your changes. For text files (including Java classes), team | Update ... The operation automatically merges any changes (from the repository to the workspace), even if these changes can cause conflicts. When a conflict is encountered, the merge operation identifies the conflict in the file with a specific CVS markup literal to help you identify the conflicting rows. Markup text is not compatible with any type of file, for example, it may cause compilation errors.

Update ... Operation is a very powerful operation, we must be careful in practice. In the following example, Pat and Lynn update a simple text file. Without knowing it, they are all updated with rows starting with "B" and "C". The markup text is identified by the conflicting rows and the version number (1.2) in which the conflict was introduced. For a complex Java file with numerous conflicts, you may find it difficult to resolve the conflict.

A is for Apple

<<<<<<< sample.txt

B is for bird (updated by Pat)

C is for Crow (updated by Pat)

=======

B is for Bobcat (updated by Lynn)

C is for Cow (updated by Lynn)

>>>>>>> 1.2

D is for dog

E is for excellent

F is for farm

G is for goat ...

Team | Synchronize with Repository ... The operation also supports updates, but the operation is not automatically updated. When you do this, the Synchronize view is displayed and the inconsistent resources between the workspace copy and the latest resource pool resources are listed. In the Synchronize view, you can check these differences and decide what action to take. Due to Team | Synchronize with Repository ... Operation gives you more control, so we recommend that you use this action instead of update ... Operation.

Here's a summary of the basic rules for file concurrency updates: Before you modify a file in a workspace, you must update the resource in the workspace with all the changes in the repository. For security purposes, use the team at this point | Synchronize with Repository ... Operation. In the Synchronize view, you can perform an update operation, commit changes, and reconcile conflicts. 5.4.10 uses CVS for watch/edit support to avoid concurrent updates to the same file

The Watch/edit support of CVS is provided by eclipse itself. If you agree to use CVS for Watch/edit support, you can avoid conflicts with other members of your team when submitting resources. With the Watch/edit support for CVS enabled, your project team can better understand who is currently updating files in all concrete projects. Instead, the CVS annotate view discussed earlier shows you the previous changes and who made the changes. CVS Watch/edit support is enabled at the project level. If you are in the team | The CVS >watch/edit Preference Settings page has the Configure projects to use Watch/edit on checkout check box selected, and Watch/edit support will be activated automatically when the item is checked out. You can also enable watch/edit support on existing projects that are managed by CVS by setting the CVS properties of the project. When CVS Watch/edit support is enabled, the files in the project are read-only. At this point, if you open a file in the editor and then try to modify the file, the CVS server is queried. When you edit the file, if someone else is editing the file, a dialog box appears informing you that other members of the group are also editing the file (see Figure 5-9). At this point, you can continue to edit the file, but conflict management is required when you submit the file. When a file is modified, the check mark modifier is added to the file.

Figure 5-9 shows a dialog box where others are editing the same file

Execute team on projects, folders, and Files | The show editors operation will open the CVS editors view. The CVS editors view lists all the resources that are being updated by others (see Figure 5-10). You can use the team on any project and project resources, whether under watch/edit control or not. Show editors operation. But team | The show editors operation will only identify project resources that have Watch/edit support enabled.

Figure 5-10 Lists the CVS editors view of which user is updating files in a folder

You can use the team | Edit action to explicitly notify the CVS server that the CVS server knows you want to update the file. You can also use the team | Unedit the CVS server to notify the CVS server that you do not want to edit the file again. In this way, any changes you make will be checked out of the CVS repository. Table 5-3 provides information about these operations. After the changes have been submitted to CVS, the resources in the Watch/edit list are implicitly deleted.

Watch/edit is a very useful tool. However, the use of the tool requires a number of rules to follow, with some considerations in mind. First, if you want to make the Watch/edit function efficient, each member of the team must start the Watch/edit feature in a potentially conflicting project. Second, you must connect to the CVS server. If you are not connected to a CVS server and want to update a file, you will have to explicitly cancel the read-only state of the file (which is available from the property page of the file). Of course, the support is now a compromise. This is because no one knows the update, and there is a potential conflict during the commit process. If you delete a project and the Watch/edit preference settings for the project resource are not enabled, the CVS server will not be notified and the CVS server will continue to report out that you are editing the resources. If your team is planning on using watch/edit support, it is wise to enable everyone on the team to turn on the CVS checkout preference settings that are labeled Configure projects to use Watch/edit on Watch/edit. 5.4.11 Recovery of deleted files

Sometimes, after the file is deleted and the changes are submitted to CVS, you may need to recover the deleted files. Fortunately, CVS does not remove the deleted files from the repository where the files are located. You can use the team | Restore from repository operation to recover deleted files. If the deleted file exists in the repository, you will see a dialog box. In this dialog box, you can select a specific revision of the file you want to restore (see Figure 5-11). The latest revision of the file is a reference to the deleted file. This is because file deletion is a CVS revision operation.

Figure 5-11 shows the Restore from Repository dialog box for a recoverable deleted file

When a file is restored to the workspace, the file is considered a new file. The new file must be added to version control before the file is submitted or when the file is submitted. 5.4.12 Other CVS user interface elements 1. Checkout Wizard

In the New Wizard dialog box, you get the Checked-out project in the CVS Wizard. Typically, you will use the CVS repositories view to check out the project. However, some CVS repository is not allowed to be browsed. In this case, the Check Out wizard might be more useful. In this case, however, you must know the name of the project in advance. 2. CVS Cheat sheet

To open the Cheat Sheet selection dialog box, select Help | Cheat Sheets ... Command. For CVS tasks, a cheat sheet is used to help with branching and merging operations.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.