A ClearCase element is the history for one file
or directory. It
contains all the versions on all the branches for that file.
It also contains all the information about the
file, such as which versions are labeled with what labels,
which versions are checked out, when versions were checked
in, by whom, etc. An element contains everything there is
to know about a file.
In RCS and SCCS these are called history files.
RCS history
files end with ,v
. SCCS history files
begin with s.
.
All files and directories managed by ClearCase have
exactly one element.
You can change the name of a file or directory at any time,
or move it from one directory to another, but it still
associated with the same element.
Element and File Safety
Elements should never be removed, because it compromises
older configurations!
The following sequences are
completely safe and do not harm older configurations:
- Remove a file from the current directory:
-
cleartool checkout .
cleartool rmname filename
- Rename a file in the current directory:
-
cleartool checkout .
cleartool mv oldname newname
- Move a file from one directory to another:
-
cleartool checkout fromdir
cleartool checkout tomdir
cleartool mv fromdir/filename todir/.
You will be prompted for a checkout comment when
you check out the directory.
Note that removing a file from a directory is not the same
as removing the element. Removing a file from a directory
just tells ClearCase that from now on that file is not
in the directory. It still remains in previous versions of
the directory.
This course does not even show
you how to remove an element. Chances are good that your
company has taken steps to prevent you from removing elements by
making the command privileged.