The mkeltype command creates one or more user-defined element types for future use within a VOB. User-defined element types are variants of the predefined types. (See complete list in Predefined element types.) After creating an element type, you can create elements of that type by using mkelem, or you can change an existing element's type by using chtype. To remove an element type, use the rmtype command.
In some cases, you can specify a merge behavior for an element type when you create it. This is true for element types used in a UCM deliver or rebase operation. (See the deliver and rebase reference pages). There are four kinds of merge behavior, described here with their associated keywords.
To specify a behavior, use one of the keywords as the argument to the –mergetype option. If the option is not specified, automatic merge behavior is in effect for elements of this element type.
When you create a new element type, you must specify an existing element type as its supertype. The new element type inherits the type manager of the supertype, unless you use the –manager option. The type manager performs such tasks as storing/retrieving the contents of the element's versions. (See the type_manager reference page.)
For example, you create an element type c_source, with text_file as the supertype; c_source inherits the type manager associated with the text_file supertype—the text_file_delta manager.
You can use the lstype command to list both the supertype and the type manager of an element type.
Each VOB is created with the following element types:
You can use any of these element types as the –supertype specification.
This section applies to the element types text_file and compressed_text_file, to all subtypes of these types, and to all user-defined element types derived from them through the supertype mechanism.
When a load operation is issued from a snapshot view, or a user program accesses a version through a dynamic view, the type manager handles it as follows:
On subsequent accesses to the same version, steps 1 and 2 are skipped; the program accesses the existing cleartext file, which is cached in the cleartext storage pool.
Operating systems vary in their use of text-file line terminators. To avoid confusion, each ClearCase view has a text mode, which determines the line terminator for text files in that view. (See the mkview reference page.) After the type manager constructs a cleartext file for a version, its line terminators may be adjusted before the version is presented to the calling program. Adjustment of line terminators can also occur when the checkout command copies a version of a text file element, creating a view-private file (the checked-out version).
If you specify a comment when using –replace, the comment appears in the event record for the modification (displayed with lshistory –minor); it does not replace the object's creation comment (displayed with describe). To change an object's creation comment, use chevent.
Also, when converting a global type to ordinary, you must specify the global type as the element-type-selector argument. You cannot specify a local copy of the global type.
For more information, see the IBM Rational ClearCase Administrator's Guide.
Specify element-type-selector in the form [eltype:]type-name[@vob-selector]
The UNIX system and Linux examples in this section are written for use in csh. If you use another shell, you may need to use different quoting and escaping conventions.
The Windows examples that include wildcards or quoting are written for use in cleartool interactive mode. If you use cleartool single-command mode, you may need to change the wildcards and quoting to make your command interpreter process the command appropriately.
In cleartool single-command mode, cmd-context represents the UNIX system and Linux shells or Windows command interpreter prompt, followed by the cleartool command. In cleartool interactive mode, cmd-context represents the interactive cleartool prompt.
cmd-context mkeltype –supertype text_file –nc c_source
Created element type "c_source".
cmd-context mkeltype –supertype file –nc bin_file
Created element type "bin_file".
cmd-context mkeltype –supertype bin_file –nc exe_file
Created element type "exe_file".
cmd-context mkeltype –supertype directory –c "directory type for include files" incl_dir Created element type "incl_dir".
cmd-context mkeltype –replace –supertype bin_file –ptime
–c "change archive mod time default" archive
Replaced definition of element type "archive".
cmd-context mkeltype –supertype file –mergetype never –nc grph_file
Created element type "grph_file".