以下的命令示例中, cmd-context 值得是执行cleartool 之后的环境。(执行cleartool之后,会进入Clearcase的命令行环境)
也可以是用cleartool 直接替代 cmd-context,如
cleartool mkelem –nc –nco cm_add.c cm_fill.c msg.c
Create three file elements, cm_add.c, cm_fill.c, and msg.c, allowing the file-typing mechanism to determine the element types. Do not check out the initial versions.
cmd-context mkelem –nc –nco cm_add.c cm_fill.c msg.c
Created element "cm_add.c" (type "text_file").
Created element "cm_fill.c" (type "text_file").
Created element "msg.c" (type "text_file").
Convert a view-private file named test_cmd.c to an element, and check in the initial version.
cmd-context mkelem –nc –ci test_cmd.c
Created element "test_cmd.c" (type "text_file").
Checked in "test_cmd.c" version "/main/1".
Create two directory elements and check out the initial version of each.
cmd-context mkelem –nc –eltype directory libs include
Created element "libs" (type "directory").
Checked out "libs" from version "/main/0".
Created element "include" (type "directory").
Checked out "include" from version "/main/0".
Create an element type named lib for library files, with the predefined binary_delta_file as its supertype. Then, change to the libs directory, check it out, and create two elements of type lib without checking them out.
cmd-context mkeltype –nc –supertype binary_delta_file lib
Created element type "lib".
cmd-context cd libs
cmd-context co –nc .
Checked out "." from version "/main/1".
cmd-context mkelem –nc –nco –eltype lib libntx.lib libpvt.lib
Created element "libntx.lib" (type "lib").
Created element "libpvt.lib" (type "lib").
Create an activity, but do not set it to be the current activity for the view.
cmd-context mkact –nset
Create activity with automatically generated name? [yes] yes
Created activity "activity990917.133218".
Create an activity. The activity is created in the stream attached to the current view.
cmd-context mkact new_activity
Created activity "new_activity".
Set activity "new_activity" in view "java_int".
Create an activity whose name is generated automatically. You are not prompted for confirmation.
cmd-context mkact -f
Created activity "activity990917.134751".
Set activity "activity990917.134751" in view "java_int".
Create an activity with the headline “Create directories”.
cmd-context mkactivity -headline "Create directories" create_directories
Created activity "create_directories".
Set activity "create_directories" in view "webo_integ".
Check out the currently selected version of element hello.c, with no comment.
cmd-context checkout –nc hello.c
Checked out "hello.c" from version "/main/3".
Perform an unreserved checkout of element hello.h. Provide a comment on the command line.
cmd-context checkout –c "modify local defines"–unreserved hello.h
Checked out "hello.h" from version "/main/2"
Check out hello.c. Then, change your mind and cancel the checkout, removing the view-private copy.
cmd-context checkout –nc hello.c
Checked out "hello.c" from version "/main/1".
cmd-context uncheckout –rm hello.c
Checkout cancelled for "hello.c".
Q. How to create a dynamic UCM view from the command line
A. First you need to know the name of the stream and the PVOB where it is located. You can use the Project Explorer or the following cleartool commands:
cleartool lsvob - Get list of VOBs
cleartool lsproject -invob <pvob-selector> - Get list of Projects in PVOB
cleartool lsstream -in <project-selector> - Get list of Streams attached to a Project
Once you have the stream name, then use the following command line to create the UCM view:
cleartool mkview -tag <view-tag> -stream stream:<stream-name>@<pvob> -stgloc -auto
Where <view-tag> is the name of your view. <stream-name> is the name of the stream. <pvob> is the name of the Project VOB.
Examples:
ct mkview -tag johnl_SITLibDev1 -stream stream:johnl_SITLibDev1@/vobs/testsuitepvob -stgloc -auto
ct mkview -tag johnl_SITLibDev1_int -stream stream:SITLibDev1_integration@/vobs/testsuitepvob -stgloc -auto
Q. How can I get a list of the view private files
A. For Dynamic Views:
cleartool lsprivate -r
For Snapshot Views:
cleartool ls -recurse -view_only
Start a rebase operation.
cmd-context rebase –recommended
Advancing to baseline "BL1.119" of component "webo_modeler"
Updating rebase view's config spec...
Creating integration activity...
Setting integration activity...
Merging files...
No versions require merging in stream "chris_webo_dev".
Build and test are necessary to ensure that the merges were completed
correctly.
When build and test are confirmed, run "cleartool rebase -complete".
Complete a rebase operation.
cmd-context rebase –complete
Rebase in progress on stream "chris_webo_dev".
Started by "ktessier" at 06/06/00 15:36:42.
Merging files...
No versions require merging in stream "chris_webo_dev".
Checking in files...
Clearing integration activity...
Updating stream's configuration...
Cleaning up...
Rebase completed.
Join a project. This example shows the sequence of commands to follow to join a UCM project.
Find the project-selector for the project you want to join. For example:
cmd-context lsproject –invob /vobs/webo_pvob
01-Mar-00.16:31:33 webo_proj1 ktessier "webo_proj1"
05-Jun-00.12:31:33 webo_proj2 ktessier "webo_proj2"
Create your development stream. For example:
cmd-context mkstream -in webo_proj1@/vobs/webo_pvob –baseline BL3@/vobs/webo_pvob chris_webo_dev@/vobs/webo_pvob
cleartool mkstream -in webo_proj1@/vobs/webo_pvob chris_webo_dev@/vobs/webo_pvob
Created stream "chris_webo_dev".
Create a view attached to your development stream:
cmd-context mkview -stream chris_webo_dev@/vobs/webo_pvob /
-tag chris_webo_dev /export/views/chris_webo_dev.vws
Created view.
Host-local path: venus:/export/views/chris_webo_dev.vws
Global path: /net/venus/export/views/chris_webo_dev.vws
It has the following rights:
User : chris : rwx
Group: user : rwx
Other: : r-x
Attached view to stream "chris_webo_dev".
Create a view attached to the project's integration stream:
cmd-context mkview -stream integration@/vobs/webo_pvob /
-tag webo_integ /export/views/webo_integ.vws
## preview the rebase operation
## -bas == -baseline
cleartool rebase -pre -long -view bill_WR30x86bld1_int -bas wr-3.0-kernel_clone
## in the local side
ct startview ${USER}_LinuxUtils2
cd /view/${USER}_LinuxUtils2/vobs/vob2/LinuxUtils/packages/cpm-release
ct rebase -rec -com
ct mkact -f -headline "NCQ: Update for x86 release $RELEASE"
ct co -nc Release.txt cpm-release.spec
vi cpm-release.spec Release.txt
make-rpm --target cpm-wr -r
ct ci -nc Release.txt cpm-release.spec
ct deliver -force
## in the master side
ct startview ${USER}_LinuxUtils2_int
cd /view/${USER}_LinuxUtils2_int/vobs/vob2/LinuxUtils/packages/cpm-release
# Note: wait until the posted delivery from the previous step to show up.
ct deliver -status -stream ${USER}_LinuxUtils2@/vobs/pvob
ct deliver -resume -force -stream ${USER}_LinuxUtils2@/vobs/pvob -to ${USER}_LinuxUtils2_int
ct deliver -com -force -stream ${USER}_LinuxUtils2@/vobs/pvob
ct-spinrpm
recommend baseline
ct chstream -rec WR30x86_bld1_2010-08-18@/vobs/pvob -cview
ct rebase -bas wr-3.0-kernel_debug13
cleartool rebase -complete