Merging directory versions

A feature of DevOps Code ClearCase® is versioning of directories. Each version of a directory element catalogs a set of file elements and directory elements (and VOB symbolic links on Linux and the UNIX system). In a development project, directories change as often as files do. Merging the changes to another branch is as easy merging files.

Take a closer look at the source tree scenario that is described in Merging a new release of an entire source tree. Suppose you find that the vendor has made the following changes in directory /vobs/proj/mathlib/src:
  • File elements Makefile, getcwd.c, and fork3.c are revised.
  • File elements readln.c and get.c are deleted.
  • A new file element, newpaths.c, is created.

When you use findmerge to merge the changes made in the VEND_R4 sources to the enhance branch, the changes to both the files and the directory are handled automatically. The following findmerge excerpt shows the directory merge activity:

********************************
<<< directory 1: /vobs/proj/mathlib/src@@/main/3
>>> directory 2: .@@/main/enhance/1
>>> directory 3: .
********************************
-------[ removed directory 1 ]-------|----------[ directory 2]------------
get.c  19-Dec-1991 drp               |-
*** Automatic: Applying REMOVE from directory 2
-----------[ directory 1 ]-----------|--------[ added directory 2]---------
                                    -| newpaths.c  08-Mar.21:49 drp
*** Automatic: Applying ADDITION from directory 2
-------[ removed directory 1 ]-------|-----------[ directory 2]------------
readln.c  19-Dec-1991 drp              |-
*** Automatic: Applying REMOVE from directory 2
Recorded merge of ".".

If you have changes to merge from both files and directories, it may be a good idea to run findmerge twice: first to merge directories, and again to merge files. Using the –print option to a findmerge command does not report everything that is merged, because findmerge does not see new files or subdirectories in the merge-from version of a directory until after the directories are merged. To report every merge that takes place, use findmerge to merge the directories only, and then use findmerge –print to get information about the file merges that are needed. Afterward, you can cancel the directory merges by using the uncheckout command on the directories.