clearcase 常用命令

工作中完成一个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


2.进入view(setview)

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>

b. check out 当前的目录 
kco -c “DR-2-019-948" .
c.clearcase进行makeelemnt,
c mkelem -c ”DR-2-019-948"  rcrsublog.c
注意可以将所有要新建的element一起创建
d.创建完element后将当前文件夹check in
kci -c “DR-2-019-948" .
e.将创建的新的element文件一一check in
kci -c ”DR-2-019-948" rcrsublog.c

6. Add directory element to VOB

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
----------------------------

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值