author | Claus Gittinger <cg@exept.de> |
Sun, 03 Sep 2000 16:38:52 +0200 | |
changeset 2751 | f2fbe11e166a |
parent 2745 | 8fa3af64f96e |
child 2776 | f02f07bc1ba4 |
permissions | -rw-r--r-- |
2626 | 1 |
" |
2 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
||
2650
447c99ac6f76
oops - inspect & browse menu was broken.
Claus Gittinger <cg@exept.de>
parents:
2626
diff
changeset
|
14 |
"{ Package: 'stx:libtool' }" |
447c99ac6f76
oops - inspect & browse menu was broken.
Claus Gittinger <cg@exept.de>
parents:
2626
diff
changeset
|
15 |
|
2221 | 16 |
ApplicationModel subclass:#VersionDiffBrowser |
2745 | 17 |
instanceVariableNames:'classChangeSet diffTextView boxAVisible boxBVisible boxMVisible' |
2221 | 18 |
classVariableNames:'' |
19 |
poolDictionaries:'' |
|
20 |
category:'Interface-Browsers' |
|
21 |
! |
|
22 |
||
2497 | 23 |
HierarchicalItem subclass:#ClassChangeSet |
2695 | 24 |
instanceVariableNames:'classBeingCompared labelA labelB diffSet onlyInA onlyInB |
2497 | 25 |
changedMethods' |
26 |
classVariableNames:'' |
|
27 |
poolDictionaries:'' |
|
28 |
privateIn:VersionDiffBrowser |
|
29 |
! |
|
30 |
||
2224 | 31 |
VersionDiffBrowser comment:'some comment |
32 |
'! |
|
33 |
||
2626 | 34 |
!VersionDiffBrowser class methodsFor:'documentation'! |
35 |
||
36 |
copyright |
|
37 |
" |
|
38 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
39 |
All Rights Reserved |
|
40 |
||
41 |
This software is furnished under a license and may be used |
|
42 |
only in accordance with the terms of that license and with the |
|
43 |
inclusion of the above copyright notice. This software may not |
|
44 |
be provided or otherwise made available to, or used by, any |
|
45 |
other person. No title to or ownership of the software is |
|
46 |
hereby transferred. |
|
47 |
" |
|
48 |
||
49 |
! |
|
50 |
||
51 |
documentation |
|
52 |
" |
|
53 |
This is not yet finished (work in progress). |
|
54 |
||
55 |
A browser to show differences between class versions, |
|
56 |
allowing easy comparison; will also eventually add capabilities |
|
57 |
to checkIn / load classes into / from the repository. |
|
58 |
||
59 |
[see also:] |
|
60 |
||
61 |
[instance variables:] |
|
62 |
||
63 |
[class variables:] |
|
64 |
" |
|
65 |
||
66 |
||
67 |
! ! |
|
2221 | 68 |
|
69 |
!VersionDiffBrowser class methodsFor:'interface specs'! |
|
70 |
||
71 |
windowSpec |
|
72 |
"This resource specification was automatically generated |
|
73 |
by the UIPainter of ST/X." |
|
74 |
||
75 |
"Do not manually edit this!! If it is corrupted, |
|
76 |
the UIPainter may not be able to read the specification." |
|
77 |
||
78 |
" |
|
79 |
UIPainter new openOnClass:VersionDiffBrowser andSelector:#windowSpec |
|
80 |
VersionDiffBrowser new openInterface:#windowSpec |
|
81 |
VersionDiffBrowser open |
|
82 |
" |
|
83 |
||
84 |
<resource: #canvas> |
|
85 |
||
86 |
^ |
|
87 |
#(#FullSpec |
|
88 |
#name: #windowSpec |
|
89 |
#window: |
|
90 |
#(#WindowSpec |
|
91 |
#label: 'Version DiffBrowser' |
|
92 |
#name: 'Version DiffBrowser' |
|
93 |
#min: #(#Point 10 10) |
|
94 |
#max: #(#Point nil nil) |
|
2695 | 95 |
#bounds: #(#Rectangle 12 22 877 526) |
2221 | 96 |
#menu: #mainMenu |
97 |
) |
|
98 |
#component: |
|
99 |
#(#SpecCollection |
|
100 |
#collection: #( |
|
101 |
#(#VariableVerticalPanelSpec |
|
102 |
#name: 'VariableVerticalPanel1' |
|
103 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
104 |
#component: |
|
105 |
#(#SpecCollection |
|
106 |
#collection: #( |
|
107 |
#(#HorizontalPanelViewSpec |
|
108 |
#name: 'TopHorizontalPanel' |
|
109 |
#horizontalLayout: #fit |
|
110 |
#verticalLayout: #fit |
|
111 |
#horizontalSpace: 3 |
|
112 |
#verticalSpace: 3 |
|
113 |
#component: |
|
114 |
#(#SpecCollection |
|
115 |
#collection: #( |
|
116 |
#(#ViewSpec |
|
117 |
#name: 'BoxA' |
|
118 |
#level: 0 |
|
2585 | 119 |
#visibilityChannel: #boxAVisible |
2221 | 120 |
#component: |
121 |
#(#SpecCollection |
|
122 |
#collection: #( |
|
123 |
#(#LabelSpec |
|
2726 | 124 |
#label: 'Only in A' |
2224 | 125 |
#name: 'OnlyInALabel' |
2221 | 126 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 20 0) |
127 |
#translateLabel: true |
|
128 |
#labelChannel: #onlyInALabelHolder |
|
129 |
) |
|
130 |
#(#SequenceViewSpec |
|
131 |
#name: 'ListA' |
|
132 |
#layout: #(#LayoutFrame 0 0.0 20 0.0 0 1.0 -3 1.0) |
|
133 |
#model: #methodsOnlyInASelection |
|
134 |
#menu: #menuA |
|
135 |
#hasHorizontalScrollBar: true |
|
136 |
#hasVerticalScrollBar: true |
|
137 |
#miniScrollerHorizontal: true |
|
138 |
#valueChangeSelector: #methodsOnlyInASelectionChanged |
|
139 |
#useIndex: true |
|
140 |
#sequenceList: #methodsOnlyInA |
|
141 |
) |
|
142 |
) |
|
143 |
||
144 |
) |
|
2497 | 145 |
#extent: #(#Point 286 252) |
2221 | 146 |
) |
147 |
#(#ViewSpec |
|
148 |
#name: 'BoxM' |
|
2585 | 149 |
#visibilityChannel: #boxMVisible |
2221 | 150 |
#component: |
151 |
#(#SpecCollection |
|
152 |
#collection: #( |
|
153 |
#(#LabelSpec |
|
154 |
#label: 'Changed' |
|
155 |
#name: 'Label2' |
|
156 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 20 0) |
|
157 |
#translateLabel: true |
|
158 |
#labelChannel: #changedLabelHolder |
|
159 |
) |
|
160 |
#(#SequenceViewSpec |
|
161 |
#name: 'ListM' |
|
162 |
#layout: #(#LayoutFrame 0 0.0 20 0.0 0 1.0 -3 1.0) |
|
163 |
#model: #methodsChangedSelection |
|
164 |
#menu: #menuM |
|
165 |
#hasHorizontalScrollBar: true |
|
166 |
#hasVerticalScrollBar: true |
|
167 |
#miniScrollerHorizontal: true |
|
168 |
#valueChangeSelector: #methodsChangedSelectionChanged |
|
169 |
#useIndex: true |
|
170 |
#sequenceList: #methodsChanged |
|
171 |
) |
|
172 |
) |
|
173 |
||
174 |
) |
|
2497 | 175 |
#extent: #(#Point 286 252) |
2221 | 176 |
) |
177 |
#(#ViewSpec |
|
178 |
#name: 'BoxB' |
|
2585 | 179 |
#visibilityChannel: #boxBVisible |
2221 | 180 |
#component: |
181 |
#(#SpecCollection |
|
182 |
#collection: #( |
|
183 |
#(#LabelSpec |
|
2726 | 184 |
#label: 'Only in B' |
2224 | 185 |
#name: 'OnlyInBLabel' |
2221 | 186 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 20 0) |
187 |
#translateLabel: true |
|
188 |
#labelChannel: #onlyInBLabelHolder |
|
189 |
) |
|
190 |
#(#SequenceViewSpec |
|
191 |
#name: 'ListB' |
|
192 |
#layout: #(#LayoutFrame 0 0.0 20 0.0 0 1.0 -3 1.0) |
|
193 |
#model: #methodsOnlyInBSelection |
|
194 |
#menu: #menuB |
|
195 |
#hasHorizontalScrollBar: true |
|
196 |
#hasVerticalScrollBar: true |
|
197 |
#miniScrollerHorizontal: true |
|
198 |
#valueChangeSelector: #methodsOnlyInBSelectionChanged |
|
199 |
#useIndex: true |
|
200 |
#sequenceList: #methodsOnlyInB |
|
201 |
) |
|
202 |
) |
|
203 |
||
204 |
) |
|
2497 | 205 |
#extent: #(#Point 287 252) |
2221 | 206 |
) |
207 |
) |
|
208 |
||
209 |
) |
|
210 |
) |
|
211 |
#(#ViewSpec |
|
212 |
#name: 'Box4' |
|
213 |
#component: |
|
214 |
#(#SpecCollection |
|
215 |
#collection: #( |
|
216 |
#(#ViewSpec |
|
217 |
#name: 'diffTextViewBox' |
|
218 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
219 |
#initiallyInvisible: true |
|
220 |
#component: |
|
221 |
#(#SpecCollection |
|
222 |
#collection: #( |
|
223 |
#(#LabelSpec |
|
224 |
#label: 'A' |
|
225 |
#name: 'DiffTextLabelA' |
|
226 |
#layout: #(#LayoutFrame 0 0 0 0 0 0.5 20 0) |
|
227 |
#translateLabel: true |
|
228 |
#labelChannel: #diffTextLabelA |
|
229 |
) |
|
230 |
#(#LabelSpec |
|
231 |
#label: 'B' |
|
232 |
#name: 'DiffTextLabelB' |
|
233 |
#layout: #(#LayoutFrame 0 0.5 0 0 0 1 20 0) |
|
234 |
#translateLabel: true |
|
235 |
#labelChannel: #diffTextLabelB |
|
236 |
) |
|
237 |
#(#ArbitraryComponentSpec |
|
238 |
#name: 'diffTextView' |
|
239 |
#layout: #(#LayoutFrame 0 0.0 20 0.0 0 1.0 0 1.0) |
|
240 |
#hasBorder: false |
|
241 |
#component: #diffTextView |
|
242 |
) |
|
243 |
) |
|
244 |
||
245 |
) |
|
246 |
) |
|
247 |
#(#TextEditorSpec |
|
248 |
#name: 'singleTextView' |
|
249 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
250 |
#model: #methodText |
|
251 |
#hasHorizontalScrollBar: true |
|
252 |
#hasVerticalScrollBar: true |
|
253 |
#miniScrollerHorizontal: true |
|
254 |
) |
|
255 |
) |
|
256 |
||
257 |
) |
|
258 |
) |
|
259 |
) |
|
260 |
||
261 |
) |
|
2497 | 262 |
#handles: #(#Any 0.5 1.0) |
2221 | 263 |
) |
264 |
) |
|
265 |
||
266 |
) |
|
267 |
) |
|
268 |
! ! |
|
269 |
||
270 |
!VersionDiffBrowser class methodsFor:'menu specs'! |
|
271 |
||
272 |
mainMenu |
|
273 |
"This resource specification was automatically generated |
|
274 |
by the MenuEditor of ST/X." |
|
275 |
||
276 |
"Do not manually edit this!! If it is corrupted, |
|
277 |
the MenuEditor may not be able to read the specification." |
|
278 |
||
279 |
" |
|
280 |
MenuEditor new openOnClass:VersionDiffBrowser andSelector:#mainMenu |
|
281 |
(Menu new fromLiteralArrayEncoding:(VersionDiffBrowser mainMenu)) startUp |
|
282 |
" |
|
283 |
||
284 |
<resource: #menu> |
|
285 |
||
286 |
^ |
|
287 |
#(#Menu |
|
288 |
#( |
|
289 |
#(#MenuItem |
|
290 |
#label: 'File' |
|
291 |
#translateLabel: true |
|
292 |
#submenu: |
|
293 |
#(#Menu |
|
294 |
#( |
|
295 |
#(#MenuItem |
|
2469 | 296 |
#label: 'Create PatchFile' |
297 |
#translateLabel: true |
|
298 |
#value: #createPatchFile |
|
299 |
) |
|
300 |
#(#MenuItem |
|
301 |
#label: '-' |
|
302 |
) |
|
303 |
#(#MenuItem |
|
2221 | 304 |
#label: 'Exit' |
305 |
#translateLabel: true |
|
306 |
#value: #closeRequest |
|
307 |
) |
|
308 |
) |
|
309 |
nil |
|
310 |
nil |
|
311 |
) |
|
312 |
) |
|
313 |
#(#MenuItem |
|
314 |
#label: 'Help' |
|
315 |
#translateLabel: true |
|
316 |
#startGroup: #right |
|
317 |
#submenu: |
|
318 |
#(#Menu |
|
319 |
#( |
|
320 |
#(#MenuItem |
|
321 |
#label: 'Documentation' |
|
322 |
#translateLabel: true |
|
323 |
#value: #openDocumentation |
|
324 |
) |
|
325 |
#(#MenuItem |
|
326 |
#label: '-' |
|
327 |
) |
|
328 |
#(#MenuItem |
|
329 |
#label: 'About this Application' |
|
330 |
#translateLabel: true |
|
331 |
#value: #openAboutThisApplication |
|
332 |
) |
|
333 |
) |
|
334 |
nil |
|
335 |
nil |
|
336 |
) |
|
337 |
) |
|
338 |
) |
|
339 |
nil |
|
340 |
nil |
|
341 |
) |
|
342 |
! |
|
343 |
||
344 |
menuA |
|
345 |
"This resource specification was automatically generated |
|
346 |
by the MenuEditor of ST/X." |
|
347 |
||
348 |
"Do not manually edit this!! If it is corrupted, |
|
349 |
the MenuEditor may not be able to read the specification." |
|
350 |
||
351 |
" |
|
352 |
MenuEditor new openOnClass:VersionDiffBrowser andSelector:#menu1 |
|
353 |
(Menu new fromLiteralArrayEncoding:(VersionDiffBrowser menu1)) startUp |
|
354 |
" |
|
355 |
||
356 |
<resource: #menu> |
|
357 |
||
358 |
^ |
|
359 |
#(#Menu |
|
360 |
#( |
|
361 |
#(#MenuItem |
|
362 |
#label: 'Inspect' |
|
363 |
#translateLabel: true |
|
364 |
#value: #inspectSelectedChangeInA |
|
365 |
#choiceValue: 'nil "UndefinedObject" ' |
|
366 |
) |
|
2465 | 367 |
#(#MenuItem |
368 |
#label: '-' |
|
369 |
) |
|
370 |
#(#MenuItem |
|
371 |
#label: 'Browse' |
|
372 |
#translateLabel: true |
|
373 |
#value: #browseClassInA |
|
374 |
) |
|
2221 | 375 |
) |
376 |
nil |
|
377 |
nil |
|
378 |
) |
|
379 |
! |
|
380 |
||
381 |
menuB |
|
382 |
"This resource specification was automatically generated |
|
383 |
by the MenuEditor of ST/X." |
|
384 |
||
385 |
"Do not manually edit this!! If it is corrupted, |
|
386 |
the MenuEditor may not be able to read the specification." |
|
387 |
||
388 |
" |
|
389 |
MenuEditor new openOnClass:VersionDiffBrowser andSelector:#menuB |
|
390 |
(Menu new fromLiteralArrayEncoding:(VersionDiffBrowser menuB)) startUp |
|
391 |
" |
|
392 |
||
393 |
<resource: #menu> |
|
394 |
||
395 |
^ |
|
396 |
#(#Menu |
|
397 |
#( |
|
398 |
#(#MenuItem |
|
399 |
#label: 'Inspect' |
|
400 |
#translateLabel: true |
|
401 |
#value: #inspectSelectedChangeInB |
|
402 |
#choiceValue: 'nil "UndefinedObject" ' |
|
403 |
) |
|
2465 | 404 |
#(#MenuItem |
405 |
#label: '-' |
|
406 |
) |
|
407 |
#(#MenuItem |
|
408 |
#label: 'Browse' |
|
409 |
#translateLabel: true |
|
410 |
#value: #browseClassInB |
|
411 |
) |
|
2221 | 412 |
) |
413 |
nil |
|
414 |
nil |
|
415 |
) |
|
416 |
! |
|
417 |
||
418 |
menuM |
|
419 |
"This resource specification was automatically generated |
|
420 |
by the MenuEditor of ST/X." |
|
421 |
||
422 |
"Do not manually edit this!! If it is corrupted, |
|
423 |
the MenuEditor may not be able to read the specification." |
|
424 |
||
425 |
" |
|
426 |
MenuEditor new openOnClass:VersionDiffBrowser andSelector:#menu1 |
|
427 |
(Menu new fromLiteralArrayEncoding:(VersionDiffBrowser menu1)) startUp |
|
428 |
" |
|
429 |
||
430 |
<resource: #menu> |
|
431 |
||
432 |
^ |
|
433 |
#(#Menu |
|
434 |
#( |
|
435 |
#(#MenuItem |
|
2224 | 436 |
#label: 'Inspect both' |
2221 | 437 |
#translateLabel: true |
438 |
#value: #inspectSelectedChangeInM |
|
439 |
#choiceValue: 'nil "UndefinedObject" ' |
|
440 |
) |
|
2465 | 441 |
#(#MenuItem |
442 |
#label: '-' |
|
443 |
) |
|
444 |
#(#MenuItem |
|
445 |
#label: 'Browse' |
|
446 |
#translateLabel: true |
|
447 |
#value: #browseClassInM |
|
448 |
) |
|
2221 | 449 |
) |
450 |
nil |
|
451 |
nil |
|
452 |
) |
|
453 |
! ! |
|
454 |
||
2695 | 455 |
!VersionDiffBrowser class methodsFor:'plugIn spec'! |
456 |
||
457 |
aspectSelectors |
|
458 |
"This resource specification was automatically generated |
|
459 |
by the UIPainter of ST/X." |
|
460 |
||
461 |
"Do not manually edit this. If it is corrupted, |
|
462 |
the UIPainter may not be able to read the specification." |
|
463 |
||
464 |
"Return a description of exported aspects; |
|
465 |
these can be connected to aspects of an embedding application |
|
466 |
(if this app is embedded in a subCanvas)." |
|
467 |
||
468 |
^ #( |
|
469 |
#changedLabelHolder |
|
470 |
#onlyInALabelHolder |
|
471 |
#onlyInBLabelHolder |
|
472 |
). |
|
473 |
||
474 |
! ! |
|
475 |
||
2221 | 476 |
!VersionDiffBrowser class methodsFor:'startup'! |
477 |
||
2695 | 478 |
openOnClass:aClass againstVersion:aVersionA |
2507 | 479 |
" |
480 |
create an VersionDiffBrowser instance and set the class change set of the |
|
2695 | 481 |
browser. The class diff set is generated from classes current against some version |
482 |
via the source code manager . |
|
2507 | 483 |
|
484 |
<return: VersionDiffBrowser> |
|
485 |
" |
|
2497 | 486 |
|theBrowser| |
2224 | 487 |
|
2497 | 488 |
theBrowser := self new. |
489 |
theBrowser allButOpen. |
|
2695 | 490 |
theBrowser setupForClass:aClass againstVersion:aVersionA. |
2497 | 491 |
theBrowser openWindow. |
492 |
^ theBrowser. |
|
2224 | 493 |
|
2695 | 494 |
" |
495 |
self openOnClass:Array againstVersion:'1.116' |
|
496 |
self openOnClass:Array againstVersion:nil - against the version on which Array is based upon |
|
497 |
self openOnClass:Array againstVersion:#newest - against the newest repository version |
|
498 |
||
499 |
self openOnClass:VersionDiffBrowser againstVersion:nil |
|
500 |
self openOnClass:VersionDiffBrowser againstVersion:#newest |
|
501 |
" |
|
502 |
! |
|
503 |
||
504 |
openOnClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB |
|
505 |
" |
|
506 |
create an VersionDiffBrowser instance and set the class change set of the |
|
507 |
browser. The class diff set is generated from two source files. |
|
508 |
||
509 |
<return: VersionDiffBrowser> |
|
510 |
" |
|
2716
8451e7057f00
some common startup protocol between DiffViewer and VersionDiffBrowser
Claus Gittinger <cg@exept.de>
parents:
2714
diff
changeset
|
511 |
^ self |
8451e7057f00
some common startup protocol between DiffViewer and VersionDiffBrowser
Claus Gittinger <cg@exept.de>
parents:
2714
diff
changeset
|
512 |
openOnClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB |
8451e7057f00
some common startup protocol between DiffViewer and VersionDiffBrowser
Claus Gittinger <cg@exept.de>
parents:
2714
diff
changeset
|
513 |
title:nil |
8451e7057f00
some common startup protocol between DiffViewer and VersionDiffBrowser
Claus Gittinger <cg@exept.de>
parents:
2714
diff
changeset
|
514 |
! |
8451e7057f00
some common startup protocol between DiffViewer and VersionDiffBrowser
Claus Gittinger <cg@exept.de>
parents:
2714
diff
changeset
|
515 |
|
8451e7057f00
some common startup protocol between DiffViewer and VersionDiffBrowser
Claus Gittinger <cg@exept.de>
parents:
2714
diff
changeset
|
516 |
openOnClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB title:ignoredTitle |
8451e7057f00
some common startup protocol between DiffViewer and VersionDiffBrowser
Claus Gittinger <cg@exept.de>
parents:
2714
diff
changeset
|
517 |
" |
8451e7057f00
some common startup protocol between DiffViewer and VersionDiffBrowser
Claus Gittinger <cg@exept.de>
parents:
2714
diff
changeset
|
518 |
create an VersionDiffBrowser instance and set the class change set of the |
8451e7057f00
some common startup protocol between DiffViewer and VersionDiffBrowser
Claus Gittinger <cg@exept.de>
parents:
2714
diff
changeset
|
519 |
browser. The class diff set is generated from two source files. |
8451e7057f00
some common startup protocol between DiffViewer and VersionDiffBrowser
Claus Gittinger <cg@exept.de>
parents:
2714
diff
changeset
|
520 |
|
8451e7057f00
some common startup protocol between DiffViewer and VersionDiffBrowser
Claus Gittinger <cg@exept.de>
parents:
2714
diff
changeset
|
521 |
<return: VersionDiffBrowser> |
8451e7057f00
some common startup protocol between DiffViewer and VersionDiffBrowser
Claus Gittinger <cg@exept.de>
parents:
2714
diff
changeset
|
522 |
" |
2695 | 523 |
|theBrowser| |
524 |
||
525 |
theBrowser := self new. |
|
526 |
theBrowser allButOpen. |
|
527 |
theBrowser setupForClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB. |
|
528 |
theBrowser openWindow. |
|
529 |
^ theBrowser. |
|
2224 | 530 |
! |
531 |
||
2497 | 532 |
openOnClass:aClass versionA:aVersionA versionB:aVersionB |
2507 | 533 |
" |
534 |
create an VersionDiffBrowser instance and set the class change set of the |
|
2695 | 535 |
browser. The class diff set is generated from two class versions via |
2507 | 536 |
the source code manager . |
537 |
||
538 |
<return: VersionDiffBrowser> |
|
539 |
" |
|
2497 | 540 |
|theBrowser| |
2221 | 541 |
|
2497 | 542 |
theBrowser := self new. |
543 |
theBrowser allButOpen. |
|
2695 | 544 |
theBrowser setupForClass:aClass versionA:aVersionA versionB:aVersionB. |
2497 | 545 |
theBrowser openWindow. |
546 |
^ theBrowser. |
|
2221 | 547 |
|
548 |
" |
|
549 |
self openOnClass:Array versionA:'1.116' versionB:'1.113' |
|
550 |
" |
|
551 |
! ! |
|
552 |
||
553 |
!VersionDiffBrowser methodsFor:'accessing'! |
|
554 |
||
2497 | 555 |
changeSetA |
556 |
" |
|
557 |
gets the change set which contains only the new methods |
|
558 |
in versionA of the class |
|
2221 | 559 |
|
2497 | 560 |
<return: ChangeSet> |
561 |
" |
|
2221 | 562 |
|
2497 | 563 |
^ self classChangeSet methodsOnlyInA |
2221 | 564 |
! |
565 |
||
2497 | 566 |
changeSetB |
567 |
" |
|
568 |
gets the change set which contains only the new methods |
|
569 |
in versionB of the class |
|
570 |
||
571 |
<return: ChangeSet> |
|
572 |
" |
|
573 |
||
574 |
^ self classChangeSet methodsOnlyInB |
|
575 |
! |
|
576 |
||
577 |
classBeingCompared |
|
2507 | 578 |
" |
579 |
gets the class from the change set which is compared. |
|
2224 | 580 |
|
2507 | 581 |
<return: Class> |
582 |
" |
|
2497 | 583 |
^ self classChangeSet classBeingCompared |
584 |
! |
|
585 |
||
586 |
classChangeSet |
|
2507 | 587 |
" |
588 |
returns the class change set which is the model of the version diff browser. |
|
2224 | 589 |
|
2507 | 590 |
<return: ClassChangeSet> |
591 |
" |
|
592 |
^ classChangeSet |
|
593 |
! |
|
2497 | 594 |
|
2507 | 595 |
classChangeSet:aClassChangeSet |
2501 | 596 |
" |
2507 | 597 |
sets the class change set which is the model of the version diff browser. |
598 |
The labels, the lists, the visibility and the selection of the lists must be reseted |
|
599 |
when a new change set is given. |
|
2497 | 600 |
|
2507 | 601 |
<return: self> |
2501 | 602 |
" |
2507 | 603 |
classChangeSet := aClassChangeSet. |
2501 | 604 |
self updateLabels. |
605 |
self updateLists. |
|
606 |
self resetSelectionHolders. |
|
607 |
! |
|
2224 | 608 |
|
2507 | 609 |
selectedChangeInA |
610 |
" |
|
611 |
gets the selected method change for the 'method only in version A'. |
|
612 |
||
613 |
<return: MethodChange | nil> |
|
614 |
" |
|
615 |
|sel change| |
|
616 |
||
617 |
sel := self methodsOnlyInASelection value. |
|
618 |
sel notNil ifTrue:[ |
|
619 |
change := (self changeSetA at:sel). |
|
2650
447c99ac6f76
oops - inspect & browse menu was broken.
Claus Gittinger <cg@exept.de>
parents:
2626
diff
changeset
|
620 |
^ change |
2507 | 621 |
]. |
622 |
^ nil |
|
623 |
! |
|
624 |
||
625 |
selectedChangeInB |
|
626 |
" |
|
627 |
gets the selected method change for the 'method only in version B'. |
|
628 |
||
629 |
<return: MethodChange | nil> |
|
630 |
" |
|
631 |
|sel change| |
|
632 |
||
633 |
sel := self methodsOnlyInBSelection value. |
|
634 |
sel notNil ifTrue:[ |
|
635 |
change := (self changeSetB at:sel). |
|
2650
447c99ac6f76
oops - inspect & browse menu was broken.
Claus Gittinger <cg@exept.de>
parents:
2626
diff
changeset
|
636 |
^ change |
2507 | 637 |
]. |
638 |
^ nil |
|
639 |
! |
|
640 |
||
641 |
selectedChangesInM |
|
642 |
" |
|
643 |
get the two method changes for the selected 'changed method'. |
|
644 |
||
645 |
<return: <Array with:MethodChange with:MethodChange | nil>> |
|
646 |
" |
|
2745 | 647 |
|sel changeA changeB theTwoChanges| |
2507 | 648 |
|
649 |
sel := self methodsChangedSelection value. |
|
650 |
sel notNil ifTrue:[ |
|
2745 | 651 |
theTwoChanges := self classChangeSet methodsChanged at:sel. |
652 |
changeA := theTwoChanges first. |
|
653 |
changeB := theTwoChanges second. |
|
654 |
^ Array with:changeA with:changeB |
|
2507 | 655 |
]. |
656 |
^ nil |
|
657 |
! |
|
658 |
||
2221 | 659 |
versionA |
2507 | 660 |
" |
661 |
gets the first class version to be compared |
|
2221 | 662 |
|
2507 | 663 |
<return: String> |
664 |
" |
|
2731 | 665 |
classChangeSet isNil ifTrue:[^ 'A']. |
666 |
^ classChangeSet labelA |
|
2221 | 667 |
! |
668 |
||
669 |
versionB |
|
2507 | 670 |
" |
671 |
gets the second class version to be compared |
|
2221 | 672 |
|
2507 | 673 |
<return: String> |
674 |
" |
|
2731 | 675 |
classChangeSet isNil ifTrue:[^ 'B']. |
676 |
^ classChangeSet labelB |
|
2221 | 677 |
! ! |
678 |
||
679 |
!VersionDiffBrowser methodsFor:'actions'! |
|
680 |
||
681 |
methodsChangedSelectionChanged |
|
2507 | 682 |
" |
683 |
the selection in the list of the 'changed methods' changed. |
|
684 |
Reset the selection of the two other lists and calc the method change. |
|
685 |
||
686 |
<return: self> |
|
687 |
" |
|
2695 | 688 |
|sel idxA idxB changeA changeB methodsChanged| |
2221 | 689 |
|
690 |
sel := self methodsChangedSelection value. |
|
691 |
sel notNil ifTrue:[ |
|
692 |
self methodsOnlyInASelection value:nil. |
|
693 |
self methodsOnlyInBSelection value:nil. |
|
2695 | 694 |
methodsChanged := self classChangeSet methodsChanged. |
695 |
changeA := (methodsChanged at:sel) first. |
|
696 |
changeB := (methodsChanged at:sel) second. |
|
2501 | 697 |
self withReadCursorDo:[ |
2377 | 698 |
self diffTextView text1:changeA source text2:changeB source. |
2501 | 699 |
self diffTextView moveToNextChanged |
2377 | 700 |
]. |
2221 | 701 |
self showDiffTextView. |
702 |
] |
|
2377 | 703 |
|
704 |
"Modified: / 3.9.1999 / 15:01:30 / ps" |
|
2221 | 705 |
! |
706 |
||
707 |
methodsOnlyInASelectionChanged |
|
2507 | 708 |
" |
709 |
the selection in the list of the 'method only in version A' changed. |
|
710 |
Reset the selection of the two other lists and show the method in |
|
711 |
the text view. |
|
712 |
||
713 |
<return: self> |
|
714 |
" |
|
2221 | 715 |
|change sel| |
716 |
||
717 |
sel := self methodsOnlyInASelection value. |
|
718 |
sel notNil ifTrue:[ |
|
719 |
self methodsOnlyInBSelection value:nil. |
|
720 |
self methodsChangedSelection value:nil. |
|
2497 | 721 |
change := self changeSetA at:sel. |
2221 | 722 |
self methodText value:(change source). |
723 |
self showSingleTextView. |
|
724 |
] |
|
725 |
! |
|
726 |
||
727 |
methodsOnlyInBSelectionChanged |
|
2507 | 728 |
" |
729 |
the selection in the list of the 'method only in version B' changed. |
|
730 |
Reset the selection of the two other lists and show the method in |
|
731 |
the text view. |
|
732 |
||
733 |
<return: self> |
|
734 |
" |
|
2221 | 735 |
|change sel| |
736 |
||
737 |
sel := self methodsOnlyInBSelection value. |
|
738 |
sel notNil ifTrue:[ |
|
739 |
self methodsOnlyInASelection value:nil. |
|
740 |
self methodsChangedSelection value:nil. |
|
2497 | 741 |
change := self changeSetB at:sel. |
2221 | 742 |
self methodText value:(change source). |
743 |
self showSingleTextView. |
|
744 |
] |
|
745 |
! ! |
|
746 |
||
747 |
!VersionDiffBrowser methodsFor:'aspects'! |
|
748 |
||
2585 | 749 |
boxAVisible |
2745 | 750 |
boxAVisible isNil ifTrue:[ |
751 |
boxAVisible := true asValue. |
|
2585 | 752 |
]. |
2745 | 753 |
^ boxAVisible. |
2585 | 754 |
! |
755 |
||
756 |
boxBVisible |
|
2745 | 757 |
boxBVisible isNil ifTrue:[ |
758 |
boxBVisible := true asValue. |
|
2585 | 759 |
]. |
2745 | 760 |
^ boxBVisible. |
2585 | 761 |
! |
762 |
||
763 |
boxMVisible |
|
2745 | 764 |
boxMVisible isNil ifTrue:[ |
765 |
boxMVisible := true asValue. |
|
2585 | 766 |
]. |
2745 | 767 |
^ boxMVisible. |
2585 | 768 |
! |
769 |
||
2221 | 770 |
changedLabelHolder |
2507 | 771 |
" |
772 |
aspect for the label of the changed method box. |
|
2221 | 773 |
|
2507 | 774 |
<return: ValueHolder on: nil> |
775 |
" |
|
2221 | 776 |
|holder| |
777 |
||
778 |
(holder := builder bindingAt:#changedLabelHolder) isNil ifTrue:[ |
|
779 |
builder aspectAt:#changedLabelHolder put:(holder := ValueHolder new). |
|
780 |
]. |
|
781 |
^ holder. |
|
782 |
! |
|
783 |
||
784 |
diffTextLabelA |
|
2507 | 785 |
" |
786 |
aspect for the label for version A. |
|
2221 | 787 |
|
2507 | 788 |
<return: ValueHolder on: nil> |
789 |
" |
|
2221 | 790 |
|
791 |
|holder| |
|
792 |
||
793 |
(holder := builder bindingAt:#diffTextLabelA) isNil ifTrue:[ |
|
794 |
builder aspectAt:#diffTextLabelA put:(holder := ValueHolder new). |
|
795 |
]. |
|
796 |
^ holder. |
|
797 |
! |
|
798 |
||
799 |
diffTextLabelB |
|
2507 | 800 |
" |
801 |
aspect for the label for version B. |
|
2221 | 802 |
|
2507 | 803 |
<return: ValueHolder on: nil> |
804 |
" |
|
2221 | 805 |
|
806 |
|holder| |
|
807 |
||
808 |
(holder := builder bindingAt:#diffTextLabelB) isNil ifTrue:[ |
|
809 |
builder aspectAt:#diffTextLabelB put:(holder := ValueHolder new). |
|
810 |
]. |
|
811 |
^ holder. |
|
812 |
! |
|
813 |
||
2497 | 814 |
diffTextView |
2507 | 815 |
" |
816 |
return the component for the diff text view. |
|
2497 | 817 |
|
2507 | 818 |
<return: HVScrollableView> |
819 |
" |
|
2497 | 820 |
diffTextView isNil ifTrue:[ |
821 |
diffTextView := HVScrollableView |
|
822 |
for:DiffTextView |
|
823 |
miniScrollerH:true miniScrollerV:false. |
|
824 |
diffTextView addNextPreviousButtons. |
|
825 |
]. |
|
826 |
^ diffTextView |
|
827 |
! |
|
828 |
||
2221 | 829 |
methodText |
2507 | 830 |
" |
831 |
aspect for the text in the method text view. |
|
2221 | 832 |
|
2507 | 833 |
<return: ValueHolder on: nil> |
834 |
" |
|
2221 | 835 |
|holder| |
836 |
||
837 |
(holder := builder bindingAt:#methodText) isNil ifTrue:[ |
|
838 |
builder aspectAt:#methodText put:(holder := ValueHolder new). |
|
839 |
]. |
|
840 |
^ holder. |
|
841 |
! |
|
842 |
||
843 |
methodsChanged |
|
2507 | 844 |
" |
845 |
aspect for the 'changed method' list. |
|
2221 | 846 |
|
2507 | 847 |
<return: List> |
848 |
" |
|
2221 | 849 |
|
850 |
|holder| |
|
851 |
||
852 |
(holder := builder bindingAt:#methodsChanged) isNil ifTrue:[ |
|
853 |
builder aspectAt:#methodsChanged put:(holder := List new). |
|
854 |
]. |
|
855 |
^ holder. |
|
856 |
! |
|
857 |
||
858 |
methodsChangedSelection |
|
2507 | 859 |
" |
860 |
aspect for the selection holder of 'changed method'-list. |
|
2221 | 861 |
|
2507 | 862 |
<return: ValueHolder on: nil> |
863 |
" |
|
2221 | 864 |
|
865 |
|holder| |
|
866 |
||
867 |
(holder := builder bindingAt:#methodsChangedSelection) isNil ifTrue:[ |
|
868 |
builder aspectAt:#methodsChangedSelection put:(holder := ValueHolder new). |
|
869 |
]. |
|
870 |
^ holder. |
|
871 |
! |
|
872 |
||
873 |
methodsOnlyInA |
|
2507 | 874 |
" |
875 |
aspect for the 'method only in version A' list. |
|
2221 | 876 |
|
2507 | 877 |
<return: List> |
878 |
" |
|
2221 | 879 |
|
880 |
|holder| |
|
881 |
||
882 |
(holder := builder bindingAt:#methodsOnlyInA) isNil ifTrue:[ |
|
883 |
builder aspectAt:#methodsOnlyInA put:(holder := List new). |
|
884 |
]. |
|
885 |
^ holder. |
|
886 |
! |
|
887 |
||
888 |
methodsOnlyInASelection |
|
2507 | 889 |
" |
890 |
aspect for the selection holder of 'method only in version A'-list. |
|
2221 | 891 |
|
2507 | 892 |
<return: ValueHolder on: nil> |
893 |
" |
|
2221 | 894 |
|
895 |
|holder| |
|
896 |
||
897 |
(holder := builder bindingAt:#methodsOnlyInASelection) isNil ifTrue:[ |
|
898 |
builder aspectAt:#methodsOnlyInASelection put:(holder := ValueHolder new). |
|
899 |
]. |
|
900 |
^ holder. |
|
901 |
! |
|
902 |
||
903 |
methodsOnlyInB |
|
2507 | 904 |
" |
905 |
aspect for the 'method only in version B' list. |
|
2221 | 906 |
|
2507 | 907 |
<return: List> |
908 |
" |
|
2221 | 909 |
|
910 |
|holder| |
|
911 |
||
912 |
(holder := builder bindingAt:#methodsOnlyInB) isNil ifTrue:[ |
|
913 |
builder aspectAt:#methodsOnlyInB put:(holder := List new). |
|
914 |
]. |
|
915 |
^ holder. |
|
916 |
! |
|
917 |
||
918 |
methodsOnlyInBSelection |
|
2507 | 919 |
" |
920 |
aspect for the selection holder of 'method only in version B'-list. |
|
2221 | 921 |
|
2507 | 922 |
<return: ValueHolder on: nil> |
923 |
" |
|
2221 | 924 |
|
925 |
|holder| |
|
926 |
||
927 |
(holder := builder bindingAt:#methodsOnlyInBSelection) isNil ifTrue:[ |
|
928 |
builder aspectAt:#methodsOnlyInBSelection put:(holder := ValueHolder new). |
|
929 |
]. |
|
930 |
^ holder. |
|
931 |
! |
|
932 |
||
933 |
onlyInALabelHolder |
|
2507 | 934 |
" |
935 |
aspect for the label for 'method only in version A'. |
|
2221 | 936 |
|
2507 | 937 |
<return: ValueHolder on: nil> |
938 |
" |
|
2221 | 939 |
|
940 |
|holder| |
|
941 |
||
942 |
(holder := builder bindingAt:#onlyInALabelHolder) isNil ifTrue:[ |
|
943 |
builder aspectAt:#onlyInALabelHolder put:(holder := ValueHolder new). |
|
944 |
]. |
|
945 |
^ holder. |
|
946 |
! |
|
947 |
||
948 |
onlyInBLabelHolder |
|
2507 | 949 |
" |
950 |
aspect for the label for 'method only in version B'. |
|
2221 | 951 |
|
2507 | 952 |
<return: ValueHolder on: nil> |
953 |
" |
|
2221 | 954 |
|
955 |
|holder| |
|
956 |
||
957 |
(holder := builder bindingAt:#onlyInBLabelHolder) isNil ifTrue:[ |
|
958 |
builder aspectAt:#onlyInBLabelHolder put:(holder := ValueHolder new). |
|
959 |
]. |
|
960 |
^ holder. |
|
961 |
! ! |
|
962 |
||
2725 | 963 |
!VersionDiffBrowser methodsFor:'aspects-exported'! |
2695 | 964 |
|
965 |
changedLabelHolder:aValueHolder |
|
966 |
builder aspectAt:#changedLabelHolder put:aValueHolder. |
|
967 |
||
968 |
! |
|
969 |
||
970 |
classHolder:aValueHolder |
|
971 |
|holder| |
|
972 |
||
973 |
(holder := builder bindingAt:#classHolder) notNil ifTrue:[ |
|
974 |
holder removeDependent:self |
|
975 |
]. |
|
976 |
builder aspectAt:#classHolder put:aValueHolder. |
|
977 |
aValueHolder notNil ifTrue:[ |
|
978 |
aValueHolder addDependent:self |
|
979 |
] |
|
980 |
! |
|
981 |
||
982 |
onlyInALabelHolder:aValueHolder |
|
983 |
builder aspectAt:#onlyInALabelHolder put:aValueHolder. |
|
984 |
! |
|
985 |
||
986 |
onlyInBLabelHolder:aValueHolder |
|
987 |
builder aspectAt:#onlyInBLabelHolder put:aValueHolder. |
|
988 |
! |
|
989 |
||
990 |
versionAHolder:aValueHolder |
|
991 |
|holder| |
|
992 |
||
993 |
(holder := builder bindingAt:#versionAHolder) notNil ifTrue:[ |
|
994 |
holder removeDependent:self |
|
995 |
]. |
|
996 |
builder aspectAt:#versionAHolder put:aValueHolder. |
|
997 |
aValueHolder notNil ifTrue:[ |
|
998 |
aValueHolder addDependent:self |
|
999 |
] |
|
1000 |
! |
|
1001 |
||
1002 |
versionBHolder:aValueHolder |
|
1003 |
|holder| |
|
1004 |
||
1005 |
(holder := builder bindingAt:#versionBHolder) notNil ifTrue:[ |
|
1006 |
holder removeDependent:self |
|
1007 |
]. |
|
1008 |
builder aspectAt:#versionBHolder put:aValueHolder. |
|
1009 |
aValueHolder notNil ifTrue:[ |
|
1010 |
aValueHolder addDependent:self |
|
1011 |
] |
|
1012 |
! ! |
|
1013 |
||
1014 |
!VersionDiffBrowser methodsFor:'change & update'! |
|
1015 |
||
1016 |
update:something with:parameter from:changedObject |
|
1017 |
|classHolder versionAHolder versionBHolder| |
|
1018 |
||
1019 |
classHolder := self classHolder. |
|
1020 |
versionAHolder := self versionAHolder. |
|
1021 |
versionBHolder := self versionBHolder. |
|
1022 |
||
1023 |
(changedObject == classHolder |
|
1024 |
or:[changedObject == versionAHolder |
|
1025 |
or:[changedObject == versionBHolder]]) ifTrue:[ |
|
1026 |
self setupForClass:(classHolder value) versionA:(versionAHolder value) versionB:(versionBHolder value) |
|
1027 |
. ^ self |
|
1028 |
]. |
|
1029 |
super update:something with:parameter from:changedObject |
|
1030 |
! ! |
|
1031 |
||
2221 | 1032 |
!VersionDiffBrowser methodsFor:'initialization & release'! |
1033 |
||
1034 |
postBuildWith:aBuilder |
|
2507 | 1035 |
" |
1036 |
components which are invisible should be ignored by the panel. |
|
1037 |
Cannot be set via the interface builder. |
|
2221 | 1038 |
|
2507 | 1039 |
<return: self> |
1040 |
" |
|
2221 | 1041 |
(aBuilder componentAt:#TopHorizontalPanel) ignoreInvisibleComponents:true. |
1042 |
^ super postBuildWith:aBuilder |
|
1043 |
! ! |
|
1044 |
||
1045 |
!VersionDiffBrowser methodsFor:'menu action'! |
|
1046 |
||
2465 | 1047 |
browseChange:aChange |
2507 | 1048 |
" |
1049 |
browse the change in aChange |
|
1050 |
||
1051 |
<return: self> |
|
1052 |
" |
|
2650
447c99ac6f76
oops - inspect & browse menu was broken.
Claus Gittinger <cg@exept.de>
parents:
2626
diff
changeset
|
1053 |
|cls sel m| |
447c99ac6f76
oops - inspect & browse menu was broken.
Claus Gittinger <cg@exept.de>
parents:
2626
diff
changeset
|
1054 |
|
2578
29264fb3847e
avoid debugger in browse-menu
Claus Gittinger <cg@exept.de>
parents:
2536
diff
changeset
|
1055 |
aChange isNil ifTrue:[^ self]. |
2650
447c99ac6f76
oops - inspect & browse menu was broken.
Claus Gittinger <cg@exept.de>
parents:
2626
diff
changeset
|
1056 |
cls := aChange changeClass. |
447c99ac6f76
oops - inspect & browse menu was broken.
Claus Gittinger <cg@exept.de>
parents:
2626
diff
changeset
|
1057 |
sel := aChange changeSelector. |
447c99ac6f76
oops - inspect & browse menu was broken.
Claus Gittinger <cg@exept.de>
parents:
2626
diff
changeset
|
1058 |
(cls compiledMethodAt:sel) isNil ifTrue:[ |
447c99ac6f76
oops - inspect & browse menu was broken.
Claus Gittinger <cg@exept.de>
parents:
2626
diff
changeset
|
1059 |
self information:'Method does not exist.' |
447c99ac6f76
oops - inspect & browse menu was broken.
Claus Gittinger <cg@exept.de>
parents:
2626
diff
changeset
|
1060 |
]. |
447c99ac6f76
oops - inspect & browse menu was broken.
Claus Gittinger <cg@exept.de>
parents:
2626
diff
changeset
|
1061 |
|
2697
b4f4e431b71e
browserClass from preferences
Claus Gittinger <cg@exept.de>
parents:
2695
diff
changeset
|
1062 |
UserPreferences current systemBrowserClass openInClass:cls selector:sel. |
2465 | 1063 |
! |
1064 |
||
1065 |
browseClassInA |
|
2507 | 1066 |
" |
1067 |
browse the selected method. |
|
1068 |
||
1069 |
<return: self> |
|
1070 |
" |
|
2465 | 1071 |
self browseChange:(self selectedChangeInA). |
1072 |
! |
|
2221 | 1073 |
|
2465 | 1074 |
browseClassInB |
2507 | 1075 |
" |
1076 |
browse the selected method. |
|
1077 |
||
1078 |
<return: self> |
|
1079 |
" |
|
2465 | 1080 |
self browseChange:(self selectedChangeInB). |
1081 |
! |
|
1082 |
||
1083 |
browseClassInM |
|
2507 | 1084 |
" |
1085 |
browse the selected method. |
|
1086 |
||
1087 |
<return: self> |
|
1088 |
" |
|
2465 | 1089 |
self browseChange:(self selectedChangesInM first). |
1090 |
! |
|
1091 |
||
2469 | 1092 |
createPatchFile |
1093 |
"create a pacthFile, to patch the old version (versionB) into |
|
1094 |
the new version (versionA)" |
|
1095 |
||
1096 |
|oldVersion newVersion vsnMthdA vsnMthdB vsnA vsnB info| |
|
2730 | 1097 |
|
1098 |
self halt:'Not yet implemented'. |
|
1099 |
^ self. |
|
1100 |
||
2497 | 1101 |
vsnMthdA := self changeSetA |
2469 | 1102 |
detect:[:ch | ch isMethodChange |
1103 |
and:[ch changeClass isMeta |
|
1104 |
and:[ch changeSelector = #version]]] |
|
1105 |
ifNone:nil. |
|
2497 | 1106 |
vsnMthdB := self changeSetA |
2469 | 1107 |
detect:[:ch | ch isMethodChange |
1108 |
and:[ch changeClass isMeta |
|
1109 |
and:[ch changeSelector = #version]]] |
|
1110 |
ifNone:nil. |
|
1111 |
||
1112 |
vsnMthdA notNil ifTrue:[ |
|
1113 |
"/ extract the version |
|
1114 |
vsnA := Class revisionStringFromSource:vsnMthdA source. |
|
1115 |
vsnA notNil ifTrue:[ |
|
1116 |
info := Class revisionInfoFromString:vsnA. |
|
1117 |
info notNil ifTrue:[ |
|
1118 |
vsnA := info at:#revision ifAbsent:nil. |
|
1119 |
] ifFalse:[ |
|
1120 |
vsnA := nil. |
|
1121 |
]. |
|
1122 |
]. |
|
1123 |
]. |
|
1124 |
vsnMthdB notNil ifTrue:[ |
|
1125 |
"/ extract the version |
|
1126 |
vsnB := Class revisionStringFromSource:vsnMthdB source. |
|
1127 |
vsnB notNil ifTrue:[ |
|
1128 |
info := Class revisionInfoFromString:vsnB. |
|
1129 |
info notNil ifTrue:[ |
|
1130 |
vsnB := info at:#revision ifAbsent:nil. |
|
1131 |
] ifFalse:[ |
|
1132 |
vsnB := nil. |
|
1133 |
]. |
|
1134 |
]. |
|
1135 |
]. |
|
1136 |
||
2507 | 1137 |
(vsnA isNil or:[vsnB isNil or:[vsnA = vsnB]]) ifTrue:[ |
2469 | 1138 |
self warn:'The generated patch file will not be able to validate/update the class version'. |
1139 |
]. |
|
1140 |
||
1141 |
self halt. |
|
1142 |
||
1143 |
! |
|
1144 |
||
2465 | 1145 |
inspectSelectedChangeInA |
2507 | 1146 |
" |
1147 |
inspect the selected method change for the 'method only in version A'. |
|
1148 |
||
1149 |
<return: self> |
|
1150 |
" |
|
2465 | 1151 |
self selectedChangeInA inspect. |
2221 | 1152 |
! |
1153 |
||
1154 |
inspectSelectedChangeInB |
|
2507 | 1155 |
" |
1156 |
inspect the selected method change for the 'method only in version B'. |
|
1157 |
||
1158 |
<return: self> |
|
1159 |
" |
|
2465 | 1160 |
self selectedChangeInB inspect. |
1161 |
! |
|
1162 |
||
1163 |
inspectSelectedChangeInM |
|
2507 | 1164 |
" |
1165 |
inspect the two method changes for the selected 'changed method'. |
|
1166 |
||
1167 |
<return: self> |
|
1168 |
" |
|
2465 | 1169 |
|changes| |
1170 |
||
1171 |
changes := self selectedChangesInM. |
|
1172 |
changes do:[:change | |
|
1173 |
change inspect |
|
1174 |
]. |
|
1175 |
! |
|
1176 |
||
2501 | 1177 |
mainMenu |
2507 | 1178 |
" |
1179 |
if this application runs as an subapplication, |
|
1180 |
the menu bar should not be used. |
|
1181 |
||
1182 |
<return: self> |
|
1183 |
" |
|
2501 | 1184 |
self masterApplication isNil ifTrue:[ |
1185 |
^ self class mainMenu |
|
1186 |
]. |
|
1187 |
^ nil |
|
2221 | 1188 |
! ! |
1189 |
||
1190 |
!VersionDiffBrowser methodsFor:'private'! |
|
1191 |
||
2745 | 1192 |
addAcceptToTextViewMenus |
1193 |
" |
|
1194 |
add to the standard diff text view or single text views menu an accept entry. |
|
1195 |
The acceptAction will fetch the corresponding change and apply it |
|
1196 |
(not the shown text) |
|
1197 |
||
1198 |
<return: self> |
|
1199 |
" |
|
1200 |
||
1201 |
|m v diffTextView leftView rightView singleView| |
|
1202 |
||
1203 |
diffTextView := self diffTextView. |
|
1204 |
leftView := diffTextView leftTextView. |
|
1205 |
rightView := diffTextView rightTextView. |
|
1206 |
singleView := self builder componentAt:#singleTextView. |
|
1207 |
||
1208 |
(Array |
|
1209 |
with:leftView |
|
1210 |
with:rightView |
|
1211 |
with:singleView) |
|
1212 |
do:[:v | |
|
1213 |
m := v editMenu. |
|
1214 |
(m selectorAt:#accept) isNil ifTrue:[ |
|
1215 |
m addLabels:#('-' 'accept') |
|
1216 |
selectors:(Array with:nil with:#accept) |
|
1217 |
after:#copySelection. |
|
1218 |
]. |
|
1219 |
m |
|
1220 |
actionAt:#accept |
|
1221 |
put:[ |
|
1222 |
|idx idx2 text change changeSet| |
|
1223 |
||
1224 |
changeSet := self classChangeSet. |
|
1225 |
||
1226 |
v == singleView ifTrue:[ |
|
1227 |
self methodsOnlyInASelection value notNil |
|
1228 |
ifTrue: [ |
|
1229 |
change := (changeSet methodsOnlyInA at: self methodsOnlyInASelection value) |
|
1230 |
] ifFalse:[ |
|
1231 |
change := (changeSet methodsOnlyInB at: self methodsOnlyInBSelection value) |
|
1232 |
]. |
|
1233 |
] ifFalse:[ |
|
1234 |
idx := self methodsChangedSelection value. |
|
1235 |
||
1236 |
v == self diffTextView leftTextView ifTrue:[ |
|
1237 |
change := (changeSet methodsChanged at:idx) first. |
|
1238 |
] ifFalse:[ |
|
1239 |
change := (changeSet methodsChanged at:idx) second. |
|
1240 |
]. |
|
1241 |
]. |
|
1242 |
change apply |
|
1243 |
]. |
|
1244 |
m selectorAt:#accept put:nil. |
|
1245 |
v menuHolder:m. |
|
1246 |
v menuMessage:#value. |
|
1247 |
] |
|
1248 |
! |
|
1249 |
||
2497 | 1250 |
generator |
2507 | 1251 |
" |
1252 |
generate a print string for a change. |
|
2497 | 1253 |
|
2507 | 1254 |
<return: Block> |
1255 |
" |
|
1256 |
^[:aChange | |
|
2585 | 1257 |
|result mPkg cPkg cls m changeClassName| |
1258 |
||
2507 | 1259 |
aChange isClassDefinitionChange ifTrue:[ |
2585 | 1260 |
result := aChange printStringWithoutClassName |
2497 | 1261 |
] ifFalse:[ |
2507 | 1262 |
aChange isDoIt ifTrue:[ |
1263 |
result := aChange source , ' (doIt)' |
|
2497 | 1264 |
] ifFalse:[ |
2585 | 1265 |
changeClassName := aChange className. |
1266 |
changeClassName = self classBeingCompared name ifTrue:[ |
|
1267 |
result := aChange printStringWithoutClassName. |
|
2745 | 1268 |
|
1269 |
aChange isMethodCategoryChange ifTrue:[ |
|
1270 |
result := result , ' (category)' |
|
1271 |
] ifFalse:[ |
|
1272 |
aChange isMethodChange ifTrue:[ |
|
1273 |
cls := aChange changeClass. |
|
1274 |
cls notNil ifTrue:[ |
|
1275 |
m := cls compiledMethodAt:aChange selector. |
|
1276 |
(m notNil |
|
1277 |
and:[m package ~= cls package]) ifTrue:[ |
|
1278 |
result := aChange printStringWithoutClassName , ' [' , m package , ']'. |
|
1279 |
]. |
|
2497 | 1280 |
]. |
2745 | 1281 |
] |
2497 | 1282 |
] |
1283 |
] ifFalse:[ |
|
1284 |
"/ include name in private class changes |
|
2585 | 1285 |
(changeClassName startsWith:(self classBeingCompared name , '::')) ifTrue:[ |
1286 |
result := (changeClassName copyFrom:(self classBeingCompared name size + 3)) , ' ' , aChange printStringWithoutClassName |
|
2497 | 1287 |
] ifFalse:[ |
2507 | 1288 |
result := aChange printString |
2497 | 1289 |
] |
1290 |
] |
|
1291 |
] |
|
1292 |
]. |
|
1293 |
result |
|
1294 |
]. |
|
1295 |
! |
|
1296 |
||
2501 | 1297 |
resetSelectionHolders |
2507 | 1298 |
" |
1299 |
reset all selection holders when a new change set is given. |
|
1300 |
First set the selection to nil. |
|
1301 |
||
1302 |
<return: self> |
|
1303 |
" |
|
2501 | 1304 |
|
1305 |
self methodsChangedSelection value:nil. |
|
1306 |
self methodsOnlyInASelection value:nil. |
|
1307 |
self methodsOnlyInBSelection value:nil. |
|
2507 | 1308 |
self diffTextView text1:'' text2:''. |
1309 |
self methodText value:''. |
|
1310 |
||
1311 |
"/ self methodsChangedSelectionChanged. |
|
1312 |
"/ self methodsOnlyInASelectionChanged. |
|
1313 |
"/ self methodsOnlyInBSelectionChanged. |
|
2501 | 1314 |
|
1315 |
! |
|
1316 |
||
2221 | 1317 |
showDiffTextView |
2507 | 1318 |
" |
1319 |
if a method change is selected, then show the diff text view. |
|
1320 |
Add an accept entry to the popup menu. |
|
1321 |
||
1322 |
<return: self> |
|
1323 |
" |
|
2694 | 1324 |
|builder| |
1325 |
||
1326 |
builder := self builder. |
|
1327 |
(builder componentAt:#diffTextViewBox) raise; beVisible. |
|
1328 |
(builder componentAt:#singleTextView) beInvisible. |
|
1329 |
(builder componentAt:#diffTextView) realizeAllSubViews. |
|
1330 |
||
2465 | 1331 |
self addAcceptToTextViewMenus. |
2221 | 1332 |
! |
1333 |
||
1334 |
showSingleTextView |
|
2507 | 1335 |
" |
1336 |
if a method is selected which is only in version A or B of the class, |
|
1337 |
then show the text view. |
|
1338 |
Add an accept entry to the popup menu. |
|
1339 |
||
1340 |
<return: self> |
|
1341 |
" |
|
1342 |
||
2694 | 1343 |
|builder| |
1344 |
||
1345 |
builder := self builder. |
|
1346 |
(builder componentAt:#singleTextView) raise; beVisible. |
|
1347 |
(builder componentAt:#diffTextViewBox) beInvisible. |
|
2501 | 1348 |
self addAcceptToTextViewMenus. |
2221 | 1349 |
! |
1350 |
||
2497 | 1351 |
updateLabels |
2507 | 1352 |
" |
1353 |
update the labels of the diff text view. Show the version numbers |
|
1354 |
of the class. |
|
2221 | 1355 |
|
2507 | 1356 |
<return: self> |
1357 |
" |
|
2221 | 1358 |
|
2694 | 1359 |
|theVersionA theVersionB builder| |
2224 | 1360 |
|
2694 | 1361 |
builder := self builder. |
2497 | 1362 |
(theVersionA := self versionA) notNil ifTrue:[ |
1363 |
self diffTextLabelA value:theVersionA. |
|
2726 | 1364 |
self onlyInALabelHolder value:('Only in ' , theVersionA). |
2694 | 1365 |
(builder componentAt:#OnlyInALabel) backgroundColor:Color green darkened. |
2224 | 1366 |
]. |
2497 | 1367 |
(theVersionB :=self versionB) notNil ifTrue:[ |
1368 |
self diffTextLabelB value:theVersionB. |
|
2726 | 1369 |
self onlyInBLabelHolder value:('Only in ' , theVersionB). |
2694 | 1370 |
(builder componentAt:#OnlyInBLabel) backgroundColor:Color red darkened. |
2224 | 1371 |
]. |
1372 |
! |
|
1373 |
||
1374 |
updateLists |
|
2507 | 1375 |
"walk over the two changeSets and add change to one of the tree lists. |
1376 |
Methods which belong to the version A of the class or version B go |
|
1377 |
to the list methodsOnlyInA or methodsOnlyInB. |
|
1378 |
Methods which are changed from version A to B go to the list methodsChanged. |
|
1379 |
||
1380 |
<return: self> |
|
1381 |
" |
|
2731 | 1382 |
|classChangeSet listOnlyInA listOnlyInB listChanged| |
2230
5e10eebb1de2
move change-compare code to where it belongs (Change-hierarchy)
Claus Gittinger <cg@exept.de>
parents:
2229
diff
changeset
|
1383 |
|
2585 | 1384 |
classChangeSet := self classChangeSet. |
1385 |
||
2731 | 1386 |
listOnlyInA := self methodsOnlyInA. |
1387 |
listOnlyInA removeAll. |
|
1388 |
classChangeSet notNil ifTrue:[ |
|
1389 |
listOnlyInA addAll: (classChangeSet methodsOnlyInA collect:self generator). |
|
1390 |
]. |
|
2585 | 1391 |
|
2731 | 1392 |
listOnlyInB := self methodsOnlyInB. |
1393 |
listOnlyInB removeAll. |
|
1394 |
classChangeSet notNil ifTrue:[ |
|
1395 |
listOnlyInB addAll: (classChangeSet methodsOnlyInB collect:self generator). |
|
1396 |
]. |
|
2221 | 1397 |
|
2731 | 1398 |
listChanged := self methodsChanged. |
1399 |
listChanged removeAll. |
|
1400 |
classChangeSet notNil ifTrue:[ |
|
1401 |
listChanged addAll: (classChangeSet methodsChanged collect:[:arr| self generator value:(arr first)]). |
|
1402 |
]. |
|
2221 | 1403 |
|
2731 | 1404 |
self boxAVisible value:(listOnlyInA notEmpty). |
1405 |
self boxBVisible value:(listOnlyInB notEmpty). |
|
2221 | 1406 |
|
2731 | 1407 |
self boxMVisible value:(listChanged isEmpty |
1408 |
and: [(listOnlyInA notEmpty |
|
1409 |
or:[listOnlyInB notEmpty])]) not. |
|
2221 | 1410 |
! ! |
1411 |
||
2501 | 1412 |
!VersionDiffBrowser methodsFor:'setup'! |
1413 |
||
2695 | 1414 |
setupForClass:aClass againstVersion:aVersionA |
1415 |
" |
|
1416 |
compute the class change set for the class aClass of its current version against the repository version A. |
|
1417 |
When setting the class change set, the labels, list etc. of the receiver |
|
1418 |
are updated. |
|
1419 |
||
1420 |
<return: self> |
|
1421 |
" |
|
2731 | 1422 |
|changeSet| |
1423 |
||
2745 | 1424 |
aClass isNil ifTrue:[ |
1425 |
changeSet := nil |
|
1426 |
] ifFalse:[ |
|
1427 |
aClass isNameSpace ifFalse:[ |
|
1428 |
aClass isLoaded ifTrue:[ |
|
1429 |
changeSet := (ClassChangeSet newForClass:aClass againstVersion:aVersionA). |
|
1430 |
] |
|
1431 |
]. |
|
2731 | 1432 |
]. |
1433 |
self classChangeSet:changeSet |
|
2695 | 1434 |
! |
1435 |
||
2510 | 1436 |
setupForClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB |
1437 |
" |
|
1438 |
generate the class change set from the two source files A and B. |
|
1439 |
When setting the class change set, the labels, list etc. of the receiver |
|
1440 |
are updated. |
|
1441 |
||
1442 |
<return: self> |
|
1443 |
" |
|
2731 | 1444 |
|changeSet| |
1445 |
||
2751
f2fbe11e166a
oops - isNameSpace query prevented Smalltalk-diffs from beeing shown
Claus Gittinger <cg@exept.de>
parents:
2745
diff
changeset
|
1446 |
(aClass isNameSpace not or:[aClass == Smalltalk]) ifTrue:[ |
2731 | 1447 |
aClass isLoaded ifTrue:[ |
1448 |
changeSet := (ClassChangeSet newForClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB). |
|
1449 |
] |
|
1450 |
]. |
|
1451 |
self classChangeSet:changeSet |
|
2510 | 1452 |
! |
1453 |
||
2501 | 1454 |
setupForClass:aClass versionA:aVersionA versionB:aVersionB |
2507 | 1455 |
" |
1456 |
compute the class change set for the class aClass and the versions A and B. |
|
1457 |
When setting the class change set, the labels, list etc. of the receiver |
|
1458 |
are updated. |
|
2501 | 1459 |
|
2507 | 1460 |
<return: self> |
1461 |
" |
|
2731 | 1462 |
|changeSet| |
1463 |
||
1464 |
aClass isNameSpace ifFalse:[ |
|
1465 |
aClass isLoaded ifTrue:[ |
|
1466 |
changeSet := (ClassChangeSet newForClass:aClass versionA:aVersionA versionB:aVersionB). |
|
1467 |
] |
|
1468 |
]. |
|
1469 |
self classChangeSet:changeSet |
|
2501 | 1470 |
! ! |
1471 |
||
2497 | 1472 |
!VersionDiffBrowser::ClassChangeSet class methodsFor:'instance creation'! |
1473 |
||
2695 | 1474 |
changeSetForClass:aClass |
1475 |
"return a ChangeSet for the class aClass and its current source. |
|
1476 |
The source is generated into a stream and then the change set is generated |
|
1477 |
from the source stream. |
|
1478 |
||
1479 |
<return: ChangeSet|nil> |
|
1480 |
" |
|
1481 |
|theChangeSet source s| |
|
1482 |
||
1483 |
s := '' writeStream. |
|
1484 |
aClass fileOutOn:s. |
|
1485 |
source := s contents. |
|
1486 |
||
1487 |
theChangeSet := ChangeSet fromStream:(source readStream). |
|
1488 |
^theChangeSet |
|
1489 |
! |
|
1490 |
||
2497 | 1491 |
changeSetForClass:aClass andRevision:aVersion |
1492 |
"return a ChangeSet for the class aClass and version aVersion. |
|
1493 |
The version from the class source stream is checked out from the repositiory |
|
1494 |
into a source stream. Then the change set is generated from the source stream. |
|
1495 |
||
1496 |
<return: ChangeSet|nil> |
|
1497 |
" |
|
1498 |
|theSourceCodeManager theSourceStream theChangeSet| |
|
1499 |
||
1500 |
theSourceCodeManager := aClass sourceCodeManager. |
|
1501 |
[theSourceStream := theSourceCodeManager getSourceStreamFor:aClass revision:aVersion. |
|
1502 |
theSourceStream notNil |
|
1503 |
ifTrue:[theChangeSet:=ChangeSet fromStream:theSourceStream]] |
|
1504 |
valueNowOrOnUnwindDo: |
|
1505 |
[theSourceStream notNil ifTrue:[theSourceStream close]]. |
|
1506 |
^theChangeSet |
|
1507 |
! |
|
1508 |
||
1509 |
changeSetForClass:aClass andSource:aSource |
|
1510 |
"return a ChangeSet for the class aClass and source aSource. |
|
1511 |
The source is converted to a stream and then the change set is generated |
|
1512 |
from the source stream. |
|
1513 |
||
1514 |
<return: ChangeSet|nil> |
|
1515 |
" |
|
1516 |
|theChangeSet theSourceStream| |
|
1517 |
||
1518 |
[(theSourceStream := aSource readStream) notNil |
|
1519 |
ifTrue:[theChangeSet:=ChangeSet fromStream:(theSourceStream := aSource readStream)]] |
|
1520 |
valueNowOrOnUnwindDo: |
|
1521 |
[theSourceStream notNil |
|
1522 |
ifTrue:[theSourceStream close]]. |
|
1523 |
^theChangeSet |
|
1524 |
! |
|
1525 |
||
2695 | 1526 |
newForClass:aClass againstVersion:aVersionA |
1527 |
"return a ClassChangeSet for the class aClass against some verison in the repository. |
|
1528 |
A new instance of ClassChangeSet is generated containing |
|
1529 |
the correspondenting changes. |
|
1530 |
||
1531 |
<return: ClassChangeSet> |
|
1532 |
" |
|
2710
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1533 |
|theChangeSetA theChangeSetB theClassChangeSet versionCompared diffSet| |
2695 | 1534 |
|
1535 |
theClassChangeSet := self new. |
|
1536 |
theClassChangeSet classBeingCompared:aClass. |
|
1537 |
versionCompared := aVersionA. |
|
1538 |
aVersionA isNil ifTrue:[ |
|
1539 |
theClassChangeSet labelA:(versionCompared := aClass revision). |
|
1540 |
] ifFalse:[ |
|
1541 |
aVersionA == #newest ifTrue:[ |
|
1542 |
theClassChangeSet labelA:'newest'. |
|
1543 |
] ifFalse:[ |
|
1544 |
theClassChangeSet labelA:versionCompared. |
|
1545 |
] |
|
1546 |
]. |
|
1547 |
theClassChangeSet labelB:'current'. |
|
1548 |
theChangeSetA := self changeSetForClass: aClass andRevision: versionCompared. |
|
1549 |
theChangeSetB := self changeSetForClass: aClass. |
|
1550 |
theChangeSetA isNil |
|
1551 |
ifTrue: [theChangeSetA := ChangeSet new]. |
|
1552 |
theChangeSetB isNil |
|
1553 |
ifTrue: [theChangeSetB := ChangeSet new]. |
|
2710
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1554 |
"/ if we are comparing a private class, prune out other changes |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1555 |
aClass isPrivate ifTrue:[ |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1556 |
theChangeSetA removeAllSuchThat:[:aChange | |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1557 |
aChange className ~= aClass name |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1558 |
]. |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1559 |
theChangeSetB removeAllSuchThat:[:aChange | |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1560 |
aChange className ~= aClass name |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1561 |
]. |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1562 |
]. |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1563 |
self activityNotification:'generating diff-set...'. |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1564 |
diffSet := theClassChangeSet diffSet:(theChangeSetA diffSetsAgainst:theChangeSetB). |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1565 |
self activityNotification:nil. |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1566 |
^ diffSet |
2695 | 1567 |
! |
1568 |
||
2497 | 1569 |
newForClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB |
1570 |
"return a ClassChangeSet for the class aClass and the two sources. |
|
1571 |
The two classes are compared via the source files. A new instance of |
|
1572 |
ClassChangeSet is generated containing the correspondenting changes. |
|
1573 |
||
1574 |
<return: ClassChangeSet> |
|
1575 |
" |
|
1576 |
|theChangeSetA theChangeSetB theClassChangeSet| |
|
1577 |
||
1578 |
theClassChangeSet := self new. |
|
1579 |
theClassChangeSet classBeingCompared:aClass. |
|
1580 |
theClassChangeSet labelA:aLabelA. |
|
1581 |
theClassChangeSet labelB:aLabelB. |
|
1582 |
theChangeSetA:=self changeSetForClass:aClass andSource:aSourceA. |
|
1583 |
theChangeSetB:=self changeSetForClass:aClass andSource:aSourceB. |
|
1584 |
theChangeSetA isNil |
|
1585 |
ifTrue: [theChangeSetA := ChangeSet new]. |
|
1586 |
theChangeSetB isNil |
|
1587 |
ifTrue: [theChangeSetB := ChangeSet new]. |
|
2695 | 1588 |
^theClassChangeSet diffSet:(theChangeSetA diffSetsAgainst:theChangeSetB) |
2465 | 1589 |
! |
1590 |
||
2497 | 1591 |
newForClass:aClass versionA:aVersionA versionB:aVersionB |
1592 |
"return a ClassChangeSet for the class aClass and the two versions. |
|
1593 |
The two class version are checked out from the repository and then being |
|
1594 |
compared. A new instance of ClassChangeSet is generated containing |
|
1595 |
the correspondenting changes. |
|
1596 |
||
1597 |
<return: ClassChangeSet> |
|
1598 |
" |
|
1599 |
|theChangeSetA theChangeSetB theClassChangeSet| |
|
1600 |
||
1601 |
theClassChangeSet := self new. |
|
1602 |
theClassChangeSet classBeingCompared:aClass. |
|
1603 |
theClassChangeSet labelA:aVersionA. |
|
1604 |
theClassChangeSet labelB:aVersionB. |
|
1605 |
theChangeSetA := self changeSetForClass: aClass andRevision: aVersionA. |
|
1606 |
theChangeSetB := self changeSetForClass: aClass andRevision: aVersionB. |
|
1607 |
theChangeSetA isNil |
|
1608 |
ifTrue: [theChangeSetA := ChangeSet new]. |
|
1609 |
theChangeSetB isNil |
|
1610 |
ifTrue: [theChangeSetB := ChangeSet new]. |
|
2695 | 1611 |
^theClassChangeSet diffSet:(theChangeSetA diffSetsAgainst:theChangeSetB) |
2497 | 1612 |
|
1613 |
! ! |
|
1614 |
||
1615 |
!VersionDiffBrowser::ClassChangeSet methodsFor:'accessing'! |
|
1616 |
||
1617 |
classBeingCompared |
|
1618 |
"returns the value of the class which is compared |
|
1619 |
||
1620 |
<return: Behavior> |
|
1621 |
" |
|
1622 |
||
1623 |
^ classBeingCompared |
|
1624 |
! |
|
2221 | 1625 |
|
2497 | 1626 |
classBeingCompared:something |
1627 |
"set the value of the class which is compared |
|
1628 |
||
1629 |
<return: self>" |
|
1630 |
||
1631 |
classBeingCompared := something. |
|
1632 |
! |
|
1633 |
||
2695 | 1634 |
diffSet |
1635 |
"returns a identity dictionary containing the different changes. |
|
1636 |
key: value: |
|
1637 |
#changed OrderedCollection of arrays containing ChangeSets for methods |
|
1638 |
which are changed and exists in the class versionA and versionB |
|
1639 |
#onlyInArg ChangeSet for the methods which exists only in the class versionB |
|
1640 |
#onlyInReceiver ChangeSet for the methods which exists only in the class versionA |
|
1641 |
||
1642 |
<return: IdentityDictionary> |
|
1643 |
" |
|
1644 |
^ diffSet |
|
1645 |
! |
|
1646 |
||
1647 |
diffSet:something |
|
1648 |
"sets a identity dictionary containing the different changes. |
|
1649 |
key: value: |
|
1650 |
#changed OrderedCollection of arrays containing ChangeSets for methods |
|
1651 |
which are changed and exists in the class versionA and versionB |
|
1652 |
#onlyInArg ChangeSet for the methods which exists only in the class versionB |
|
1653 |
#onlyInReceiver ChangeSet for the methods which exists only in the class versionA |
|
1654 |
||
1655 |
<return: self> |
|
1656 |
" |
|
1657 |
||
1658 |
diffSet := something. |
|
1659 |
! |
|
1660 |
||
2497 | 1661 |
labelA |
1662 |
"returns the label for the class versionA |
|
1663 |
||
1664 |
<return: String> |
|
1665 |
" |
|
1666 |
^ labelA |
|
1667 |
! |
|
1668 |
||
1669 |
labelA:something |
|
1670 |
"sets the label for the class versionA |
|
1671 |
||
1672 |
<return: self> |
|
1673 |
" |
|
1674 |
labelA := something. |
|
1675 |
! |
|
1676 |
||
1677 |
labelB |
|
1678 |
"returns the label for the class versionB |
|
1679 |
||
1680 |
<return: String> |
|
1681 |
" |
|
1682 |
^ labelB |
|
1683 |
! |
|
2465 | 1684 |
|
2497 | 1685 |
labelB:something |
1686 |
"sets the label for the class versionB |
|
1687 |
||
1688 |
<return: self> |
|
1689 |
" |
|
1690 |
||
1691 |
labelB := something. |
|
1692 |
! |
|
1693 |
||
1694 |
methodsChanged |
|
1695 |
"returns a OrderedCollection of arrays containing ChangeSets for methods |
|
1696 |
which are changed and exists in the class versionA and versionB |
|
1697 |
||
1698 |
<return: OrderedCollection> |
|
1699 |
" |
|
2695 | 1700 |
^ self diffSet at:#changed |
2497 | 1701 |
! |
1702 |
||
1703 |
methodsOnlyInA |
|
1704 |
"returns a ChangeSet for the methods which exists only in the class versionA |
|
1705 |
||
1706 |
<return: ChangeSet> |
|
1707 |
" |
|
1708 |
||
2695 | 1709 |
^ self diffSet at:#onlyInReceiver |
2497 | 1710 |
! |
1711 |
||
1712 |
methodsOnlyInB |
|
1713 |
"returns a ChangeSet for the methods which exists only in the class versionB |
|
1714 |
||
1715 |
<return: ChangeSet> |
|
1716 |
" |
|
1717 |
||
2695 | 1718 |
^ self diffSet at:#onlyInArg |
2221 | 1719 |
! ! |
1720 |
||
1721 |
!VersionDiffBrowser class methodsFor:'documentation'! |
|
1722 |
||
1723 |
version |
|
2751
f2fbe11e166a
oops - isNameSpace query prevented Smalltalk-diffs from beeing shown
Claus Gittinger <cg@exept.de>
parents:
2745
diff
changeset
|
1724 |
^ '$Header: /cvs/stx/stx/libtool/VersionDiffBrowser.st,v 1.34 2000-09-03 14:38:52 cg Exp $' |
2221 | 1725 |
! ! |