ClearCase当中add to source control出错解决

来源:互联网 发布:java时间序列分析预测 编辑:程序博客网 时间:2024/06/03 17:30

http://blog.csdn.net/Ariel7732/article/details/3299296

 

Delete the element accidently, fail to add

Error Message:

Error adding "Path/file.txt" to source control.

Error: duplicate name "file.txt" found in the directory version Path@@/main/<stream_name>/<number>

 

Trigger "PRE_MKELEM" has refuse to let mkelem proceed.

Problem:

Developer create file A in folder B. folder B is under source control. and then add file A into source control and continue work on it.

He delete (it should be rename according to CC) file A accidently. Now when you try to add the file A back to CC, PRE_MKELEM trigger prevent he to do it.


解决的方法是:

(1) 是先找到还有该file的activity,然后点击:Version Tree (在被删文件的上层包处)看那个右键后merge to, 并在点击圈和线的连接点处就可以出现这个叫:Merge Configration 的界面. 选中yes的那个merge the element graphically.

(2)然后再选中合适的版本,就可以把丢失的文件放进SourceControl中了。。

(3)

1. From the target view (where the file element or dir element was removed), click on the version tree of parent directory.

2. On the version tree find out which version have file element or dir element (where it was added)

3. right Click on the version from step2 and select merge to menu

4. Select the target view version (where eye was pointing)

5. Make sure you click the check box (In merge confirmation dialog box, select "Yes" and mark "merge the element graphically". CC ask "do you want to create the branch?, select "Yes")

6. Pls select the version that you want. If you can not make choice, pls click the selection with underscore. Then all selection will be enabled. While doing the merge, make sure, you get back those elements in the result windows

7. Save the merge and make sure the elements exist

8. Once confirmed, go ahead and check-in the parent dir

 

具体我的解决办法是:

1,这个文件加不进来的原因是:我理解是由于其他分支已经有同名文件了,不能添加同名文件在同级的分支中,所以,必须从别的分支上merge过来这个文件,然后再修改。

2,右键点击别人的分支,选择merge to, 然后鼠标变成把心,把鼠标指向自己分支上想添加文件的节点,然后点击,就开始merge了,然后多勾选一个merge the element graphically。

3,弹出的框,都选OK就好了,保存merge结果,然后check in一下,就把文件添加进来了。merge过来的文件,大小都是0字节,不知为啥,所以我都会用自己的文件再覆盖一下merge过来的文件。

4,后来我发现,如果merge完以后,又删除了一些merge过来的文件,可是以后又想重新添加回来这些被删除的文件的话,这种操作也值得注意,在clearcase当中也不是很容易就能办到的,具体办法是这样的:

4.1,clearcase当中显示眼睛看到的一般是branch上最后一个节点,这时要先把眼睛移到曾经做过merge操作的那个节点的上一个节点。办法是右键选checkout 在那个早先的节点上,这时眼睛就移到merge操作发生以前了。

4.2,这时在这个节点上重新执行merge操作,把以前merge的文件再merge一遍,这时,那些被删的文件就回来了。

4.3,merge完了,checkin的时候,会提示必须把现在的改动和这个节点以下的节点的改动合并才行,意思是说这是一个较早的节点,checkin的话,必须和以后建立的节点合并,选择ok就好了,这时,眼睛节点就移到最后了,然后丢掉的文件也都回来啦,好事呀~~~。

原创粉丝点击