Changing the scope of a type

You can change the scope of a type from local to global, or from global to local.

About this task

To convert an existing ordinary type to a global type, enter the appropriate mkobjecttype command with the options –replace, –global, and –acquire. This converts the type to a global type, and also converts any identical types (those that have the same type and the same name) in other VOBs in the hierarchy to local copies of the type. For example, assume a VOB \dev and its administrative VOB \admin contain identical ordinary label types named IDENT.

Procedure

  1. Describe the label type in the administrative VOB:

    cleartool describe lbtype:IDENT@\admin
    label type "IDENT"
      created 02-Aug-99.15:32:52 by Suzanne Gets (smg.user@neon)
      owner: smg
      group: user
      scope: this VOB (ordinary type)
      constraint: one version per element

  2. Describe the label type in the ordinary VOB:

    cleartool describe lbtype:IDENT@\dev
    label type "IDENT"
    created 01-Aug-99.15:33:00 by Suzanne Gets (smg.user@neon)
    owner: smg
    group: user
    scope: this VOB (ordinary type)
    constraint: one version per element

  3. Convert the label type in the administrative VOB to a global type.

    cleartool mklbtype –replace –global –acquire IDENT@\admin
    Replaced definition of label type "IDENT".

  4. Describe the types again.
    The output of the describe command shows that the label type in the administrative VOB is now global, and the other label type is now a local copy of the global type:

    cleartool describe –local lbtype:IDENT@\admin lbtype:IDENT@\dev
    label type "IDENT"
      created 02-Aug-99.15:32:52 by Suzanne Gets (smg.user@neon)
      owner: smg
      group: user
      scope: global
      constraint: one version per element
      Hyperlinks:
        GlobalDefinition <- lbtype:IDENT@\dev
    label type "IDENT"
      created 02-Aug-99.15:32:52 by Suzanne Gets (smg.user@neon)
      owner: smg
      group: user
      scope: this VOB (local copy of global type)
      constraint: one version per element
      Hyperlinks:
        GlobalDefinition <- lbtype:IDENT@\dev

Example

To convert an existing global type to an ordinary type, enter the appropriate mkobjecttype command with the options –replace –ordinary. This converts the type and all its local copies to ordinary types. You must specify the global type in the command; you cannot specify a local copy of the type. For example, to convert the global element type doc_file, defined in VOB \admin to an ordinary type, enter the following command:

cleartool mkeltype –replace –ordinary –nc eltype:doc_file@\admin

You can also use the –replace option to change the scope of a type if you created the type or are a privileged user.