Initial commit
[clearscm.git] / web / clearcase / EvilTwin.php
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2    "http://www.w3.org/TR/html4/strict.dtd">
3 <html>
4 <head>
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]">
7
8   <title>ClearSCM: Clearcase: Triggers: Evil Twin</title>
9
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">
14
15   <!-- Google Analytics
16   <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
17   </script>
18   <script type="text/javascript">
19     _uacct = "UA-89317-1";
20     urchinTracker ();
21   </script>
22   Google Analytics -->
23
24   <?php
25   include "../php/clearscm.php";
26   menu_css ();
27   ?>
28 </head>
29
30 <body>
31
32 <?php heading ();?>
33
34 <div id="page">
35   <div id="content">
36     <?php start_box ("cs5");?>
37       <h2>Evil Twin Trigger</h2>
38
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
43       directory.</li></p>
44     <?php end_box ();?>
45
46     <h3>What are Evil Twins?</h3>
47
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>
54
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>
63
64     <p>Here's a few steps to create the evil twin scenario:</p>
65
66     <div class="code"><pre>
67 $ # First check out the current directory and create foo
68 $ ct co -nc .
69 $ echo "bar" > foo
70 $ ct mkelem -nc foo
71 $ # Now check it all in
72 $ ct ci -nc foo .
73 $ # Now check out the parent directory and rmname foo
74 $ ct co -nc .
75 $ ct rmname foo
76 $ ct ci -nc .
77     </pre></div>
78
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>
82
83     <div class="code"><pre>
84 $ # Let's create foo's evil twin
85 $ ct co -nc .
86 $ echo "Evil Twin" > foo
87 $ ct mkelem -nc foo
88     </pre></div>
89
90     <p>At this point we should see the following dialog box preventing
91     the creation of the evil twin:</p>
92
93     <p><i>Insert dialog box here</i></p>
94
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
99     1.</p>
100
101     <h3>Merging the Original Elements Back</h3>
102
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>
115
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,
120     etc).</p>
121
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>
127
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>
131
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"
135     or "reinstate" .</p>
136
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>
142
143     <?php display_code ("cc/triggers/EvilTwin.pl");?>
144
145   <?php copyright ();?>
146   </div>
147 </div>
148
149 <script language="JavaScript" src="/JavaScript/Menus.js" type="text/javascript"></script>
150
151 </body>
152 </html>