前段时间做了一个feature,是从solaris port 到 linux 6.3 上,当文件check in的时候遇到Evil Twin found问题
PROJ_RC_CHANGE_HISTORY.table是一个新文件需要check in,首先是check out 目录(省略),然后建立element
cleartool: Error: Unable to create element "PROJ_RC_CHANGE_HISTORY.table".
从参考资料上得到以下信息:
If you attempt to create an Evil Twin, you will receive an error similar to the following:
“Caution: Evil Twin found: Please perform a ct ln (unix) or merge (win/ccrc) from the original element to the new location.” And it will list for you where the original element was found.
To resolve an Evil Twin, you must either merge the directory from CCRC or link the original element to your view directory.
For CCRC merge option:
Since the element does not exist on the current branch you must merge the directory.
1. First, make sure to run a full update on your view(this should be the view you want to merge to), then from the directory where you want to merge to, right click -> click ClearCase Merge Search.
2. Choose destination view (your current view) and click Next.
3. Select the directory element you want to merge and click Next.
4. Select the branch where the original element is from and click Finish.
You will then have a list of files to be merged. From the drop down on that window you can choose whether to merge all automatically or merge manually. If you merge manually it will ask you to choose which version to select. If possible, choose to merge automatically. If you don’t want to merge a certain file(s) within this directory, you can unco the file to not merge it. (your merge is not committed until checkin) Then merge the remaining elements.
Once all is merged, checkin directory and all elements that were merged.
所以步骤如下:
1.进入要check in的文件所在目录,check out目录
kco -c "DR-0-210-643" .
2.创建链接,生成0字节的只读文件。
c ln -c "DR-0-210-643" .@@/main/rl_telus11.7/6/PROJ_RC_CHANGE_HISTORY.table PROJ_RC_CHANGE_HISTORY.table
3.check in 目录
kci -c "DR-0-210-643" .
4. check out 文件
kco -c "DR-0-210-643" PROJ_RC_CHANGE_HISTORY.table
cp PROJ_RC_CHANGE_HISTORY.table.ck PROJ_RC_CHANGE_HISTORY.table
5.check in文件
kci -c "DR-0-210-643" PROJ_RC_CHANGE_HISTORY.table
经过以上几步文件check in成功。
不过有可能目录也需要重新建的话,你会遇到下面的错误:
在/usr1/arbor/sdg_bp_src/denver_src/project目录下建立prebip目录:
1.cd /usr1/arbor/sdg_bp_src/denver_src/project
2.kco -c "DR-0-210-643" .
3.c mkdir -c "DR-0-210-643" prebip
project@@/main/rl_telus11.7/1/prebip.
Caution: Evil Twin found : /usr1/arbor/sdg_bp_src/denver_src/project@@/main/rl_telus11.7/1
Please perform a ct ln (unix) or merge (win/ccrc) from the original element to the new location.
cleartool: Warning: Trigger "PRE-MKELEM" has refused to let mkelem proceed.
cleartool: Error: Unable to create directory element "prebip".
如果要新建一个目录时:(用kaddref命令即可,不用check out目录,脚本会自动check out目录和check in目录,不过我们这里为了找到要从哪个branch过来所以check out目录病试图建立一个目录))
4.kaddref -c "DR-0-210-643" -f rl_telus11.7 prebip
Find pre-existing invisible links...
cleartool: Error: Element "." is already checked out to view "helen.telus.bp12.5_fx2.5_mnt_dcmvrh12".
checkout error...aborted.(所以目录就不用check out了)
取消check out
5.c unco .
Removed branch "/usr1/arbor/sdg_bp_src/denver_src/project@@/main/rl_telus_fx2.5_00_ebf".
Checkout cancelled for ".".
6.kaddref -c "DR-0-210-643" -f rl_telus11.7 prebip
Find pre-existing invisible links...
Perl OSname is: linux
Created branch "rl_telus_fx2.5_00_ebf" from "." version "/main/18".
Checked out "." from version "/main/rl_telus_fx2.5_00_ebf/0".
Link created: "./prebip".
Checked in "." version "/main/rl_telus_fx2.5_00_ebf/1".
其中kaddref命令:
Usage: kaddref [-k/eep] [-c/omment comment-string ] [-nci] [-ncp]
[-t/odir target-dir ] [-f/rom branch]
pname ...
这样就可以用以上check in element的文件的步骤来check in文件了。如果这个目录还有目录就还是按照以上的方法。
第一次写自己的博客,把自己平时工作中的问题写出来,不会排版,呵呵,以后学学