1) element本身带有mkbranch 参数
element -file /vobs/test/... BASE-Main_test_1.0.0 -mkbranch test_nj_main_test.1.0.0
这个参数叫做auto-make-branch,就是说在创建element的时候会创建branch 并且将branch所对应的内容check out
来看IBM 标准文档的例子:
If your config spec has a/main/LATEST rule with a -mkbranch clause,mkelem checks out a subbranch instead of the main branch. For example, suppose your view has this config spec:
element * CHECKEDOUT element * .../gopher_port/LATEST element * V1.0.1 -mkbranch gopher_port element * /main/0 -mkbranch gopher_port
The /main/0 rule in the last line allows you to createelements. In this case, agopher_port branch is created for the newelement, and this branch is checked out instead ofmain:
cleartool mkelem -c "new element for Gopher porting work" base.h Created element "base.h" (type "text_file"). Created branch "gopher_port" from "base.h" version "\main\0". Checked out "base.h" from version "\main\gopher_port\0".
This view always selects the set of versions labeled R1.0. In this scenario, all these versions are on themain branch of their elements. If the R1.0 label type is one-per-element, notone-per-branch, this config spec selects the R1.0 version on a subbranch. (For more information, see themklbtype reference page.)
You can use this configuration to rebuild Release 1.0, verifying that all sourceelements have been labeled properly. You can also use it to browse the old release.
3)mkbranch 和mkbrtype之间的区别:
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.
The mkbranch command creates a new branch in the version trees of one or more elements. The new branch is checked out, unless you use the –nco option.
A branch belongs to an element (a file or directory). A brtype or branch type is a name for some branches, which can be applied to any number of elements.
For example, file.c@@/main/int is a branch of the element file.c. Its brtype is int. And file.c@@/main/int/2 is a version which belongs to that branch.
Similarly, a label belongs to a version of an element. An lbtype or label type is the name for some labels, and can be applied to any number of versions of different elements. A common use is to create labels with the same type for each element in your repository, to stamp a certain release.
cleartool mklbtype -global TEST
makes a label type.
cleartool mklabel TEST file.c
creates a label on the version of element file.c which is currently selected in your view. Now file.c@@TEST is a permanent synonym for that version.
cleartool mklabel -rec TEST .
does the same for the current directory and all its contents, recursively.