mkbrtype

Creates/updates a branch type object

Applicability

Product

Command type

VersionVault

cleartool subcommand

VersionVault Remote Client

rcleartool subcommand

Platform

UNIX®

Linux®

Windows®

web

Synopsis

  • VersionVault:
    mkbrtype [ –rep/lace ] [ –glo/bal [ –acq/uire ] | –ord/inary ]
    [ –pbr/anch ] [ –c/omment comment | –cfi/le comment-file-pname

    | –cq/uery | –cqe/ach | –nc/omment ] branch-type-selector ...

  • VersionVault Remote Client:
    mkbrtype [ –rep/lace ] [ –glo/bal [ –acq/uire ] | –ord/inary ]
    [ –pbr/anch ] [ –c/omment comment | –cq/uery | –cqe/ach | –nc/omment ]

    branch-type-selector ...

Description

The mkbrtype command creates one or more branch types with the specified names for future use within a particular VOB. After creating a branch type in a VOB, you can create branches of that type in that VOB's elements, using mkbranch.

Instance constraints

The version-extended naming scheme requires that a branch of a version tree have at most one subbranch of a given type. (If there were two bugfix subbranches of the main branch, the version-extended path name foo.c@@/main/bugfix/3 would be ambiguous.) However, by default only one branch of this type can be created in an element's entire version tree. The –pbranch option loosens this constraint.

Recommended naming convention

A VOB cannot contain a branch type and a label type with the same name. To avoid problems, adopt this convention:

  • Use lowercase letters (az) for names of branch types .
  • Use uppercase letters (AZ) for label types.

Restrictions

Identities

No special identity is required unless you specify the –replace option. For –replace, you must have one of the following identities:

  • Type owner
  • VOB owner
  • root (UNIX® and Linux®)
  • Member of the VersionVault administrators group (VersionVault on Windows®)

Locks

An error occurs if one or more of these objects are locked: VOB, branch type (with –replace only).

Mastership

(Replicated VOBs only) With –replace, your current replica must master the type.

Options and arguments

Handling of name collisions

Default
An error occurs if a branch type named type-name already exists in the VOB.
–rep/lace
Replaces the existing definition of type-name with a new one. If you do not include options from the existing definition, their values are replaced with the defaults (Exception: the type's scope does not change; you must explicitly specify –global or –ordinary).

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.

Constraints:
  • You cannot replace the predefined branch type main.
  • If there are existing branches of this type or if the containing VOB is replicated, you cannot replace a less constrained definition (–pbranch specified) with a more constrained definition (omitting the –pbranch option).
  • When converting a global type to ordinary, you must specify the global type as the branch-type-selector argument. You cannot specify a local copy of the global type.

Specifying the scope of the branch type

Default
Creates an ordinary branch type that can be used only in the current VOB.
–glo/bal [ –acq/uire ]
Creates a branch type that can be used as a global resource by client VOBs in the administrative VOB hierarchy. With –acquire, mkbrtype checks all eclipsing types in client VOBs and converts them to local copies of the new global type.

For more information, see the Help.

–ord/inary
Creates a branch type that can be used only in the current VOB.

Instance constraints

Default
Only one branch of the new type can be created in a given element's version tree.
–pbr/anch
Multiple branches of the same type can be created in the version tree, but they must be created off different branches.

Event records and comments

Default
Creates one or more event records, with commenting controlled by your .versionvault_profile file (default: –cqe). See the comments reference page. Comments can be edited with chevent.
–c/omment comment | –cfi/le comment-file-pname |–cq/uery | –cqe/ach | –nc/omment
Overrides the default with the option you specify. See the comments reference page.

Specifying the branch types

Default
The branch type is created in the VOB that contains the current working directory unless you specify another VOB with the @vob-selector argument.
branch-type-selector...
Names of the branch types to be created. Specify branch-type-selector in the form [brtype:]type-name[@vob-selector]

Specifying the branch type

type-name

Name of the branch type

See the cleartool reference page for rules about composing names.

vob-selector

VOB specifier.

Specify vob-selector in the form [vob:]pname-in-vob

pname-in-vob

Path name of the VOB tag (whether or not the VOB is mounted) or of any file system object within the VOB (if the VOB is mounted)

Also see Recommended naming convention.

Examples

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.

  • Create a branch type named bugfix_v1, which can be used only once in an element's version tree. Provide a comment on the command line.

    cmd-context mkbrtype –c "bugfix development branch for V1" bugfix_v1
    Created branch type "bugfix_v1".

  • Create two branch types for working on program patches and a bug-fixing branch for release 2. Constrain their use to one per branch.

    cmd-context mkbrtype –nc –pbranch patch2 patch3 rel2_bugfix
    Created branch type "patch2".
    Created branch type "patch3".
    Created branch type "rel2_bugfix".

  • Change the constraint on an existing branch type so that it can be used only once per branch. Provide a comment on the command line.

    cmd-context mkbrtype -replace -pbranch \
    -c "change to one per branch" bugfix_v1

    Replaced definition of branch type "bugfix_v1".