6.2 Moving, Removing, and Renaming Elements

This section explains how to move, remove, and rename elements.

Moving and Removing Elements

Because directories as well as files are under ClearCase control, you can move or remove elements from specific versions of directories without affecting the element itself. Moving or removing elements creates new versions of the parent directories to record the modifications.

For example, version 4 of \gui_vob\hello_world\src contains an element named prog.c. If you remove prog.c from the hello_world\src directory, ClearCase creates version 5 of \gui_vob\hello_world\src, which does not contain the prog.c file element. The element prog.c itself is not modified (Figure 32).

Figure 32 Removing an Element Name from a Directory

Before you move or remove an element name from a directory, verify with your project manager that your changes will not adversely affect other team members or break project builds.

To Move an Element Within a VOB

Do one of the following:

To Move an Element to Another VOB

Use the cleartool relocate command.

WARNING: The relocate command makes irreversible changes to at least two VOBs and their event histories. We recommend that you not use it for minor adjustments. Furthermore, we recommend that you stop VOB update activity before and during a relocate operation. Check with your project manager and ClearCase administrator before using the relocate command.

To Remove an Element Name from a Directory

In the ClearCase Explorer Details pane, right-click an element and click Delete.

Other Methods for Removing Elements

Removing an element from its parent directory does not affect the element itself, but two other types of a removal operation do irrevocably affect an element, and we recommend that you be very conservative in using these operations:

Renaming Elements

Renaming an element creates a new version of the parent directory to catalog the new element name. The element uses its new name in subsequent versions of its parent directory, but previous versions of the parent directory refer to the element by its previous name (Figure 33).

Figure 33 Renaming an Element

Before you move or remove an element name from a directory, verify with your project manager that your changes will not adversely affect other team members or break project builds.

To Rename an Element
  1. In the ClearCase Explorer Details pane, right-click an element and click Rename.

  2. In the Details pane, type a new name for the element

  3. Press ENTER.