Team development using JBuilder

JBuilder 4 provides team development features that allow you to maintain file revisions with or without an integrated version control system. You can refer to prior backup versions in any edition of JBuilder by using the history view. In JBuilder Enterprise edition, you can use the seamless Concurrent Versions System (CVS) interface or you can integrate another version control system using the OpenTools API. For more information on using the OpenTools API, see the samples directory of your JBuilder installation and "Developing Open Tools" from the Help Contents page.

Team development means safe development when you use effective version control. Version control prevents accidental loss of information while it enables effective version tracking and revision. The two most important reasons to use version control are:

Using the history view

The history view lets you see prior versions of a file using any available file version type, including multiple backup versions, saved local changes, and the buffer of an active file.

Since the history view is in the content pane, its pages reflect the currently active file. Double-click a closed file in the project pane to open it and make it active. Click an open file's file tab in the content pane to make it active.

There are three pages in the history view. They provide the following features:

Using version control

Version control systems (VCSs) require a repository and a workspace. The repository keeps the current master version of each file and maintains a record of all the changes that have been made to each file. The workspace keeps only the version of each file that an individual user has most recently updated and modified. Some VCSs let only one user at a time use a file, while others let multiple users use the same file simultaneously.

When revisions are posted from the workspace to the repository, the version control system stores only the changed parts of the master copy. The rest of the file is unchanged. The part that was revised is stored in the repository, along with information about where it came from and when it was changed.

To benefit from version control, users must:

When users use this process, all changes are available to every developer who has access to that repository.


Definitions

These are words that have specific meanings in the context of version management:
Workspace
The area you affect directly, and which you must maintain yourself. When you make changes to a file, you make them and save them in the workspace first.

Update
Retrieves changes from the repository and applies them to your workspace.

Repository
Where the modules and revision records that you have put into version control are kept. This may be on your local machine or on a remote server.

Remove
Removes a file from the repository. The file must first be deleted from your workspace.

Project
Refers both to the files and settings that make up one body of work, and to the organizational file used in JBuilder that manages the list of those files and settings.

Module
A container for a group of associated files that are stored together in the repository for better file management and user convenience.

Merge
CVS and some other systems don't lock files when they are being used. To preserve all changes, these systems use the merge command: it combines changes from the repository with changes in the workspace. Saved workspace changes are not overwritten, and textual conflicts are preserved and flagged to be reconciled by the user. In CVS, an update includes a merge.

Commit
Applies changes from your workspace to the repository. You must commit file changes, file additions, and file deletions to the version control system in order to make them available to other users.

Checkout
Posts a module from the repository to your workspace. When using CVS, this should only be done the first time. After that, files can be synchronized by updating them.

Add
Adds a file to the project module.


Version control in the JBuilder IDE

The following are features of JBuilder Enterprise edition

JBuilder 4, Enterprise edition seamlessly integrates with CVS, a widely used Open Source version control system. JBuilder has a responsive interface that provides context-sensitive access to the most common CVS commands from within the AppBrowser. You can create modules, check out projects, add or remove files, check the CVS status of any file, and commit changes from within the JBuilder interface. You can view and sort file revisions for a whole project at a time.

JBuilder also provides an OpenTools API that allows you to integrate other version control systems into JBuilder. JBuilder includes a sample of version control integration code and a Concept Document describing how version control integration works in the OpenTools API.

The version control sample is in the samples directory of your JBuilder installation. To see the OpenTools documentation, select Help | Help Topics, look in the Contents page, and select Developing OpenTools.

Note that CVS stores files in modules, while JBuilder organizes projects within project files. While files referred to in a JBuilder project can reside in different directory trees, files in a CVS module must reside in a single tree.

Both JBuilder projects and CVS modules provide the means to track certain functions and maintain the changes you make. Both have fail-safes that help you avoid committing certain basic mistakes. In both cases, these fail-safes require you to follow certain procedures in order to maintain the integrity of what you have created, while allowing you to manipulate it safely.

When you create a CVS module in JBuilder, several things happen:

To learn how to install CVS on your machine and to configure the connection for JBuilder, see "Installing and configuring CVS." See "CVS from the command line" for additional CVS commands that you can use from the command line.


Configuring the CVS connection

Configuring your connection to CVS within JBuilder allows JBuilder to access the repository. See the "Configuring CVS in JBuilder" topic in "Installing and configuring CVS" to learn how to configure this connection.

If you install and configure CVS, all types of file revisions (buffer, backup, and repository) and all version control commands become available.

All of the file-level and project-level commands are available from the Team menu. File-level commands are also available from the right-click menu in the project pane. You can select multiple files in the project pane and then use the right-click menu to perform CVS commands on the group of selected files.


File-level Team menu commands

These commands work on the file that is active in the content pane:

Project-level Team menu commands

These commands work on all the files in the active project:


CVS from the command line

These are additional CVS commands which you may find useful. These instructions assume you already have CVS installed and configured on your machine. If not, see "Installing and configuring CVS".

Creating a CVS repository

  1. At the command line, type:
    	cvs -d :local:[target drive or root]/repo init
  2. Press Enter. CVS will create the repository for you and return you to the prompt.

Adding a directory

  1. Put the command line at the target directory level and type:
    	cvs add [directoryname]
  2. Commit the changes.

Adding several files to a directory

  1. Put the command line at the applicable directory level and type:
    	cvs add thisfile.java thatfile.java theotherfile.java
  2. Commit the changes.

Removing a directory

  1. Put the command line at the parent directory level and type:
    	cvs remove -f directoryname
  2. Commit the changes.
    You can substitute delete for remove.

Removing several files from a directory

  1. Put the command line at the applicable directory level and type:
    	cvs remove -f thisfile.java thatfile.java theotherfile.java
  2. Commit the changes.

You can substitute delete for remove.

Removing all the files from a directory

  1. Put the command line at the applicable directory level and type:
    	cvs remove -f *
  2. Commit the changes.

You can substitute delete for remove.

Getting command help in CVS


There are many online references that provide extensive CVS documentation. At the time of publication, these include: