IBM Support

Handling binary files in ClearCase

Technote (FAQ)


Question

Which methods are available to manage binary files that are stored in an IBM® Rational® ClearCase® VOB in either a base ClearCase or UCM environment?

Answer





Overview

Binary files are handled in UCM the same way they are handled in base ClearCase; they cannot be merged.

ClearCase can only merge text files; therefore a different strategy must be deployed in order to manage change related to binary content.

In order to effectively manage binary files in ClearCase, new element types must be defined to handle these file types. The following options are available:

  • Configure element type to be never considered for merging. ClearCase will not attempt to merge elements with a never merge type. These elements will be left unchanged during a deliver or rebase operation and you will not be prompted to merge them.
  • Available in ClearCase 7.0 and later: Configure element type to copy. For elements with a copy type, ClearCase will, in a merge, replace the target version with the source version without user interaction. See technote 1240740 for more information.

Note: The following instructions are taken from the point of view of the Microsoft® Windows® operating system. The steps may differ on UNIX® and Linux®, but the concepts apply exactly.

Instructions for non-replicated VOBs

Note: The element type can be created from command line or the GUI.

  1. Reuse an existing element type or Create a new one from the command line or GUI. See step 2 if the element type already exists.

    Review the ClearCase Reference Guide on the topic of mkeltype (cleartool man mkeltype) for more details.


    GUI example > Create:
    • Open Type Explorer GUI for the VOB (Start > Programs > Rational ClearCase> Type Explorer)
    • Select the VOB where binary files exist.

    • Open the element type folder
    • Right-click and create a new element type.
    • Give the element type a name (for example NEVER_MERGE or COPY or any name of your choosing).
    • Click OK

      Example: NEVER_MERGE


      Example: COPY



  2. From the Type Manager tab in the element type's Properties dialog box, enable the option to

    Never consider elements of this type for merging




    or

    Always copy elements of this type (ClearCase 7.0 or later)




  3. For the binary elements that already exist in the VOB, use cleartool chtype to change these types to the new element type.

    Review the ClearCase Reference Guide on the topic of chtype (cleartool man chtype) for more details.
  4. For the binary files that do not yet reside in the VOB, the magic file can be edited to call the new element type for elements with a certain extension. Upon element creation these files will use the new type you have defined to manage those file elements.

    Review the ClearCase Reference Guide on the topic of cc.magic, default.magic (cleartool man cc.magic) for more details.


Instructions for replicated VOBs

The same steps are required as above; however, the element types need to be created from the command line in a replicated environment .

Note: The GUI can only be used in non-replicated VOBs; if ClearCase MultiSite is enabled, then you will not be able to remove an element type or change the definition of an element type from theType Explorer, and the command line syntax must be used.

Review technote 1148740 Changing used element types in a replicated VOB for additional information about working with element types in a replicated VOB.

Example:

Never Merge Example:

M:\view\vob>cleartool mkeltype -supertype file -mergetype never -nc FILE_NEVER_MERGE
Created element type "FILE_NEVER_MERGE".

Copy Example:

M:\view\vob>
cleartool mkeltype -supertype compressed_file -mergetype copy -nc COMPRESSED_FILE_COPY_MERGE
Created element type "COMPRESSED_FILE_COPY_MERGE".




The definitions for trivial and manual merging

Trivial: The base and the destination versions of the element are the same.
This means the element can simply be copied from the source to the destination view. A trivial merge is automatically determined by merge or findmerge and thus will be taken care of for you.

Manual: The source and destination versions of the element contain one or more conflicts that you must resolve. A manual merge thus requires that you:
  1. Check out the destination version.
  2. Copy the data from the source version to the destination version.
  3. Checkin the destination version.
  4. Manually draw the merge arrow in a version tree GUI or you can run the 'cleartool merge' command with a -ndata switch to manually establish the merge arrow between the source and destination versions.

Related information

Trivial merge operation on a binary file
Can't redefine element types when VOB is replicated
Japanese technote 1385116
A Japanese translation is available


Cross reference information
Segment Product Component Platform Version Edition
Software Development Rational ClearCase UCM: Deliver
Software Development Rational ClearCase Merging
Software Development Rational ClearCase UCM: Rebase

Document information

More support for: Rational ClearCase
Merging

Software version: 7.0, 7.0.1, 7.1, 2003.06.00, 2003.06.16

Operating system(s): AIX, HP-UX, IRIX, Linux, Solaris, Windows

Reference #: 1123371

Modified date: 16 September 2009


Translate this page: