1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
5 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6 <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
8 <title>ClearSCM: Clearcase: Triggers: Evil Twin</title>
10 <link rel="stylesheet" type="text/css" media="screen" href="/css/Article.css">
11 <link rel="stylesheet" type="text/css" media="screen" href="/css/Code.css">
12 <link rel="stylesheet" type="text/css" media="print" href="/css/Print.css">
13 <link rel="SHORTCUT ICON" href="http://clearscm.com/favicon.ico" type="image/png">
16 <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
18 <script type="text/javascript">
19 _uacct = "UA-89317-1";
25 include "clearscm.php";
36 <?php start_box ("cs5");?>
37 <h2>Evil Twin Trigger</h2>
39 <p>This trigger prevents the creation of <i>Evil Twins</i>. An
40 evil twin is where a user attempt to create a new Clearcase
41 element with the same name as an element that was previously
42 created, perhaps on another branch of the parent
46 <h3>What are Evil Twins?</h3>
48 <p>Simply put, an evil twin is a condition that can be caused in
49 Clearcase when a user attempts to add an element to source control
50 that has a name that is the same as an element on another
51 branch. If it is allowed to be created it will be difficult if not
52 impossible to merge in the future. You don't want evil twins to be
53 created to start with.</p>
55 <p>Let's look a little bit deeper into how this can happen. Let's
56 assume that a user adds the element named "foo" to the directory
57 bin. Sometime later that element name is removed with
58 rmname. Finally assume that it is decided that foo is again
59 needed. When it is recreated the second time you will be creating
60 an evil twin because Clearcase will get confused between foo in
61 say version 3 of the parent directory and this new foo destined
62 for say version 7 of the parent directory.</p>
64 <p>Here's a few steps to create the evil twin scenario:</p>
66 <div class="code"><pre>
67 $ # First check out the current directory and create foo
71 $ # Now check it all in
73 $ # Now check out the parent directory and rmname foo
79 <p>At this point we have a directory with foo in it and then the
80 next version of the directory has foo rmnamed
81 (i.e. uncataloged). Now let's attempt to create an evil twin:</p>
83 <div class="code"><pre>
84 $ # Let's create foo's evil twin
86 $ echo "Evil Twin" > foo
90 <p>At this point we should see the following dialog box preventing
91 the creation of the evil twin:</p>
93 <p><i>Insert dialog box here</i></p>
95 <p>This is telling us that we are about to create an evil
96 twin. Note that it also tells us where it found the first twin in
97 the view extended syntax (the part starting with @@). There is
98 another dummy in the bin directory in "andys_branch" version
101 <h3>Merging the Original Elements Back</h3>
103 <p>The preferred way to resolve this problem is to merge the
104 original elements back from the proper directory version of the
105 parent directory into the current branch. To do this you must
106 first locate the branch where the evil twin existed. From the
107 above example that would be
108 \main\Andrew_Integration\adefaria_Andrew\3. Locate that version of
109 the parent directory (e.g. the adm\bin directory of andy vob in
110 the above example) in the Clearcase Version Tree Browser. To be
111 clear, locate the parent directory for the element dummy in the
112 Clearcase Explorer, right click on it and select Version Tree then
113 look in the version tree for the
114 \main\Andrew_Integration\adefaria_Andrew\3 version.</p>
116 <p><b>Note:</b> A good way to find this directory version in
117 directory elements that have large or complicated verion trees is
118 to use the Locate toolbar button (the button with the "flashlight"
119 icon). You can search for versions by version name, branch,
122 <p>Next right click on that version (the version of the parent
123 directory that has the original elements) and select Merge
124 to. Your mouse cursor will change to a little "target" icon. Next
125 select the version of the directory that your view selects (this
126 can be found by locating the little "eye" icon).</p>
128 <p>Just before you select OK to start the merge make sure you
129 toggle on the Merge the element graphically toggle. This will
130 start cleardiffmrg and prompt you to select each merge.</p>
132 <p>This will bring up cleardiffmrg and allow you to confirm each
133 merge of the diredtory. During the merge choose the entries from
134 the parent directory for the elements that you wish to "recover"
137 <p>Another way to resolve this condition is to hardlink to the
138 previous version of this element but this is not always what you
139 want to do. For one it can be confusing. In any event if you need
140 help because you've hit and evil twin be sure to contact the Help
141 Desk and we'll help you out.</p>
143 <?php display_code ("cc/triggers/EvilTwin.pl");?>
145 <?php copyright ();?>
149 <script language="JavaScript" src="/JavaScript/Menus.js" type="text/javascript"></script>