8.5 Assigning Branch Mastership During Element Creation

By default, when you create an element in a replicated VOB, mastership of the branch main is assigned to the replica that masters the branch type main. If this replica is not your current replica, you cannot create new versions on the main branch. Also, if your config spec contains mkbranch rules and your current replica does not master the branch types, the branches cannot be created during element creation.

To assign mastership of a new element's main branch, and all other branches created during element creation, to your current replica, do one of the following:

For example, suppose your view has the following config spec:

element * CHECKEDOUT
element * .../v1.0_bugfix/LATEST
element * V1.0 -mkbranch v1.0_bugfix

Use the following procedure to assign mastership of new branches to your current replica:

  1. Create a new element with mkelem -master and check out the file:

  2. cleartool mkelem -master -c "adding comments" cmdsyn.c
    Created element "cmdsyn.c" (type "text_file").
    Created branch "v1.0_bugfix" from "cmdsyn.c" version "/main/0".
    Note: Branch "v1.0_bugfix" explicitly mastered by replica "boston_hub".
    Branch type "v1.0_bugfix" mastered by replica "sanfran_hub".
    Checked out "cmdsyn.c" from version "/main/v1.0_bugfix/0".

  3. Use the describe command to confirm that the new branches are mastered by your current replica:

  4. cleartool describe cmdsyn.c@@/main cmdsyn.c@@/main/v1.0_bugfix
    branch "cmdsyn.c@@/main"
    created 02-Sep-00.13:17:21 by Gail Smith (gail.user@boston30)
    branch type: main
    master replica: boston_hub@/vobs/dev
    ...
    branch "cmdsyn.c@@/main/v1.0_bugfix"
    created 02-Dec-00.13:17:21 by Gail Smith (gail.user@boston30)
    branch type: v1.0_bugfix
    master replica: boston_hub@/vobs/dev
    ...

If you make your current replica the master of newly created branches, but do not check out the file (that is, you use the -nco option), only the main branch is mastered by your current replica, because it is the only branch that is created. For example:

  1. Create a new element with mkelem -nco -master:

  2. cleartool mkelem -nco -master -c "adding comments" cmdsyn.c
    cleartool: Warning: Moved private data from "cmdsyn.c" to "cmdsyn.c.keep" so it won't eclipse element.
    Created element "cmdsyn.c" (type "text_file").

  3. Use the describe command to confirm that the main branch is mastered by your current replica:

  4. cleartool describe cmdsyn.c@@/main
    branch "cmdsyn.c@@/main"
    created 02-Sep-00.13:21:21 by Gail Smith (gail.user@boston30)
    branch type: main
    master replica: boston_hub@/vobs/dev
    ...

  5. List the element's history to confirm that no other branches except main were created:

  6. cleartool lshistory cmdsyn.c
    02-Sep.13:21 gail create version "cmdsyn.c@@/main/0"
    02-Sep.13:21 gail create branch "cmdsyn.c@@/main"
    02-Sep.13:21 gail create file element "cmdsyn.c@@"