TechTip: Integrating CVS and Eclipse PDF Print E-mail
Tips & Techniques - WebSphere
Written by Joe Cropper   
Thursday, 18 October 2007

Merge your versioning and your development into a single, user-friendly environment.

Eclipse is a widely used Integrated Development Environment (IDE) supporting many languages, including Java, PHP, and even C and C++, just to name a few. The word integrated in IDE is very important; it means that Eclipse should not only allow you to write, test, debug, deploy, etc. your code, but it should also allow you to (easily) work on a versioned project with a group of developers.

So does Eclipse itself provide this support? Not directly, but it does provide excellent integration with the Concurrent Versions Systems (CVS) product. This article assumes a general understanding of some of the CVS concepts and terminology; if you are unfamiliar with CVS, please visit the official CVS Web site for additional information about how you can start using CVS to facilitate your project's needs.

Getting Started

Let's make a couple of assumptions before we get started:

  • You have an existing CVS project that you want to work with via Eclipse.
  • You have started Eclipse in a fresh workspace.

Now that we've established common ground, you can load your CVS project into your Eclipse workspace by following these simple steps:

  1. Select File > New > Project.
  2. Expand the CVS tab, select Projects from CVS, and click Next.
  3. 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.)

    http://www.mcpressonline.com/articles/images/2002/TechTip%20-%20The%20Integration%20of%20CVS%20and%20Eclipse_Oct07V3--10190700.png
    Figure 1: Fill out the CVS repository location information. (Click images to enlarge.)
  4. 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.

    http://www.mcpressonline.com/articles/images/2002/TechTip%20-%20The%20Integration%20of%20CVS%20and%20Eclipse_Oct07V3--10190701.png
    Figure 2: Specify which CVS module to check out.

  5. 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.
  6. Click Next on the Check Out As screen.
  7. 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.).

http://www.mcpressonline.com/articles/images/2002/TechTip%20-%20The%20Integration%20of%20CVS%20and%20Eclipse_Oct07V3--10190702.png

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!

 
Discuss (5 posts)
lujate
TechTip: Integrating CVS and Eclipse
Nov 01 2007 12:04:00
AFAIK, the answer is no. <p>CVS works by storing the source in a traditional (Windows or UNIX) file structure. That is not compatible with iSeries source files/members.
#113668
Jeff Crosby
TechTip: Integrating CVS and Eclipse
Nov 01 2007 08:48:00
gabl wrote:<BR>
> would be great using Eclipse for editing RPG(IV) code.<BR>
<P>
Yes, it exists.<BR>
<P>
It's called WDSC (Websphere Development Studio Client) and it's at V7.<BR>
#113667
gabl@cpis.es
TechTip: Integrating CVS and Eclipse
Oct 31 2007 21:08:00
would be great using Eclipse for editing RPG(IV) code.
#113666
plevy@alliance.com
TechTip: Integrating CVS and Eclipse
Oct 19 2007 11:24:00
I've been wondering, can CVS be used with traditional iSeries source members?
#113665
MC Press Web Site Staff
TechTip: Integrating CVS and Eclipse
Nov 01 2007 12:04:00
This is a discussion about <B>TechTip: Integrating CVS and Eclipse</b>.<p align='center'><a href=http://www.mcpressonline.com/mc?1@232.1KNKfHX1eQT.17@.6b50a7aa>Click here for the article</a>.</p>
#113664


Discuss...
User Rating: / 0
PoorBest 

Joe Cropper
About the Author:
Joe Cropper is a Software Engineer at IBM in Rochester, Minnesota. Joe holds a B.S. in Computer Science and works as a software developer on the Electronic Customer Care Common Client team. His areas of expertise include database, multi-tiered client-server technologies, and a variety of object-oriented programming languages.  Joe can be reached via email at This e-mail address is being protected from spam bots, you need JavaScript enabled to view it .
Read More >>
Related Articles
< Prev   Next >
   MC-STORE.COM