IBM Support

Handling binary files in ClearCase

Question & Answer


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:


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.

[{"Product":{"code":"SSSH27","label":"Rational ClearCase"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Merging","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF015","label":"IRIX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"2003.06.00;2003.06.16;7.0;7.0.1;7.1","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSSH27","label":"Rational ClearCase"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"UCM: Deliver","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSSH27","label":"Rational ClearCase"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Merging","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSSH27","label":"Rational ClearCase"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"UCM: Rebase","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
16 June 2018

UID

swg21123371