CVS Module
DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.
In team development projects where more than one developer may work on the same code, there are a number of challenges, such as:
- knowing who changed what, and when;
- knowing why a given change was made; and
- when a new bug surfaces, finding out what change caused it
Forte for Java's CVS module helps you meet these challenges by making it easier to use the popular (and free) Concurrent Versions System (CVS) version control software.
How the CVS module works
The CVS module registers itself with the IDE as a file system. Files accessed through it have all the properties of files on the local file system (access dates, attributes, etc.) - along with two additional properties:
file state
andlocker status
.Note: Every operation is invoked in asynchronous manner, so that you can do your work and don't have to wait for commands to complete. Therefore, the file state and locker status of a file will not necessarily be visible until the CVS module needs this information (for example, when an attempt is made to modify a file) and requests it from your version control system.
The CVS Module is effectively an object wrapper which integrates CVS into the Forte for Java environment. For each action performed on your files, your version control system is called, and the information it returns on the command line is processed by the module.
Many of the calls to your version control system (for example, to retrieve status information) happen automatically, behind the scenes. However, there are some actions that must be performed manually, such as committing changes. When the CVS module is installed, a new node appears under the Repository tab of the Explorer with the label
Root of the [
your CVS] filesystem
. To manually dispatch commands to the version control system, right-click on select from the submenu accessed through this item on the context menu for the file or directory you are working with.Note: Since the CVS module is designed to work across many platforms and operating systems, some configuration is necessary to get the systems interacting properly. CVS is called from within the context of a command shell.
Using the CVS module
Before you begin
If you have not already done so, download and install CVS on to your system. The GNU website at http://www.gnu.org/ is one place where you can obtain more a copy of CVS as well as more information.
You will then need to configure the CVS module according to your needs and set up the working directory it will use (see the sample project below).
Sample project using the CVS version control system
You should have the CVS system installed on your system before you start using it from within Forte for Java IDE. If you are not sure if it is installed, start a command shell and type cvs. If it is installed, a help message will appear. Ensure that you have the path to CVS properly set and that you have a CVS directory.
Important: If you have not worked much with CVS, we strongly recommend you take the time to familiarize yourself with the documentation for it.
To set up CVS with Forte for Java:
- Create the version control file system nodes in the Repository by choosing File | New Package; or
- Alternatively, create a new directory outside of the IDE. For example in Unix you might type:
$ mkdir -p /home/work/RepositoryOnce you have set up the CVS module, you can begin creating projects.
To create a project:
- In the Explorer window of the IDE, select the Repository tab, right-click on the
Repository
node, and chooseNew CVS
from the context menu.- In the Customizer dialog that appears, configure the module to communicate with CVS by:
- Setting up a working directory for your project.
- Choosing the destination of the CVS Repository. If it is located on your local drive, select
local
. Otherwise selectserver
orpserver
to access the repository on a server.- For server configuration, enter your name and server name.
- Click Browse to specify the CVS repository for your project (for example,
/home/username/work/CVSDemo
). Find or create a directory for the project - this is where the versions of your files used by the version control system will be stored.- Enter the name of the module you want to work with. If you want to work with the whole directory, then leave the field blank.
- Click Browse to specify the working directory
- If the CVS repository has not yet been initialized, right-click on the CVS file system in the Repository and select INIT from the context menu.
To create the project CVSDemo:
- First create the desired project files in your working directory. Then select the New Package command in the IDE (from either the File menu or the context menu of the VCS root node in the IDE's Repository.
- Create a new class called
Test1
by right-clicking on the node in the IDE's Repository for the directory you created. Choose New from Template | Classes | Class. Enter Test1 for the class name and click OK.- Refresh CVS by again right-clicking on
Root of the CVS filesystem
in the Explorer and selecting Version Control | Refresh.Test1
's file status should now show up asNot in Project
.- Add Test1 to the project by right-clicking on
Test1
and choosing CVS | Add to add theTest1
file to your project. Commit the change by then selecting CVS | Commit from the same menu.- Use the Import command to import the whole directory structure into the CVS Repository by selecting CVS | Import. Then check out this first revision to your working directory by selecting Version Control | Check Out from the same menu.
- Refresh CVS (see step 3.)
- Now your
Test1
file should have the statusLocally Added
. At this point you have the option of dispatching the Commit command to the version control system, and the current contents of your file will be recorded as one of the versions accessible through the version control system.- Edit the files
- You can now work with your files as you wish. Try adding some code to
Test1
. If you then choose the CVS | Refresh command, the results will show that the files have changed. When you are done, choose the CVS | Commit command. Your file's status will change fromLocally Modified
toUp-To-Date
.
- At any time you can use the CVS | Refresh command on any file or directory to refresh the status information. Use the Version Control | Refresh Recursively command to start asynchronous status retrieval of an entire directory tree. This can improve the speed of browsing files on large projects (otherwise Refresh commands are dispatched to the version control system as you open folders). It is advisable to refresh recursively after major changes in your version control directory structure. The refresh process can be stopped at any time if desired.