工作中完成一个feature就要check in文件,所以在此总结一下常用的ClearCase命令:
1.查找view
c lsview
for example:查找含有yy的view
[/usr1/arbor/denver_src/billing/cap] (84)yyang@dsesun10#c lsview | grep yy
yy.se_arbor.singtel.rl11.0_02_ebf_mnt /CCSEVIEW/yy.se_arbor.singtel.rl11.0_02_ebf_mnt
yy.airtel_fx1.3_00_ebf_mnt /CCSEVIEW/yy.airtel_fx1.3_00_ebf_mnt
* yy.se_arbor.neuf_telecom_ceg_ent.bp12.0.2_fx2.0.2_ebf_mnt /CCSEVIEW/yy.se_arbor.neuf_telecom_ceg_ent.bp12.0.2_fx2.0.2_ebf_mnt
yy.se_arbor.ntt_america.bp12.2_fx2.2_ebf_mnt_dsesun10 /CCDEVVIEW/yy.se_arbor.ntt_america.bp12.2_fx2.2_ebf_mnt_dsesun10
yy.se_arbor.telus_fx.rl_1.2_04_ebf_mnt /CCSEVIEW/yy.se_arbor.telus_fx.rl_1.2_04_ebf_mnt
yy.se_arbor.telstra_bt_fx.rl1.2_04_ebf_mnt /CCSEVIEW/yy.se_arbor.telstra_bt_fx.rl1.2_04_ebf_mnt
* yy.se_arbor.neuf_telecom.bp11.7.3.fx1.2.3_sol2.10.dsesun10 /CCSEVIEW/yy.se_arbor.neuf_telecom.bp11.7.3.fx1.2.3_sol2.10.dsesun10
* yy.se_arbor.level3.bp11.7.3_solaris2.10_eft_mnt /CCSEVIEW/yy.se_arbor.level3.bp11.7.3_solaris2.10_eft_mnt
yy.se_arbor.level3.bp11.7.3_fx1.2.3_ctq_prod_dsesun10 /CCSEVIEW/yy.se_arbor.level3.bp11.7.3_fx1.2.3_ctq_prod_dsesun10
c setview (but we usually use sv (/usr1/arbor/ccbin/sv))
for example:进入yy.se_arbor.neuf_telecom_ceg_ent.bp12.0.2_fx2.0.2_ebf_mnt
(76)yyang@dsesun10#sv yy.se_arbor.neuf_telecom_ceg_ent.bp12.0.2_fx2.0.2_ebf_mnt
Setting view: yy.se_arbor.neuf_telecom_ceg_ent.bp12.0.2_fx2.0.2_ebf_mnt
There is no view file yy.se_arbor.neuf_telecom_ceg_ent.bp12.0.2_fx2.0.2_ebf_mnt.csh, use default 3p paths.
[/u1/yyang] (89)yyang@dsesun10#pwv
Working directory view: ** NONE **
Set view: yy.se_arbor.neuf_telecom_ceg_ent.bp12.0.2_fx2.0.2_ebf_mnt
pwv 是显示当前view
3.查看version tree for a specific elemnt
[/usr1/arbor/camb_src/billing/bip] (133)yyang@mila52s1#c lsvtree bip_rc_diff.c
bip_rc_diff.c@@/main
bip_rc_diff.c@@/main/0
bip_rc_diff.c@@/main/rl_bharti_ibm_fx1.2_04_ebf
bip_rc_diff.c@@/main/rl_bharti_ibm_fx1.2_04_ebf/3
4. describe an object
[/usr1/arbor/denver_src/billing/cap] (288)yyang@dsesun10#c desc cap_uc_utils.cpp
version "cap_uc_utils.cpp@@/main/rl_fx2.0/rl_neuf_telecom_ceg_ent_fx2.0_02_ebf/27"
created 15-Oct-14.23:38:13 by Yan Yang (yyang.clearusr@dsesun10)
"PR# DR-0-213-799
DR-0-213-799"
Element Protection:
User : UNIX:UID-10194 : r--
Group: arboradm : r--
Other: : r--
element type: text_file
predecessor version: /main/rl_fx2.0/rl_neuf_telecom_ceg_ent_fx2.0_02_ebf/26
Attributes:
PRNUM = "DR-0-213-799"
5.add fiel element to VOB
a.进入你要增加文件的目录 cd <the directory you want to add an element>
1) Cd <directory you want toadd an element>
2) kco –c ‘your comment’ .
3) c mkdir –c ‘your comment’<dir-name>
4) kci .
5) kci <dir-pname>
7.如何删除一个已经check in的文件Removes the name of an element or VOB symbolic link from a directoryversion
c rmname -c comment filename
8.为一个view 设置config spec Set conf-spec of a view from a conf-spec file
C setcs [-tag view-tag ] conf-spec_file
Example:
C setcs zj.conf
9.Edit conf-spec of a view
C edcs
10. Look over conf-spec of a view
C catcs
11.list all configuration record of a derived object,列出所得对象的配置记录
c catcr filename
这个命令对你要看lib or binary 是如何build的和编译选项很有帮助。
Have you ever had a derived object file that you wanted to know what files were used to create it? In other words, did you ever compile a file but wanted to know specifically what versions, elements, and View private files from the VOB and View went into creating the file?
If you used clearmake to compile the file, then you can use this command to reverse engineer a list of all the files and directories that were used to compile the file in question.
cleartool catcr –flat -type fdl DERIVED_OBJECT
For example:
[/usr1/arbor/bin] (292)yyang@dsesun10#c catcr makepwe.exe
Derived object: /usr1/arbor/bin/makepwe.exe@@23-Sep.21:40.2147490698
Target /usr1/arbor/bin/makepwe.exe built by yyang.clearusr
Host "dsesun10" running SunOS 5.10 (sun4u)
Reference Time 23-Sep-14.21:24:50, this audit started 23-Sep-14.21:40:53
View was 10.8.32.131:/CCSEVIEW/yy.se_arbor.neuf_telecom_ceg_ent.bp12.0.2_fx2.0.2_ebf_mnt
Initial working directory was /usr1/arbor/oam_src/security/applications
----------------------------
MVFS objects:
----------------------------
/usr1/arbor/bin/makepwe.exe@@23-Sep.21:40.2147490698
/usr1/arbor/camb_src/lib/libarbor_utils.so@@21-Sep.10:29.2147488416
/usr1/arbor/denver_src/make_sys/makefile.arborversion@@/main/13 <17-Jul-06.15:08:58>
/usr1/arbor/oam_src/security/applications/makepwe.o@@23-Sep.21:40.2147490696
----------------------------
Variables and Options:
----------------------------
ARBORSRC=/usr1/arbor/src
CC_MT=cc -Drdbms -Xa -KPIC -DSOLARIS -DBT_UNIX -DBT_SOLARIS -xarch=v9 -D_REENTRANT
CFLAGS=-g -I/usr1/arbor/src/include
FLAG=
FLG_OBJ=-o
LIBRARIES=-larbor_utils
LIBRARY_DIRS=-L/usr1/arbor/src/lib -L/usr1/arbor/3p/oracle/SOLARIS/lib -L/usr/ccs/lib -L/usr/lib/sparcv9 -L/usr/local/lib -L/usr1/arbor/site_specific/lib
MAKE=clearmake
MAKEPWE_EXE=/usr1/arbor/bin/makepwe.exe
MAKEPWE_OBJ=makepwe.o
----------------------------
Build Script:
----------------------------
@(rm -f arbor_version.c; clearmake -f /usr1/arbor/src/make_sys/makefile.arborversion)
cc -Drdbms -Xa -KPIC -DSOLARIS -DBT_UNIX -DBT_SOLARIS -xarch=v9 -D_REENTRANT -g -I/usr1/arbor/src/include makepwe.o -L/usr1/arbor/src/lib -L/usr1/arbor/3p/oracle/SOLARIS/lib -L/usr/ccs/lib -L/usr/lib/sparcv9 -L/usr/local/lib -L/usr1/arbor/site_specific/lib -larbor_utils -o /usr1/arbor/bin/makepwe.exe
----------------------------