Version Control
 What is CM?

 What Problems?

 Version Control

 Checkouts

 CM Quiz

 Versions & Branches

 Views

 ClearCase on NT

 Projects

 Essential Commands





What is Version Control?
A Version Control System manages versions of files without any regard to how they are combined. Tools like RCS, SCCS and PVCS are all version control systems. CM systems like ClearCase (and CVS, which is based on RCS) also provide version control along with their configuration management services.

ClearCase provides version control for all kinds of files (e.g. source, documents, libraries, etc.) and also for directories. Systems like SCCS and RCS are primarily designed for managing ASCII files.

The Checkout/Checkin Model
All version control and CM systems share a common check-ou/check-in model. You have to check a file out of the source repository before you can edit it and you have to check it back in when you are satisfied with your changes.

All version control and CM systems keep track of who made each change, when it was made, etc. They also keep track of who has checked out what files and when. All these system collect a comment from the person checking the file in. People use these comments to describe the change they made to the file.

How do you check a file out?
cleartool checkout filename

How do you check a file in?
cleartool checkin filename

How do you cancel a checkout?
(For example, if you decide you don't want the changes you've made.)
cleartool uncheckout filename

How do you find out which files are checked out in the current directory?
cleartool lscheckout

The commands above are examples of typical ClearCase commands. The program cleartool accepts arguments which tell it which operation to perform and on what file(s) or directory(s). Most commands also have a variety of options as well. The first word after cleartool identifies the operation, and any remaining arguments apply to that operation. This course includes a summary of useful ClearCase commands .

NT Note: On NT Systems you may select files in the File Manager and then choose Checkout from the ClearCase menu. The selected items will be checked out. The shorthand notation for this is:

ClearCase->Checkout

There are also menu selections for Uncheckout and Checkin.

Labeled Versions
Like RCS, ClearCase provides a way to label a version with a name (called a symbolic name in RCS). Versions are normally just identified with numbers. Using a label allows you to recognize the significance of a given version of a file.

We can apply the same label to all the files in a configuration, and then we know instantly which version went along with that configuration. A given version can have more than one label. For example, if a given file did not change across three releases, it might have three different release labels on the same version. Labels can also be moved from one version of a file to a different version, but we sometimes choose to lock some labels so they can't move. More on that later.

A special label, LATEST, is automatically maintained by ClearCase. It always appears on the latest version, which is the one most recently checked in.

ClearCase Manages Directories
Unlike all the other systems mentioned, ClearCase also manages directories. That means you have to check the directory out if you want to add or remove files, or create symbolic links. When you are satisfied with your directory maneuvers you check the directory back in.

How do you add a new file you want ClearCase to manage to the current directory?
cleartool checkout .
cleartool mkelem filename
The specified filename must already exist. After the command the directory and the new file will be left checked out. Nobody else will see the new file until you check them both in.

How do you remove a file ClearCase manages from the current directory?
cleartool checkout .
cleartool rmname filename
How do you create a new directory?
cleartool checkout .
cleartool mkdir dirname

The fact that ClearCase manages directories is one of its most profound capabilities. Because directories are managed, older configurations are not compromised when a file is moved from one directory to another, or when an obsolete file is removed. Moving a file from one directory to another in SCCS, RCS, PVCS or CVS will break previous configurations because the older versions of the makefiles expect to find the moved files in their original locations.


Previous Page Next Page
What Problems? Checkouts
Course Map
Search Help


Problems? Contact the webmaster: hoco@timefold.com
All content Copyright © 1998-2007 Howard Cohen.
All rights reserved worldwide.
Do not print or duplicate.