How does Eclipse use source code version control
Level: Intermediate
Pawel Leszek (Pawel.leszek@ipgate.pl) Independent Consultant in August 2003
This article outlines how the Eclipse platform supports the source code version control in the software project. First, we will briefly discuss the idea of team code development, then study how Eclipse uses the CVS code repository. We will also study some source management software tools to extend these tools through the Eclipse plugin extension.
Most applications that have been shared by the Source Code in Team Projects are developed by multiplayers. Even if only a small project of several developers, changes to the source code are needed to strictly control. This is the task of the source code management software. Source code version control software must support two core functions:
Provide a method to coordinate changes to source code, and integrate historical records submitted by these change teams
When team members have completed new work, share their work by submitting these changes to the resource library. Similarly, when they want to get the latest available work results, they can update their local workspace according to the changes in the repository. This means that the project repository often changes due to team members to submit new work results. In other words, the repository should represent the current state of the project. At any time, team members must be able to update their work space based on the resource library and confident that they are the latest.
Maintaining history is also important, so you can compare the current work with previous versions, if necessary, you can reply to the previous version. Coordinating teamwork so that there is only a unique current project status definition, as well as including team integrated work, which is also necessary for managing version controls. This coordination is likely to be the most difficult achievement.
The most ideal model is: Any member of the team can make changes to any resource you have access to you. Because the two team members can submit changes to the same resource, there is a possible conflict, and this conflict must be solved. This model assumes that the conflict has uniqueness. But unfortunately, no source code is isolated in isolation; usually it contains implicit or explicit correlation with other resources. The source code references the components described in other source code resources. But the work of the source code management software is here, because it does not replace project management. Project managers must fulfill their responsibilities: coordinate the work of other members and responsible for progress, project phases, and release. In addition, source code management cannot replace communication between developers.
The Eclipse platform supports the code management Eclipse platform to provide the ability to share code and work as a team in software projects. Eclipse has widely supporting a variety of code management solutions, which is due to its plugin architecture (however, it has been introduced to CVS support). The focus of the Eclipse platform architecture is the work space. Workspace maintenance and testing everything you need to test software projects. It contains objects (source code and resources). It also saves configuration settings for projects, IDE, and plugins. Workspace is maintained locally on the machine's machine, and the team collaborates through external resource libraries, and different developers' code collection in the resource library. The repository can be accessed via the Internet via the "Client-Server" architecture.
The Eclipse platform provides support for team development operations directly from workspace. This support allows developers to interact with several independent repositorys and different versions of code or projects. Resources in Workspace Allow Team Support Components Processing Version and Configuration Management Problems. Of course, a single working space can access different types of repository at the same time. The Eclipse platform does not provide its own code management solution; it always relies on the external system. The Eclipse platform provides built-in support only for one (but also the most popular) source code management system: concurrent version control system (CVS). Support for supporting other repositorys using third-party plugins in support of third-party code management applications. What is CVS? CVS was born in 1986, which appeared as a group of Shell scripts, but it has now developed into the most popular source code management solution for software developers. CVS is a client / server solution for open source management for code versions, which can be used in various platforms, including Linux and Windows NT / 2000 / XP. Please refer to the reference information at the end of this article, where there is a download link for the CVS client, server and source code.
Typically, the main function of CVS is to record the history of the source file. When a group of developers are engaged in the same project, CVS will leave each other. Each developer works independently in his own directory, then merges the results of the workload using the CVS repository (from time to time).
The Eclipse has a built-in CVS client that is closely integrated with the Eclipse platform IDE, which is implemented as a separate perspective (CVS Repository Exploring perspective) for interaction with CVS. General Eclipse Settings for CVS is located under Window -> Preferences WINDOW -> Team. After switching to the CVS Repository Exploring perspective, you can use all CVS (turn to Window -> Open Perspective -> Other -> CVS Repository Exploring menu - see Figure 1 and Figure 2).
Figure 1. Switch to CVS Repository Exploring perspective
First set the location of the repository, which will define the connection parameters used to select the CVS server / repository. Be sure to use the SSH tunnel (EXTSSH).
Figure 2. Browse the CVS repository in the CVS Repository Exploring perspective
Eclipse / CVS source code workflows In the CVS team collaboration model, team members have completed all their work in their respective works. Finally, they want to share their work. They achieve this through the CVS resource library. CVS uses a branch model to support multiple workflows that are independent and highly dependent on each other. These branches are places where the development team is used to share and integrate in progress. It can be considered that the branch is a shared workbench that updates this workbench when the team member changes the source code. This model allows each developer engaged in CVS team projects to share their work with other members when making changes, as well as accessing other members during project progression.
A special branch called HEAD is used to represent the main workflow in the repository (HEAD is often referred to as the main trunk). When team members submit resource to this branch, they will affect these relevance. Make sure the integrity of correlation is important because the branch represents the status of the current project. Of course, the team members can use the content of the branch as the foundation of the new job. Those rules are not only suitable for CVS: No matter which version control software used, there are some common steps for source code management. Below is an example workflow for CVS support using Eclipse:
1. Start a new team project Each new empty Eclipse project can be shared by CVS (or supported any other source management system). Developers can also share it by migrating its existing code to resource library. To share, click the project master folder, use the Team -> Share Project option in the context menu displayed, as shown in Figure 3.
Figure 3. Sharing the local project using the CVS repository
Another option creates a new workstore project by importing code from the selected CVS repository branch. As long as you choose the appropriate branch (or HEAD), select the "Checkout as Project" option from the context menu in the CVS Repository Exploring perspective, as shown in Figure 4.
Figure 4. Creating a new project from the existing CVS repository
2. Use the code and change the developer to use code locally through the Eclipse table, including the work, modify existing resources, write comments, and save these content locally after they use.
3. Synchronize local changes and CVS repository If a project developer is ready to submit him / her work, then first perform an update operation. This will target the resource library for the introduced changes and add these changes to the developer's local workbench. This ensures that developers know that these changes may affect the integrity of his / she will submit. Use the Compare with ... option in the project context menu to compare the local version to the code stored in the repository (see Figure 5).