- You have an existing CVS project that you want to work with via Eclipse.
- You have started Eclipse in a fresh workspace.
- Select File > New > Project.
- Expand the CVS tab, select Projects from CVS, and click Next.
- Fill out the CVS repository's information as shown below in Figure 1 and click Next. (Note that you may need to talk to your CVS administrator to appropriately fill out this form. The Host field specifies the TCP/IP host name of the system hosting the CVS server. The Repository path field specifies the full-qualified path to the CVS repository on the host system (e.g., on a Linux-based system, this might be something to the effect of /home/CVSRep). The Authentication options are of course the user name and password with which connections should be made to the host system. The Connection options instruct Eclipse as to how it should attempt to connect to the host system.)
Figure 1: Fill out the CVS repository location information. (Click images to enlarge.)
- Specify the CVS module to import. You can either manually specify the module to check out or load the list of existing modules and then click Next, as shown below in Figure 2.
Figure 2: Specify which CVS module to check out.
- On the Check Out As screen, select the Check out as project in the workspace option, using the default project name (unless there's some reason you want to customize these options), and click Next.
- Click Next on the Check Out As screen.
- Select the CVS project branch to check out and click Finish; in most cases, you will want to check out the HEAD branch as this is where most new development occurs.
Congratulations! You have now created your first Eclipse project as it exists in your CVS module!
What Else Can I Do?
Now that you have checked out a CVS module into an Eclipse project, there's a new Team right-click option (Figure 3) available to you on any of your project components (e.g., the project itself, modules, files, etc.).
Figure 3: You've unlocked the Team menu.
You may now access any function CVS normally provides: add file(s) to version control, commit new changes, update per the latest version in the repository, create patches, etc. And as I mentioned earlier, not only can you perform these operations at the individual file level, but you can also do them at the directory level (e.g., you can recursively update or commit all children of a specific directory).
Another nice feature is that any file that has been changed since it was checked out will be marked with a greater-than symbol (>) before its name, making it intuitive that something's changed.
Another helpful feature Eclipse provides is the Synchronize with Repository function under the Team menu. This function provides the ability to view a listing of all files that you have changed or that have changed in the CVS repository. You are then given the opportunity to commit new changes, accept incoming changes, or if necessary, merge changes. This provides a simple mechanism to determine which new code you pull from the repository and which code you push to the repository that traditional CVS clients do not offer.
In a nutshell, these integration features allow you to conveniently bundle your versioning system and your development into a single environment (i.e., Eclipse) in an extremely user-friendly fashion. While there are several more features to explore, these steps should point you in the right direction. Until next time, happy coding!