Clearcase: How do I merge in a specific file from one view, into another, to avoid the Evil Twin scenario?

跟風遠走 提交于 2019-12-30 07:35:22

问题


I have a file that needs to be brought into a different branch. How do I do this from the command line. Everything seems to be geared to merging, where the file already exists in both branches.


回答1:


I no longer have access to a clearcase environment, so this is from memory, but what you want is to link in a version from another branch into the one that you are working with.

Let's assume that you have a file new_file that have been added on the branch new_feature (the latest version is new_file@@/main/new_feature/5) which you want to merge/bring into the branch maintenance.

prompt>cleartool checkout -nc .
checking out some_dir@@/main/maintenance/2
...
prompt>cleartool ln .@@/main/new_feature/LATEST/new_file/main/new_feature/5 .
...
prompt>cleartool ci -c "linked in .@@/main/new_feature/LATEST/new_file/main/new_feature/5"
prompt>

The commands above are probably not 100% correct, but should give you the idea. You want to use cleartool ln to avoid evil twins, because that will bring in a version from the already existing element (i.e. not creating a new twin).




回答2:


You have to merge the parent directory first, so that the file shows up in the directory in the destination branch. At this point the new file will have zero size. You can then merge the file itself. The easiest way to do both of these operations is via the Version Tree view - much less error-prone than doing it via the command line.




回答3:


Much simpler:

  • 1/ rmname the file in the destination directory
ct co -nc .
ct rmname -force file.txt
  • 2/ merge the directory
ct findmerge . -ftag view_tag

with 'view_tag' a view on the source directory



来源:https://stackoverflow.com/questions/4209342/clearcase-how-do-i-merge-in-a-specific-file-from-one-view-into-another-to-avo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!