Initial add of defaria.com
[clearscm.git] / defaria.com / blogs / Status / archives / week_2005_12_11.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
4 <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6    <meta name="generator" content="Movable Type 5.2.3" />
7
8    <link rel="stylesheet" href="http://defaria.com/blogs/Status/styles-site.css" type="text/css" />
9    <link rel="alternate" type="application/atom+xml" title="Atom" href="http://defaria.com/blogs/Status/atom.xml" />
10    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://defaria.com/blogs/Status/index.xml"$>" />
11
12    <title>Status for Andrew DeFaria: December 11, 2005 - December 17, 2005 Archives</title>
13
14    <link rel="start" href="http://defaria.com/blogs/Status/" title="Home" />
15    <link rel="prev" href="http://defaria.com/blogs/Status/archives/week_2005_12_04.html" title="December  4, 2005 - December 10, 2005" />
16    <link rel="next" href="http://defaria.com/blogs/Status/archives/week_2005_12_18.html" title="December 18, 2005 - December 24, 2005" />
17 </head>
18 <body class="layout-one-column">
19    <div id="container">
20       <div id="container-inner" class="pkg">
21
22          <div id="banner">
23             <div id="banner-inner" class="pkg">
24                <h1 id="banner-header"><a href="http://defaria.com/blogs/Status/" accesskey="1">Status for Andrew DeFaria</a></h1>
25                <h2 id="banner-description">Searchable status reports and work log</h2>
26             </div>
27          </div>
28
29          <div id="pagebody">
30             <div id="pagebody-inner" class="pkg">
31                <div id="alpha">
32                   <div id="alpha-inner" class="pkg">
33                      
34                      <p class="content-nav">
35                         <a href="http://defaria.com/blogs/Status/archives/week_2005_12_04.html">&laquo; December  4, 2005 - December 10, 2005</a> |
36                         <a href="http://defaria.com/blogs/Status/">Main</a>
37                         | <a href="http://defaria.com/blogs/Status/archives/week_2005_12_18.html">December 18, 2005 - December 24, 2005 &raquo;</a>
38                      </p>
39                      
40                      
41                      
42
43                      <h2 class="date-header">December 15, 2005</h2>
44                      <a id="a000498"></a>
45                      <div class="entry" id="entry-498">
46                         <h3 class="entry-header">CQ Web/Rebase/GNATS Access</h3>
47                         <div class="entry-content">
48                            <div class="entry-body">
49                               <ul>
50   <li>Set up GNATS access for a user</li>
51
52   <li>Helped Vinh with issues regarding old CQ Web and a bug that it has</li>
53
54   <li>Assisted a few users with resolving Evil Twin problems</li>
55
56   <li>More fully documented how to resolve Evil Twin problems by merging the parent directory</li>
57
58   <lI>Investigated implementing the other half of BinMerge where we use rebase instead of find merge</li>
59 </ul>
60                               
61                               <h2>Rebase</h2>
62
63 <p>Initially I thought that rebase did not work like findmerge in that it didn't have options for performing essentially the merge operate and just telling you what needed to merge. Turns out it does have that option - cleartool merge -preview -long. The long option causes rebase to list out what needs to be merged.</p>
64
65 <p>But rebase is more than just a findmerge. Additionally one needs to do the following:</p>
66
67   <ul>
68     <li>Create and set an activity for the view</li>
69
70     <li>Check out items first</li>
71
72     <li>Perform the merge with -abort noting which merges failed and how they failed</li>
73
74     <li>Execute the rebase command to mark the view as being rebased</li>
75
76     <li>Execute the rebase -complete to mark the rebase completed (IFF all elements are rebased)</li>
77   </ul>
78
79 <p>Of course this is just a preliminary list - we still need to figure out if rebasing, merging actually, of directories need to be done first (probably), how to execute rebase to mark "rebase in progress" without actually attempting to merge anything, etc.</p>
80                               
81                               <p class="entry-footer">
82                                  <span class="post-footers">Posted by  at  5:06 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000498.html">Permalink</a>
83                                  
84                                  
85                               </p>
86                            </div>
87                         </div>
88                      </div>
89                      
90                      
91
92                      <h2 class="date-header">December 14, 2005</h2>
93                      <a id="a000497"></a>
94                      <div class="entry" id="entry-497">
95                         <h3 class="entry-header">get_views_for_stream/create_dev_snapview.pl</h3>
96                         <div class="entry-content">
97                            <div class="entry-body">
98                               <ul>
99   <li>Found and fixed bug in get_views_for_stream</li>
100
101   <li>Fixed bug in create_dev_snapview.pl::ParseBaselines
102 </ul>
103                               
104                               <h2>get_views_for_stream</h2>
105
106 <p>Hi Naga. I'm writing you this because I believe there's a bug, possibly with Clearcase, but that seems to manifest itself in code I believe you wrote. I came across this implementing enhancements to create_dev_snapview.pl for Andrew Feltham. In essence Andrew wants to be able to have multiple views in a stream. I've implemented a -reuse_stream parm to allow this. If -reuse_stream is used then the code will skip recreating the stream and effectively just make another view in that same stream. If -reuse_stream is not specified then the stream is removed - along with any views that that stream has.</p>
107
108 <p>It appears as if the code was coded to attempt to handle the case where a stream has multiple views however it fails due to a possible but with lsstream. When calling create_stream the code checks to see if the stream exists and if it does it attempts to recreate the stream by determining the view(s) in the stream, deleting them, deleting the stream and creating the stream anew.</p>
109
110 <p>To determine the view(s) in the stream get_views_for_stream is called. Here's the original function:</p>
111
112 <div class="code"><pre>
113 sub get_views_for_stream {
114     my $sel_pvob = $_[0];
115     my $sel_stream = $_[1];
116
117     my @views = split(/\n/, `cleartool lsstream -fmt \"\%\[views\]p\\n\" stream:$sel_stream\@\\$sel_pvob`);
118     return @views;
119 }
120 </pre></div>
121
122 <p>Essentially it does an lsstream asking for only the views, separated by newlines. The problem is that lsstream (with that format) does not return the views separated by newlines:</p>
123
124 <div class="code"><pre>
125 P:\>cleartool lsstream -fmt "%[views]p\n" stream:Build_rmnaNT_adefaria_LTSJCA-ADEFARIA_sv_ldx_2.3@\rmna_projects
126 adefaria_test adefaria_test2 adefaria_test3
127
128 P:\>
129 </pre></div>
130
131 <p>As you can see adefaria_test, adefaria_test2 and adefaria_test3 all appear on the same line. The code then splits the line on \n and effectively always returns a 1 entry array with possibly multiple view names in the first entry separated by spaces. Needless to say this will fail later on when remove_view is called and it generates a "cleartool rmview -force &lt;view names&gt;".</p>
132
133 <p>Here's my proposed fix:</p>
134
135 <div class="code"><pre>
136 sub get_views_for_stream {
137     my $sel_pvob = $_[0];
138     my $sel_stream = $_[1];
139     # Modified Wed Dec 14 11:25:09 PST 2005 Andrew@DeFaria.com
140     #
141     # Note: The format -fmt "%[views]p\n" below does not work! What is
142     # expected to be returned is:
143     #
144     # view1
145     # view2
146     # view3
147     #
148     # However what is actually returned is:
149     #
150     # view1 view2 view3
151     #
152     # Therefore the old spilt of /\n/ always returned a single entry
153     # array with possibly multiple view names in the first
154     # entry. Changed to use / / for split and not append a \n.
155     my @views = split(/ /, `cleartool lsstream -fmt \"\%\[views\]p\" stream:$sel_stream\@\\$sel_pvob`);
156     return @views;
157 }
158 </pre></div>
159
160 <p>Is this acceptable to you?</p>
161                               
162                               <p class="entry-footer">
163                                  <span class="post-footers">Posted by  at  1:48 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000497.html">Permalink</a>
164                                  
165                                  
166                               </p>
167                            </div>
168                         </div>
169                      </div>
170                      
171                      
172
173                      <h2 class="date-header">December 13, 2005</h2>
174                      <a id="a000496"></a>
175                      <div class="entry" id="entry-496">
176                         <h3 class="entry-header">cvsims</h3>
177                         <div class="entry-content">
178                            <div class="entry-body">
179                               <ul>
180   <li>Updated triggers on ccase-rmna-3 as some new vobs seem to lack them</li>
181
182   <li>Updated cvsims to parse input and handle both -pre and -post operations</li>
183
184   <li>Had problems with CVS admin files</li>
185 </ul>
186                               
187                               <h2>CVSIMS</h2>
188
189 <p>I have managed to learn how to update IMS and I'm at the point where I need to understand the input requirements better. I will describe what I envision happening and follow it with a few questions.</p>
190
191 <p>In general the desire seems to be to update IMS when a commit happens in certain CVS repositories<a href="#q1"><sup>1</sup></a>. As such commit comment information will need to conform to a certain format. Commit comments need to have the following in them identifying the IMS Issue ID they are associated with:</p>
192
193 <div class="code"><pre>
194 IMSIssueID: &lt;issue ID&gt;
195 </pre></div>
196
197 <h3>Pre-commit checks (i.e. verifymsg)</h3>
198
199 <p>The string "IMSIssueID: " must appear at the start of a line followed by the issue ID<a href="#q2"><sup>2</sup></a>. The IMSIssueID must exist in IMS<a href="#q3"><sup>3</sup></a>. If the issue ID is not in IMS then the commit will not be allowed. Commits lacking any IMSIssueID will be rejected<a href="#q4"><sup>4</sup></a>.</p>
200
201 <h3>Post-commit operations (i.e. loginfo)</h3>
202
203 <p>If the pre-commit checks pass the IMS issue will have it's change set field updated with the file names of the committed files. As change set is an append only field the following separator will be added first followed by the list of files<a href="#q5"><sup>5</sup></a>:</p>
204
205 <div class="code"><pre>
206 # &lt;USERNAME&gt; &lt;DATE_TIME&gt; committed:
207 file1
208 file2
209 ...
210 </pre></div>
211
212 <p>Again, as change set is an append only field there may be multiple updates like so:</p>
213
214 <div class="code"><pre>
215 # &lt;USERNAME&gt; &lt;DATE_TIME&gt; committed:
216 file1
217 file2
218 ...
219 # &lt;USERNAME&gt; &lt;DATE_TIME&gt; committed:
220 file10
221 </pre></div>
222
223 <h3>Questions</h3>
224 <ol>
225   <li><a name="q1"></a>Which repositories does this apply?</li>
226
227   <li><a name="q2"></a>Are multiple IMSIssueIDs allowed? If so then are multiple lines such
228 as the above acceptable or should the script search for perhaps a comma separated list of issue IDs?</li>
229
230   <li><a name="q3"></a>Should the script also check to insure that the issue ID is not in say a closed state?</li>
231
232   <li><a name="q4"></a>Is it true that all commits in a repository/module/directory <b>must</b> be associated to an IMS Issue?</li>
233
234   <li><a name="q5"></a>In addition to the file name should we include the revision checked in? Also should any other information be logged (e.g. repository)?</li>
235 </ol>
236
237 <h2>CVS Admin Files</h2>
238
239 <p>I got myself into a pickle. Here's what I was doing...</p>
240
241 <p>I wanted to modify <span>rcsinfo, verifymsg and loginfo
242 in our CVS test area (:pserver:adefaria@cvsps-irva-1:/projects/ccase_irva/cvsmaster)
243 so I checked out CVSROOT and modified those files. The idea was to have rcsinfo point to a template file so the user knows where to put the IMSIssueID, change verifymsg to call cvsism
244 (the connector) to verify that it can find the IssueID and that the IssueID exists in IMS and change loginfo to call cvsism to update the change set after the commit. Unfortunately I modified the files in such a way that I cannot check in at all. I need help in fixing this because I believe what needs to be done needs to be done on the server and I don't have a login there let alone root access.</p>
245
246 <p>The problem is that I don't understand what the cwd is when CVS fires off these triggers. For example, in rcsinfo I have the following line:</p>
247
248 <div class="code"><pre>
249 ALL /tmp/IMSIssueTemplate
250 </pre></div>
251
252 <p>"ALL" means for all files and /tmp/IMSIssueTemplate is the template file. But where is /tmp? Is it supposed to be on the server? Where's a good place to put these template files?</p>
253
254 <p>In verifymsg I have:</p>
255
256 <div class="code"><pre>
257 DEFAULT SCM/cvsbin/cvsims -pre
258 </pre></div>
259
260 <p>I want to run cvsims (which is in my home directory under SCM/cvsbin) but this also fails.
261 As a result of this I cannot use cvs commit to change verifymsg, hence I'm stuck!</p>
262
263 <p>In <span>loginfo</span> I have:</p>
264
265 <div class="code"><pre>
266 DEFAULT SCM/cvsbin/cvsims -post %{s}
267 </pre></div>
268
269 <p>Again SCM/cvsbin/cvsims is not a valid path.</p>
270
271 <p>How can I get this fixed? Where should I put these files?</p>
272                               
273                               <p class="entry-footer">
274                                  <span class="post-footers">Posted by  at 12:35 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000496.html">Permalink</a>
275                                  
276                                  
277                               </p>
278                            </div>
279                         </div>
280                      </div>
281                      
282                      
283
284                      <h2 class="date-header">December 12, 2005</h2>
285                      <a id="a000495"></a>
286                      <div class="entry" id="entry-495">
287                         <h3 class="entry-header">mktriggers/CVS</h3>
288                         <div class="entry-content">
289                            <div class="entry-body">
290                               <ul>
291   <li>Worked with Shivdutt on clearfsimport</li>
292
293   <li>Updated mktriggers to use fully qualified paths to Perl</li>
294
295   <li>Added stuff to CVS area - have not committed yet - wanna establish a commitinfo script to get an idea of what input is available to commit</li>
296 </ul>
297                               
298                               <p class="entry-footer">
299                                  <span class="post-footers">Posted by  at  6:14 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000495.html">Permalink</a>
300                                  
301                                  
302                               </p>
303                            </div>
304                         </div>
305                      </div>
306                      
307                   </div>
308                </div>
309             </div>
310          </div>
311       </div>
312    </div>
313 </body>
314 </html>