tags:

views:

716

answers:

2

Hi;

Could anyone explain what is a Evil Twin and Subtractive merge in Clearcase?

+4  A: 

Evil Twin

An Evil Twin is an element that you have removed (using rmname) and want to re-add, but it's 'evil twin' exists in previous versions of the directory.

You have to remember that each element had a unique ID, so you are attempting to add an element with the same name - but with a different UID. This is not allowed.

The best way to deal with an Evil Twin is to relink the newest version you can find of the existing element to the new version of the directory. You can then make a new version of the element and replace the data within it.

Subtractive Merge

A subtractive merge is the opposite of a selective merge.

A selective merge (the default, bog standard merge) adds the changes from another element version into your checked-out version.

A subtractive merge attempts to remove the changes made in a different version from the version you have checked out - because it's a bad version, you've made mistakes in it etc.

Spedge
Thanks so much. Can you please clarify whether Subtractive merge method still works for "directories" in Clearcase or it is only for "files".I have been trying to execute merge command for merging the directories and all its files. But I am getting error. When I tried with file it was smooth./vobs/IdcVob$ cleartool merge -to NwaSite -delete -version /main/idc_sandbox_devcleartool: Error: Element "NwaSite" version "/main/idc_sandbox_dev" not found.
Rational Admin
Good summary, +1
VonC
+1  A: 

IBM has a nice article on substractive merge.

A subtractive merge can be performed to exclude or bypass bad versions on a branch without actually removing the bad versions.
Cleartool merge using the -delete option will allow a user to merge from the last known good version to a new version on the same branch which excludes the work done in the versions identified as bad versions.
This merge must be performed from the command line, it does not create a merge arrow, the arrow can be created manually.

This will work for file as well as directory

But you need to realize that merge is about a file or a directory, not about a directory "and everything in it".
To merge recursively, take a look at findmerge.

You can want to merge only directories (since they are always merged first, to determine the actual list of files to merge!), as in this IBM article

% cleartool setview major_vu% cleartool findmerge /vobs/vob1 /vobs/libvob2 –type d \ 
–fversion /main/LATEST –merge

you may also do the merge from the LATEST version of a branch or from a tag:

findmerge . –fversion /main/rel2_bugfix/LATEST –print
findmerge . –ftag rel2_bugfix_view –whynot –print

Note: the -print is always a good idea before replacing it by '-merge -gmerge', in order to get a preview of what will be merged. But if directories are involved, it will only print that 'directory X' needs to be merged, not the exact list of files.


For evil twins, check out the IBM article. Case sensitive issues can be a real pain to deal with and create some evil twins without you realizing it...

VonC
OK I got it. Would you be able to demonstrate with an example. I am struck with the syntax problems.
Rational Admin
Von. Could U pls let me know how to delete this post. It seems it is against our company securit policy
Rational Admin
@Rational Admin: please let me know what part is against any policy rule: this post is important and serve as illustration for substractive merge. It **ought to stay online**. I have edited it to remove any vob name. If you had accepted it, please re-accept it again. If you have deleted other answer, please undeleted them.
VonC
@Rational Admin: please consider all those questions are already available through public dump (http://blog.stackoverflow.com/category/cc-wiki-dump/). The right process here is: repair the damage done by restoring your questions (make a few upvotes as well while you're at), and *then* request through mail the removal of your account: the questions will remain for other to see, but any link between you and your company will by cut (since your account won't be there).
VonC