Clearcase: How do I merge in a specific file from one view, into another, to avoid the Evil Twin scenario?
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.
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.
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
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).
精彩评论