| 1293 |
dpurdie |
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
|
|
|
2 |
<HTML
|
|
|
3 |
><HEAD
|
|
|
4 |
><TITLE
|
|
|
5 |
>Creating a new Topic</TITLE
|
|
|
6 |
><META
|
|
|
7 |
NAME="GENERATOR"
|
|
|
8 |
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
|
|
9 |
REL="HOME"
|
|
|
10 |
TITLE="The Codestriker Guide"
|
|
|
11 |
HREF="book1.html"><LINK
|
|
|
12 |
REL="UP"
|
|
|
13 |
TITLE="User's Guide"
|
|
|
14 |
HREF="c333.html"><LINK
|
|
|
15 |
REL="PREVIOUS"
|
|
|
16 |
TITLE="Creating a new Project"
|
|
|
17 |
HREF="x370.html"><LINK
|
|
|
18 |
REL="NEXT"
|
|
|
19 |
TITLE="Reviewing Topics"
|
|
|
20 |
HREF="x504.html"></HEAD
|
|
|
21 |
><BODY
|
|
|
22 |
CLASS="SECT1"
|
|
|
23 |
BGCOLOR="#FFFFFF"
|
|
|
24 |
TEXT="#000000"
|
|
|
25 |
LINK="#0000FF"
|
|
|
26 |
VLINK="#840084"
|
|
|
27 |
ALINK="#0000FF"
|
|
|
28 |
><DIV
|
|
|
29 |
CLASS="NAVHEADER"
|
|
|
30 |
><TABLE
|
|
|
31 |
SUMMARY="Header navigation table"
|
|
|
32 |
WIDTH="100%"
|
|
|
33 |
BORDER="0"
|
|
|
34 |
CELLPADDING="0"
|
|
|
35 |
CELLSPACING="0"
|
|
|
36 |
><TR
|
|
|
37 |
><TH
|
|
|
38 |
COLSPAN="3"
|
|
|
39 |
ALIGN="center"
|
|
|
40 |
>The Codestriker Guide: Version 1.9.3</TH
|
|
|
41 |
></TR
|
|
|
42 |
><TR
|
|
|
43 |
><TD
|
|
|
44 |
WIDTH="10%"
|
|
|
45 |
ALIGN="left"
|
|
|
46 |
VALIGN="bottom"
|
|
|
47 |
><A
|
|
|
48 |
HREF="x370.html"
|
|
|
49 |
ACCESSKEY="P"
|
|
|
50 |
>Prev</A
|
|
|
51 |
></TD
|
|
|
52 |
><TD
|
|
|
53 |
WIDTH="80%"
|
|
|
54 |
ALIGN="center"
|
|
|
55 |
VALIGN="bottom"
|
|
|
56 |
>Chapter 3. User's Guide</TD
|
|
|
57 |
><TD
|
|
|
58 |
WIDTH="10%"
|
|
|
59 |
ALIGN="right"
|
|
|
60 |
VALIGN="bottom"
|
|
|
61 |
><A
|
|
|
62 |
HREF="x504.html"
|
|
|
63 |
ACCESSKEY="N"
|
|
|
64 |
>Next</A
|
|
|
65 |
></TD
|
|
|
66 |
></TR
|
|
|
67 |
></TABLE
|
|
|
68 |
><HR
|
|
|
69 |
ALIGN="LEFT"
|
|
|
70 |
WIDTH="100%"></DIV
|
|
|
71 |
><DIV
|
|
|
72 |
CLASS="SECT1"
|
|
|
73 |
><H1
|
|
|
74 |
CLASS="SECT1"
|
|
|
75 |
><A
|
|
|
76 |
NAME="CREATE-TOPIC"
|
|
|
77 |
>3.4. Creating a new Topic</A
|
|
|
78 |
></H1
|
|
|
79 |
><P
|
|
|
80 |
> The "Create topic" screen can be accessed from a number of
|
|
|
81 |
other screens, and requires the submission of a number of
|
|
|
82 |
details in order to create a topic. A screenshot can be seen
|
|
|
83 |
in <A
|
|
|
84 |
HREF="x394.html#FIGURE-CREATE-TOPIC"
|
|
|
85 |
>Figure 3-4</A
|
|
|
86 |
>. It is also possible
|
|
|
87 |
to create a new topic which obsoletes a number of other topics
|
|
|
88 |
via the "Obsolete Topics" button on the topic list screen (see
|
|
|
89 |
<A
|
|
|
90 |
HREF="x339.html"
|
|
|
91 |
>Section 3.2</A
|
|
|
92 |
>). This is normally done when a
|
|
|
93 |
review has many comments, and a new review (which obsoletes
|
|
|
94 |
the old review) needs to be created which has addressed these
|
|
|
95 |
comments. It is also possible to generate new topics from the
|
|
|
96 |
command line. Check out the
|
|
|
97 |
<TT
|
|
|
98 |
CLASS="FILENAME"
|
|
|
99 |
>SubmitCodeReview.pl</TT
|
|
|
100 |
> script in the
|
|
|
101 |
<TT
|
|
|
102 |
CLASS="FILENAME"
|
|
|
103 |
>bin</TT
|
|
|
104 |
> directory in the Codestriker
|
|
|
105 |
distribution.
|
|
|
106 |
<DIV
|
|
|
107 |
CLASS="FIGURE"
|
|
|
108 |
><A
|
|
|
109 |
NAME="FIGURE-CREATE-TOPIC"
|
|
|
110 |
></A
|
|
|
111 |
><P
|
|
|
112 |
><B
|
|
|
113 |
>Figure 3-4. Create Topic Screenshot</B
|
|
|
114 |
></P
|
|
|
115 |
><DIV
|
|
|
116 |
CLASS="MEDIAOBJECT"
|
|
|
117 |
><P
|
|
|
118 |
><IMG
|
|
|
119 |
SRC="createtopic.png"></P
|
|
|
120 |
></DIV
|
|
|
121 |
></DIV
|
|
|
122 |
>
|
|
|
123 |
</P
|
|
|
124 |
><P
|
|
|
125 |
> The topic title is a mandatory field which contains a one-line
|
|
|
126 |
summary of the topic. This title is used when the topic is
|
|
|
127 |
displayed in the "Topic list" screen (see <A
|
|
|
128 |
HREF="x339.html"
|
|
|
129 |
>Section 3.2</A
|
|
|
130 |
>). The topic description contains a more
|
|
|
131 |
detailed description of the review itself, and should be enough
|
|
|
132 |
for a reviewer to understand the purpose of the review. If
|
|
|
133 |
Codestriker is linked to a bug tracking system, further down in
|
|
|
134 |
the form, the "Bug IDs" field gives the opportunity to enter
|
|
|
135 |
in multiple bug ids (either space or comma separated), which
|
|
|
136 |
will also give the reviewer an opportunity to see what bugs
|
|
|
137 |
this review fixes.
|
|
|
138 |
</P
|
|
|
139 |
><P
|
|
|
140 |
> The "Project" dropdown list should be selected onto the
|
|
|
141 |
project this review belongs to. The last three fields contain
|
|
|
142 |
comma-separated email addresses. The "Your email address"
|
|
|
143 |
field contains the email address which will receive review
|
|
|
144 |
comments. This is typically, the author's email address. The
|
|
|
145 |
"Reviewers" field contains the list of reviewer email address
|
|
|
146 |
which will be notified once the review is created. The "Cc"
|
|
|
147 |
field is typically used for notifying a group email list that
|
|
|
148 |
a new review has been created. These field values are stored
|
|
|
149 |
into your browser's cookie, so that the next time a review is
|
|
|
150 |
created, these fields will be pre-filled, as they don't
|
|
|
151 |
typically change much between different reviews.
|
|
|
152 |
</P
|
|
|
153 |
><P
|
|
|
154 |
> The most complex part of this form are the values required for
|
|
|
155 |
the "Topic text upload", "Start tag", "End tag", "Module" and
|
|
|
156 |
"Repository" fields. These fields dictate what the actual
|
|
|
157 |
review text is. The first step is to select what source
|
|
|
158 |
control management system the review was made against, and
|
|
|
159 |
updating the "Repository" field accordingly. The following
|
|
|
160 |
sub-sections detail the different review inputs that can be
|
|
|
161 |
handled. Once all the details have been entered, and the
|
|
|
162 |
"Submit" button is pressed, a confirmation screen will come up
|
|
|
163 |
indicating that the review has been created. An email, with
|
|
|
164 |
a URL to view the topic will be sent to the author, reviewers
|
|
|
165 |
and any email addresses entered in the "Cc" field.
|
|
|
166 |
</P
|
|
|
167 |
><DIV
|
|
|
168 |
CLASS="SECT2"
|
|
|
169 |
><H2
|
|
|
170 |
CLASS="SECT2"
|
|
|
171 |
><A
|
|
|
172 |
NAME="AEN412"
|
|
|
173 |
>3.4.1. Creating CVS Diff Topics</A
|
|
|
174 |
></H2
|
|
|
175 |
><P
|
|
|
176 |
> For CVS projects, a common situation is you have a checkout
|
|
|
177 |
of your project's module, and you have fixed a bug which
|
|
|
178 |
needs to be reviewed. To get this reviewed in Codestriker,
|
|
|
179 |
you need to generate the review text, by going to the
|
|
|
180 |
top-level directory of your checkout, and issuing a command
|
|
|
181 |
like:
|
|
|
182 |
<PRE
|
|
|
183 |
CLASS="PROGRAMLISTING"
|
|
|
184 |
>% cvs diff -uN > /tmp/review.txt
|
|
|
185 |
</PRE
|
|
|
186 |
>
|
|
|
187 |
This command creates a diff file, which consists of the code
|
|
|
188 |
changes you have made since you checked out the project from
|
|
|
189 |
CVS. The <CODE
|
|
|
190 |
CLASS="OPTION"
|
|
|
191 |
>-u</CODE
|
|
|
192 |
> option indicates to create a
|
|
|
193 |
"unidiff" formatted file, which is what Codestriker can
|
|
|
194 |
parse. The <CODE
|
|
|
195 |
CLASS="OPTION"
|
|
|
196 |
>-N</CODE
|
|
|
197 |
> option means to show added
|
|
|
198 |
and removed files. Depending on your development process,
|
|
|
199 |
you may want to issue different cvs diff commands with
|
|
|
200 |
different flags, or even using "cvs rdiff" instead.
|
|
|
201 |
Codestriker can accept any input, as long as
|
|
|
202 |
<CODE
|
|
|
203 |
CLASS="OPTION"
|
|
|
204 |
>-u</CODE
|
|
|
205 |
> is specified, to ensure the diff is in
|
|
|
206 |
unidiff format. Note for reviews which include C/C++ code,
|
|
|
207 |
you can also include the
|
|
|
208 |
<CODE
|
|
|
209 |
CLASS="OPTION"
|
|
|
210 |
>--show-function-line</CODE
|
|
|
211 |
> and/or
|
|
|
212 |
<CODE
|
|
|
213 |
CLASS="OPTION"
|
|
|
214 |
>--show-c-function</CODE
|
|
|
215 |
> options, which will
|
|
|
216 |
indicate for each diff delta in the display, what function
|
|
|
217 |
is being modified.
|
|
|
218 |
</P
|
|
|
219 |
><P
|
|
|
220 |
> This filename can either be entered directly into the "Topic
|
|
|
221 |
text upload" field, or selected from a file dialog which is
|
|
|
222 |
created when the "Browse" button is pressed. The "Start
|
|
|
223 |
tag", "End tag" and "Module" fields can be left blank. Once
|
|
|
224 |
all the other fields have been entered, clicking the
|
|
|
225 |
"Submit" button will create the review, and show a
|
|
|
226 |
confirmation screen.
|
|
|
227 |
</P
|
|
|
228 |
><P
|
|
|
229 |
> In some development processes, CVS tags are used to mark
|
|
|
230 |
units of work that have been applied to the repository.
|
|
|
231 |
Rather than generating the review text via a CVS command, as
|
|
|
232 |
specified in the previously, the review text can be
|
|
|
233 |
specified by entering in the "Start tag", "End tag" and
|
|
|
234 |
"Module" name into their respective fields. Codestriker
|
|
|
235 |
will then fetch the review text from the nominated
|
|
|
236 |
repository automatically, by executing the appropriate CVS
|
|
|
237 |
command itself.
|
|
|
238 |
</P
|
|
|
239 |
><P
|
|
|
240 |
> Alternatively, Codestriker can also accept CVS diffs of
|
|
|
241 |
already committed code from commands such as:
|
|
|
242 |
<PRE
|
|
|
243 |
CLASS="PROGRAMLISTING"
|
|
|
244 |
>% cvs rdiff -uN -r START_TAG -r END_TAG MODULE
|
|
|
245 |
</PRE
|
|
|
246 |
>
|
|
|
247 |
Where START_TAG, END_TAG and MODULE are substituted with
|
|
|
248 |
appropriate values. Note this is no different to what
|
|
|
249 |
Codestriker does when values are entered into the "Start
|
|
|
250 |
tag", "End Tag" and "Module" fields when creating a topic.
|
|
|
251 |
</P
|
|
|
252 |
><P
|
|
|
253 |
> If you want to review code in its full form as it exists in
|
|
|
254 |
the repository for a specific tag value, you only need to
|
|
|
255 |
specify this tag value in either the START_TAG
|
|
|
256 |
<SPAN
|
|
|
257 |
CLASS="emphasis"
|
|
|
258 |
><I
|
|
|
259 |
CLASS="EMPHASIS"
|
|
|
260 |
>or</I
|
|
|
261 |
></SPAN
|
|
|
262 |
> END_TAG field, and an appropriate
|
|
|
263 |
value in the MODULE field. Codestriker will fetch all of
|
|
|
264 |
the source files for this module and tag into the topic, and
|
|
|
265 |
treat all of the files as "new" (ie, no diffs). This is no
|
|
|
266 |
different to executing the following command to generate a
|
|
|
267 |
diff:
|
|
|
268 |
<PRE
|
|
|
269 |
CLASS="PROGRAMLISTING"
|
|
|
270 |
>% cvs rdiff -uN -r 1.0 -r TAG MODULE
|
|
|
271 |
</PRE
|
|
|
272 |
>
|
|
|
273 |
</P
|
|
|
274 |
></DIV
|
|
|
275 |
><DIV
|
|
|
276 |
CLASS="SECT2"
|
|
|
277 |
><H2
|
|
|
278 |
CLASS="SECT2"
|
|
|
279 |
><A
|
|
|
280 |
NAME="AEN428"
|
|
|
281 |
>3.4.2. Creating CVS Diff Topics Automatically</A
|
|
|
282 |
></H2
|
|
|
283 |
><P
|
|
|
284 |
> Depending on your development process, it may be more
|
|
|
285 |
convenient for CVS to automatically create a Codestriker
|
|
|
286 |
topic <SPAN
|
|
|
287 |
CLASS="emphasis"
|
|
|
288 |
><I
|
|
|
289 |
CLASS="EMPHASIS"
|
|
|
290 |
>automatically</I
|
|
|
291 |
></SPAN
|
|
|
292 |
> whenever a commit
|
|
|
293 |
occurs. The benefit with this approach is developers don't
|
|
|
294 |
need to explicitly create code reviews. A "code reviewer"
|
|
|
295 |
can then monitor all commits to the repository, and has the
|
|
|
296 |
opportunity to send comments to the authors if they spot any
|
|
|
297 |
issues that need addressing.
|
|
|
298 |
</P
|
|
|
299 |
><P
|
|
|
300 |
> The standard <TT
|
|
|
301 |
CLASS="FILENAME"
|
|
|
302 |
>commit_prep.pl</TT
|
|
|
303 |
> and
|
|
|
304 |
<TT
|
|
|
305 |
CLASS="FILENAME"
|
|
|
306 |
>log_accum.pl</TT
|
|
|
307 |
> scripts from CVS have been
|
|
|
308 |
modified so that the email which is sent after each commit
|
|
|
309 |
which contains the diff of the commit, also includes the URL
|
|
|
310 |
of the associated Codestriker topic that was created.
|
|
|
311 |
<SPAN
|
|
|
312 |
CLASS="emphasis"
|
|
|
313 |
><I
|
|
|
314 |
CLASS="EMPHASIS"
|
|
|
315 |
>Unfortunately, these scripts can only be executed
|
|
|
316 |
on the UNIX platform.</I
|
|
|
317 |
></SPAN
|
|
|
318 |
>
|
|
|
319 |
</P
|
|
|
320 |
><P
|
|
|
321 |
> The <TT
|
|
|
322 |
CLASS="FILENAME"
|
|
|
323 |
>commit_prep.pl</TT
|
|
|
324 |
> and
|
|
|
325 |
<TT
|
|
|
326 |
CLASS="FILENAME"
|
|
|
327 |
>log_accum.pl</TT
|
|
|
328 |
> files are located in the
|
|
|
329 |
Codestriker <TT
|
|
|
330 |
CLASS="FILENAME"
|
|
|
331 |
>bin</TT
|
|
|
332 |
> directory, and need to
|
|
|
333 |
be copied into your <TT
|
|
|
334 |
CLASS="FILENAME"
|
|
|
335 |
>CVSROOT</TT
|
|
|
336 |
> directory,
|
|
|
337 |
with a line like the following in your
|
|
|
338 |
<TT
|
|
|
339 |
CLASS="FILENAME"
|
|
|
340 |
>commitinfo</TT
|
|
|
341 |
> file (read the comment in
|
|
|
342 |
this file to set this correctly for your site):
|
|
|
343 |
<PRE
|
|
|
344 |
CLASS="PROGRAMLISTING"
|
|
|
345 |
>DEFAULT $CVSROOT/CVSROOT/commit_prep.pl -r
|
|
|
346 |
</PRE
|
|
|
347 |
>
|
|
|
348 |
and a line like the following in your
|
|
|
349 |
<TT
|
|
|
350 |
CLASS="FILENAME"
|
|
|
351 |
>loginfo</TT
|
|
|
352 |
> file (read the comment in this
|
|
|
353 |
file to set this correctly for your site):
|
|
|
354 |
<PRE
|
|
|
355 |
CLASS="PROGRAMLISTING"
|
|
|
356 |
>DEFAULT $CVSROOT/CVSROOT/log_accum.pl %s
|
|
|
357 |
</PRE
|
|
|
358 |
>
|
|
|
359 |
The <TT
|
|
|
360 |
CLASS="FILENAME"
|
|
|
361 |
>log_accum.pl</TT
|
|
|
362 |
> file needs to have
|
|
|
363 |
some configuration variables set at the start of the script
|
|
|
364 |
to reflect your site. You will also need to make sure you
|
|
|
365 |
create a <TT
|
|
|
366 |
CLASS="FILENAME"
|
|
|
367 |
>$CVSROOT/CVSROOT/commitlogs</TT
|
|
|
368 |
>
|
|
|
369 |
directory with the appropriate user-writable permissions,
|
|
|
370 |
as commit information is written here as a result of these
|
|
|
371 |
scripts running.
|
|
|
372 |
</P
|
|
|
373 |
><P
|
|
|
374 |
> Note the first line of the log message will be used as the
|
|
|
375 |
topic title. The entire log message is used as the topic
|
|
|
376 |
description. Any strings of the form "Bug nnn" in the log
|
|
|
377 |
message will be taken as a reference to a bug id, and will
|
|
|
378 |
be used in the topic's bugid field.
|
|
|
379 |
</P
|
|
|
380 |
></DIV
|
|
|
381 |
><DIV
|
|
|
382 |
CLASS="SECT2"
|
|
|
383 |
><H2
|
|
|
384 |
CLASS="SECT2"
|
|
|
385 |
><A
|
|
|
386 |
NAME="AEN448"
|
|
|
387 |
>3.4.3. Creating Diff Topics</A
|
|
|
388 |
></H2
|
|
|
389 |
><P
|
|
|
390 |
> In some deployments, there may not even be a source control
|
|
|
391 |
management system, and it might be the case that only diffs
|
|
|
392 |
are reviewed. An example command to generate the review
|
|
|
393 |
text could be something like:
|
|
|
394 |
<PRE
|
|
|
395 |
CLASS="PROGRAMLISTING"
|
|
|
396 |
>% diff -urN ../old-version/ . > /tmp/review.txt
|
|
|
397 |
</PRE
|
|
|
398 |
>
|
|
|
399 |
Like the CVS command shown above, the <CODE
|
|
|
400 |
CLASS="OPTION"
|
|
|
401 |
>-u</CODE
|
|
|
402 |
>
|
|
|
403 |
and <CODE
|
|
|
404 |
CLASS="OPTION"
|
|
|
405 |
>-N</CODE
|
|
|
406 |
> options are specified to output a
|
|
|
407 |
unidiff file, which contains new and old files. The
|
|
|
408 |
<CODE
|
|
|
409 |
CLASS="OPTION"
|
|
|
410 |
>-r</CODE
|
|
|
411 |
> option indicates to recursively check
|
|
|
412 |
the source and target directories specified (in this case
|
|
|
413 |
<TT
|
|
|
414 |
CLASS="FILENAME"
|
|
|
415 |
>../old-version</TT
|
|
|
416 |
> and
|
|
|
417 |
<TT
|
|
|
418 |
CLASS="FILENAME"
|
|
|
419 |
>.</TT
|
|
|
420 |
> to find differences. There are
|
|
|
421 |
likely to be other options that will be specified, run
|
|
|
422 |
<B
|
|
|
423 |
CLASS="COMMAND"
|
|
|
424 |
>man diff</B
|
|
|
425 |
> for more options. Note for
|
|
|
426 |
reviews which include C/C++ code, you can also include the
|
|
|
427 |
<CODE
|
|
|
428 |
CLASS="OPTION"
|
|
|
429 |
>--show-function-line</CODE
|
|
|
430 |
> and/or
|
|
|
431 |
<CODE
|
|
|
432 |
CLASS="OPTION"
|
|
|
433 |
>--show-c-function</CODE
|
|
|
434 |
> options, which will
|
|
|
435 |
indicate for each diff delta in the display, what function
|
|
|
436 |
is being modified.
|
|
|
437 |
</P
|
|
|
438 |
><P
|
|
|
439 |
> The "Start tag", "End tag" and "Module" fields have no
|
|
|
440 |
relevance in this situation.
|
|
|
441 |
</P
|
|
|
442 |
></DIV
|
|
|
443 |
><DIV
|
|
|
444 |
CLASS="SECT2"
|
|
|
445 |
><H2
|
|
|
446 |
CLASS="SECT2"
|
|
|
447 |
><A
|
|
|
448 |
NAME="AEN461"
|
|
|
449 |
>3.4.4. Creating Plain Text Topics</A
|
|
|
450 |
></H2
|
|
|
451 |
><P
|
|
|
452 |
> It is also possible to use Codestriker to simply review text
|
|
|
453 |
that is not in the form as a diff. In this situation,
|
|
|
454 |
Codestriker will simply treat the text as a single new file.
|
|
|
455 |
Reviewers will still be able to view the text and make
|
|
|
456 |
comments on a per-line basis as before. Simply put the
|
|
|
457 |
filename to be reviewed in the "Topic text upload" field.
|
|
|
458 |
The "Start tag", "End tag" and "Module" fields have no
|
|
|
459 |
relevance in this situation.
|
|
|
460 |
</P
|
|
|
461 |
></DIV
|
|
|
462 |
><DIV
|
|
|
463 |
CLASS="SECT2"
|
|
|
464 |
><H2
|
|
|
465 |
CLASS="SECT2"
|
|
|
466 |
><A
|
|
|
467 |
NAME="AEN464"
|
|
|
468 |
>3.4.5. Creating Subversion Diff Topics</A
|
|
|
469 |
></H2
|
|
|
470 |
><P
|
|
|
471 |
> Similar to CVS, Subversion diffs are created by again, going
|
|
|
472 |
to the top of your project directory, and issuing the
|
|
|
473 |
following command:
|
|
|
474 |
<PRE
|
|
|
475 |
CLASS="PROGRAMLISTING"
|
|
|
476 |
>% svn diff -N > /tmp/review.txt
|
|
|
477 |
</PRE
|
|
|
478 |
>
|
|
|
479 |
This file should then be selected for the "Topic text
|
|
|
480 |
upload" field. The "Start tag", "End tag" and "Module"
|
|
|
481 |
fields have no relevance in this situation. Because of an
|
|
|
482 |
issue in Subversion, running the <B
|
|
|
483 |
CLASS="COMMAND"
|
|
|
484 |
>svn diff</B
|
|
|
485 |
>
|
|
|
486 |
command <SPAN
|
|
|
487 |
CLASS="emphasis"
|
|
|
488 |
><I
|
|
|
489 |
CLASS="EMPHASIS"
|
|
|
490 |
>outside</I
|
|
|
491 |
></SPAN
|
|
|
492 |
> of the repository root
|
|
|
493 |
will not allow Codestriker to download and review the full
|
|
|
494 |
file (although the patch segments can still be reviewed). If
|
|
|
495 |
you commit your code first, then let Codestriker make the
|
|
|
496 |
diff, as explained in the next section, then you can avoid
|
|
|
497 |
this limitation. If you really don't want to commit your
|
|
|
498 |
code, you will need to modify the diff file to include the
|
|
|
499 |
paths on the Index: +++, and --- lines generated by
|
|
|
500 |
<B
|
|
|
501 |
CLASS="COMMAND"
|
|
|
502 |
>svn diff</B
|
|
|
503 |
>.
|
|
|
504 |
</P
|
|
|
505 |
><P
|
|
|
506 |
> In some development processes, branches are used as the
|
|
|
507 |
logical unit of work that should be reviewed. Rather than
|
|
|
508 |
generating the review text via the <B
|
|
|
509 |
CLASS="COMMAND"
|
|
|
510 |
>svn
|
|
|
511 |
diff</B
|
|
|
512 |
> command, as specified in the previous
|
|
|
513 |
section, the review text can be created by setting the
|
|
|
514 |
appropriate values into the "Start tag", "End tag" and
|
|
|
515 |
"Module" fields. Codestriker will then fetch the review
|
|
|
516 |
text from the nominated repository automatically, by
|
|
|
517 |
executing the following command:
|
|
|
518 |
<PRE
|
|
|
519 |
CLASS="PROGRAMLISTING"
|
|
|
520 |
>% svn diff --non-interactive -r START_TAG:END_TAG --old repository_url MODULE
|
|
|
521 |
</PRE
|
|
|
522 |
>
|
|
|
523 |
In Subversion the tags can be a repository revision number
|
|
|
524 |
or HEAD, The HEAD shortcut indicates the latest revision
|
|
|
525 |
number in the repository. If you would like to review a
|
|
|
526 |
specific single check in, for example, check in 544, then
|
|
|
527 |
you would use 543 for START_TAG and 544 for END_TAG.
|
|
|
528 |
</P
|
|
|
529 |
><P
|
|
|
530 |
> If you would like to review a branch before merging then
|
|
|
531 |
enter the start tag as the version number of the branch
|
|
|
532 |
creation. The end tag should be HEAD, and the module path
|
|
|
533 |
should be the path into the branch directory relative to the
|
|
|
534 |
repository location. All topics created by Codestriker have
|
|
|
535 |
a builtin workaround for the Subversion diff problem.
|
|
|
536 |
</P
|
|
|
537 |
></DIV
|
|
|
538 |
><DIV
|
|
|
539 |
CLASS="SECT2"
|
|
|
540 |
><H2
|
|
|
541 |
CLASS="SECT2"
|
|
|
542 |
><A
|
|
|
543 |
NAME="AEN475"
|
|
|
544 |
>3.4.6. Creating Perforce Diff Topics</A
|
|
|
545 |
></H2
|
|
|
546 |
><P
|
|
|
547 |
> Similar to CVS, Perforce diffs are created by going to the
|
|
|
548 |
top of your checkout (or client view in Perforce
|
|
|
549 |
terminology) and issuing a command like:
|
|
|
550 |
<PRE
|
|
|
551 |
CLASS="PROGRAMLISTING"
|
|
|
552 |
>% p4 diff -du > /tmp/review.txt
|
|
|
553 |
</PRE
|
|
|
554 |
>
|
|
|
555 |
This file should then be selected for the "Topic text
|
|
|
556 |
upload" field. The "Start tag", "End tag" and "Module"
|
|
|
557 |
fields have no relevance in this situation.
|
|
|
558 |
</P
|
|
|
559 |
><P
|
|
|
560 |
> Alternatively, for code which has already been committed
|
|
|
561 |
into the repository (or depot in Perforce terminology), a
|
|
|
562 |
command like the following can be used to generate the topic
|
|
|
563 |
text:
|
|
|
564 |
<PRE
|
|
|
565 |
CLASS="PROGRAMLISTING"
|
|
|
566 |
>% p4 describe -du 132 > /tmp/review.txt
|
|
|
567 |
</PRE
|
|
|
568 |
>
|
|
|
569 |
Here 132 is the change-number. This should be substituted
|
|
|
570 |
with the change-number that you want to review.
|
|
|
571 |
</P
|
|
|
572 |
></DIV
|
|
|
573 |
><DIV
|
|
|
574 |
CLASS="SECT2"
|
|
|
575 |
><H2
|
|
|
576 |
CLASS="SECT2"
|
|
|
577 |
><A
|
|
|
578 |
NAME="AEN481"
|
|
|
579 |
>3.4.7. Creating ClearCase Diff Topics</A
|
|
|
580 |
></H2
|
|
|
581 |
><P
|
|
|
582 |
> In its very basic form, a ClearCase diff file can be created
|
|
|
583 |
for a single file using the following command:
|
|
|
584 |
<PRE
|
|
|
585 |
CLASS="PROGRAMLISTING"
|
|
|
586 |
>% cleartool diff -serial_format -predecessor filename > /tmp/review.txt
|
|
|
587 |
</PRE
|
|
|
588 |
>
|
|
|
589 |
This file can then be uploaded into Codestriker for
|
|
|
590 |
reviewing. Of course, it is far more useful to be able to
|
|
|
591 |
review a group of files at once. In ClearCase, to determine
|
|
|
592 |
which files are a part of a view, you can use the following
|
|
|
593 |
command from the top level of your checkout:
|
|
|
594 |
<PRE
|
|
|
595 |
CLASS="PROGRAMLISTING"
|
|
|
596 |
>% cleartool lsco -cview -short -recurse
|
|
|
597 |
</PRE
|
|
|
598 |
>
|
|
|
599 |
</P
|
|
|
600 |
><P
|
|
|
601 |
> Combine the two commands together to generate a single
|
|
|
602 |
file with all modified files can be achieved doing something
|
|
|
603 |
like:
|
|
|
604 |
<PRE
|
|
|
605 |
CLASS="PROGRAMLISTING"
|
|
|
606 |
>% cleartool lsco -cview -short -recurse | \
|
|
|
607 |
xargs -n1 cleartool diff -serial_format -predecessor > /tmp/review.txt
|
|
|
608 |
</PRE
|
|
|
609 |
>
|
|
|
610 |
Note if you are on a Win32 platform, and you have cygwin
|
|
|
611 |
installed, you may need to add an intermediate sed command
|
|
|
612 |
so that cleartool doesn't complain:
|
|
|
613 |
<PRE
|
|
|
614 |
CLASS="PROGRAMLISTING"
|
|
|
615 |
>% cleartool lsco -cview -short -recurse | sed 's/\\/\//g' | \
|
|
|
616 |
xargs -n1 cleartool diff -serial_format -predecessor > /tmp/review.txt
|
|
|
617 |
</PRE
|
|
|
618 |
>
|
|
|
619 |
</P
|
|
|
620 |
><P
|
|
|
621 |
> In all of the above commands, if a ClearCase repository has
|
|
|
622 |
been specified in the Codestriker configuration, it is
|
|
|
623 |
important that the above commands are run from the
|
|
|
624 |
<SPAN
|
|
|
625 |
CLASS="emphasis"
|
|
|
626 |
><I
|
|
|
627 |
CLASS="EMPHASIS"
|
|
|
628 |
>top-level directory</I
|
|
|
629 |
></SPAN
|
|
|
630 |
> of the view, so that
|
|
|
631 |
the full vob pathname information is available within the
|
|
|
632 |
diff files. This allows Codestriker to retrieve the full
|
|
|
633 |
contents of files from the vob, so that a reviewer can see
|
|
|
634 |
the changes applied to an entire file, rather than a small
|
|
|
635 |
segment.
|
|
|
636 |
</P
|
|
|
637 |
><P
|
|
|
638 |
> Note the above commands can be modified if there is
|
|
|
639 |
only interest in a specific sub-directory in your view, for
|
|
|
640 |
example, the
|
|
|
641 |
<B
|
|
|
642 |
CLASS="COMMAND"
|
|
|
643 |
>cleartool lsco</B
|
|
|
644 |
> can be amended with the
|
|
|
645 |
sub-directory of interest as follows:
|
|
|
646 |
<PRE
|
|
|
647 |
CLASS="PROGRAMLISTING"
|
|
|
648 |
>% cleartool lsco -cview -short -recurse pathname/to/interested/dir | \
|
|
|
649 |
xargs -n1 cleartool diff -serial_format -predecessor > /tmp/review.txt
|
|
|
650 |
</PRE
|
|
|
651 |
>
|
|
|
652 |
</P
|
|
|
653 |
></DIV
|
|
|
654 |
><DIV
|
|
|
655 |
CLASS="SECT2"
|
|
|
656 |
><H2
|
|
|
657 |
CLASS="SECT2"
|
|
|
658 |
><A
|
|
|
659 |
NAME="AEN494"
|
|
|
660 |
>3.4.8. Creating Visual SourceSafe Topics</A
|
|
|
661 |
></H2
|
|
|
662 |
><P
|
|
|
663 |
> Similar to CVS, SourceSafe diffs are creating by going to
|
|
|
664 |
the top of your project, and issuing a command like the
|
|
|
665 |
following in a cmd.exe window:
|
|
|
666 |
<PRE
|
|
|
667 |
CLASS="PROGRAMLISTING"
|
|
|
668 |
>C:\Project\> ssdiff.pl > topic.txt
|
|
|
669 |
</PRE
|
|
|
670 |
>
|
|
|
671 |
The <TT
|
|
|
672 |
CLASS="FILENAME"
|
|
|
673 |
>topic.txt</TT
|
|
|
674 |
> file will contain the
|
|
|
675 |
source-code differences made with the current code set
|
|
|
676 |
compared with the SourceSafe repository. This file can then
|
|
|
677 |
be selected for the "Topic text upload" field in the create
|
|
|
678 |
topic screen. The "Start tag", "End tag" and "Module"
|
|
|
679 |
fields have no relevance in this situation.
|
|
|
680 |
</P
|
|
|
681 |
><P
|
|
|
682 |
> The <TT
|
|
|
683 |
CLASS="FILENAME"
|
|
|
684 |
>ssdiff.pl</TT
|
|
|
685 |
> Perl script is a custom
|
|
|
686 |
script that is contained in the Codestriker
|
|
|
687 |
<TT
|
|
|
688 |
CLASS="FILENAME"
|
|
|
689 |
>bin</TT
|
|
|
690 |
> directory, which needs to be
|
|
|
691 |
installed on client machines that need to run the above
|
|
|
692 |
command. The configuration section at the start of the
|
|
|
693 |
script should be updated appropriately before it is used.
|
|
|
694 |
</P
|
|
|
695 |
><P
|
|
|
696 |
> Alternatively, for code which has already been committed to
|
|
|
697 |
SourceSafe, it is possible to explicitly specify on the
|
|
|
698 |
create topic screen, values for the "Start tag", "End tag"
|
|
|
699 |
and "Module" fields, which will enable Codestriker to fetch
|
|
|
700 |
the topic text directly from SourceSafe. In this instance,
|
|
|
701 |
any SourceSafe label names can be used in the tag fields.
|
|
|
702 |
If only one tag field is specified, the complete contents of
|
|
|
703 |
files corresponding to the specified label will be
|
|
|
704 |
retrieved. The "Module" field contains a path into the
|
|
|
705 |
SourceSafe repository which indicates the files of interest.
|
|
|
706 |
An example value could be <TT
|
|
|
707 |
CLASS="FILENAME"
|
|
|
708 |
>$/Project/Gui</TT
|
|
|
709 |
>,
|
|
|
710 |
which would work on all files located within that path.
|
|
|
711 |
</P
|
|
|
712 |
></DIV
|
|
|
713 |
></DIV
|
|
|
714 |
><DIV
|
|
|
715 |
CLASS="NAVFOOTER"
|
|
|
716 |
><HR
|
|
|
717 |
ALIGN="LEFT"
|
|
|
718 |
WIDTH="100%"><TABLE
|
|
|
719 |
SUMMARY="Footer navigation table"
|
|
|
720 |
WIDTH="100%"
|
|
|
721 |
BORDER="0"
|
|
|
722 |
CELLPADDING="0"
|
|
|
723 |
CELLSPACING="0"
|
|
|
724 |
><TR
|
|
|
725 |
><TD
|
|
|
726 |
WIDTH="33%"
|
|
|
727 |
ALIGN="left"
|
|
|
728 |
VALIGN="top"
|
|
|
729 |
><A
|
|
|
730 |
HREF="x370.html"
|
|
|
731 |
ACCESSKEY="P"
|
|
|
732 |
>Prev</A
|
|
|
733 |
></TD
|
|
|
734 |
><TD
|
|
|
735 |
WIDTH="34%"
|
|
|
736 |
ALIGN="center"
|
|
|
737 |
VALIGN="top"
|
|
|
738 |
><A
|
|
|
739 |
HREF="book1.html"
|
|
|
740 |
ACCESSKEY="H"
|
|
|
741 |
>Home</A
|
|
|
742 |
></TD
|
|
|
743 |
><TD
|
|
|
744 |
WIDTH="33%"
|
|
|
745 |
ALIGN="right"
|
|
|
746 |
VALIGN="top"
|
|
|
747 |
><A
|
|
|
748 |
HREF="x504.html"
|
|
|
749 |
ACCESSKEY="N"
|
|
|
750 |
>Next</A
|
|
|
751 |
></TD
|
|
|
752 |
></TR
|
|
|
753 |
><TR
|
|
|
754 |
><TD
|
|
|
755 |
WIDTH="33%"
|
|
|
756 |
ALIGN="left"
|
|
|
757 |
VALIGN="top"
|
|
|
758 |
>Creating a new Project</TD
|
|
|
759 |
><TD
|
|
|
760 |
WIDTH="34%"
|
|
|
761 |
ALIGN="center"
|
|
|
762 |
VALIGN="top"
|
|
|
763 |
><A
|
|
|
764 |
HREF="c333.html"
|
|
|
765 |
ACCESSKEY="U"
|
|
|
766 |
>Up</A
|
|
|
767 |
></TD
|
|
|
768 |
><TD
|
|
|
769 |
WIDTH="33%"
|
|
|
770 |
ALIGN="right"
|
|
|
771 |
VALIGN="top"
|
|
|
772 |
>Reviewing Topics</TD
|
|
|
773 |
></TR
|
|
|
774 |
></TABLE
|
|
|
775 |
></DIV
|
|
|
776 |
></BODY
|
|
|
777 |
></HTML
|
|
|
778 |
>
|