author | Claus Gittinger <cg@exept.de> |
Tue, 22 Aug 2000 00:45:50 +0200 | |
changeset 2725 | e2dc264e8c9c |
parent 2716 | 8451e7057f00 |
child 2726 | ecf8db9dbbb1 |
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 |
2497 | 17 |
instanceVariableNames:'classChangeSet diffTextView' |
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 |
|
2714 | 124 |
#label: 'Only in A (i.e. removed)' |
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 |
|
2714 | 184 |
#label: 'Only in B (i.e. added)' |
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 |
" |
|
647 |
|sel changeA changeB| |
|
648 |
||
649 |
sel := self methodsChangedSelection value. |
|
650 |
sel notNil ifTrue:[ |
|
651 |
changeA := (self classChangeSet methodsChanged at:sel) first. |
|
652 |
changeB := (self classChangeSet methodsChanged at:sel) second. |
|
653 |
^ Array with:changeA |
|
654 |
with:changeB |
|
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 |
" |
|
2497 | 665 |
^ self classChangeSet labelA |
2221 | 666 |
|
667 |
! |
|
668 |
||
669 |
versionB |
|
2507 | 670 |
" |
671 |
gets the second class version to be compared |
|
2221 | 672 |
|
2507 | 673 |
<return: String> |
674 |
" |
|
2497 | 675 |
^ self classChangeSet labelB |
2221 | 676 |
|
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 |
750 |
|holder| |
|
751 |
||
752 |
(holder := builder bindingAt:#boxAVisible) isNil ifTrue:[ |
|
753 |
builder aspectAt:#boxAVisible put:(holder := true asValue). |
|
754 |
]. |
|
755 |
^ holder. |
|
756 |
! |
|
757 |
||
758 |
boxBVisible |
|
759 |
|holder| |
|
760 |
||
761 |
(holder := builder bindingAt:#boxBVisible) isNil ifTrue:[ |
|
762 |
builder aspectAt:#boxBVisible put:(holder := true asValue). |
|
763 |
]. |
|
764 |
^ holder. |
|
765 |
! |
|
766 |
||
767 |
boxMVisible |
|
768 |
|holder| |
|
769 |
||
770 |
(holder := builder bindingAt:#boxMVisible) isNil ifTrue:[ |
|
771 |
builder aspectAt:#boxMVisible put:(holder := true asValue). |
|
772 |
]. |
|
773 |
^ holder. |
|
774 |
! |
|
775 |
||
2221 | 776 |
changedLabelHolder |
2507 | 777 |
" |
778 |
aspect for the label of the changed method box. |
|
2221 | 779 |
|
2507 | 780 |
<return: ValueHolder on: nil> |
781 |
" |
|
2221 | 782 |
|holder| |
783 |
||
784 |
(holder := builder bindingAt:#changedLabelHolder) isNil ifTrue:[ |
|
785 |
builder aspectAt:#changedLabelHolder put:(holder := ValueHolder new). |
|
786 |
]. |
|
787 |
^ holder. |
|
788 |
! |
|
789 |
||
790 |
diffTextLabelA |
|
2507 | 791 |
" |
792 |
aspect for the label for version A. |
|
2221 | 793 |
|
2507 | 794 |
<return: ValueHolder on: nil> |
795 |
" |
|
2221 | 796 |
|
797 |
|holder| |
|
798 |
||
799 |
(holder := builder bindingAt:#diffTextLabelA) isNil ifTrue:[ |
|
800 |
builder aspectAt:#diffTextLabelA put:(holder := ValueHolder new). |
|
801 |
]. |
|
802 |
^ holder. |
|
803 |
! |
|
804 |
||
805 |
diffTextLabelB |
|
2507 | 806 |
" |
807 |
aspect for the label for version B. |
|
2221 | 808 |
|
2507 | 809 |
<return: ValueHolder on: nil> |
810 |
" |
|
2221 | 811 |
|
812 |
|holder| |
|
813 |
||
814 |
(holder := builder bindingAt:#diffTextLabelB) isNil ifTrue:[ |
|
815 |
builder aspectAt:#diffTextLabelB put:(holder := ValueHolder new). |
|
816 |
]. |
|
817 |
^ holder. |
|
818 |
! |
|
819 |
||
2497 | 820 |
diffTextView |
2507 | 821 |
" |
822 |
return the component for the diff text view. |
|
2497 | 823 |
|
2507 | 824 |
<return: HVScrollableView> |
825 |
" |
|
2497 | 826 |
diffTextView isNil ifTrue:[ |
827 |
diffTextView := HVScrollableView |
|
828 |
for:DiffTextView |
|
829 |
miniScrollerH:true miniScrollerV:false. |
|
830 |
diffTextView addNextPreviousButtons. |
|
831 |
]. |
|
832 |
^ diffTextView |
|
833 |
! |
|
834 |
||
2221 | 835 |
methodText |
2507 | 836 |
" |
837 |
aspect for the text in the method text view. |
|
2221 | 838 |
|
2507 | 839 |
<return: ValueHolder on: nil> |
840 |
" |
|
2221 | 841 |
|holder| |
842 |
||
843 |
(holder := builder bindingAt:#methodText) isNil ifTrue:[ |
|
844 |
builder aspectAt:#methodText put:(holder := ValueHolder new). |
|
845 |
]. |
|
846 |
^ holder. |
|
847 |
! |
|
848 |
||
849 |
methodsChanged |
|
2507 | 850 |
" |
851 |
aspect for the 'changed method' list. |
|
2221 | 852 |
|
2507 | 853 |
<return: List> |
854 |
" |
|
2221 | 855 |
|
856 |
|holder| |
|
857 |
||
858 |
(holder := builder bindingAt:#methodsChanged) isNil ifTrue:[ |
|
859 |
builder aspectAt:#methodsChanged put:(holder := List new). |
|
860 |
]. |
|
861 |
^ holder. |
|
862 |
! |
|
863 |
||
864 |
methodsChangedSelection |
|
2507 | 865 |
" |
866 |
aspect for the selection holder of 'changed method'-list. |
|
2221 | 867 |
|
2507 | 868 |
<return: ValueHolder on: nil> |
869 |
" |
|
2221 | 870 |
|
871 |
|holder| |
|
872 |
||
873 |
(holder := builder bindingAt:#methodsChangedSelection) isNil ifTrue:[ |
|
874 |
builder aspectAt:#methodsChangedSelection put:(holder := ValueHolder new). |
|
875 |
]. |
|
876 |
^ holder. |
|
877 |
! |
|
878 |
||
879 |
methodsOnlyInA |
|
2507 | 880 |
" |
881 |
aspect for the 'method only in version A' list. |
|
2221 | 882 |
|
2507 | 883 |
<return: List> |
884 |
" |
|
2221 | 885 |
|
886 |
|holder| |
|
887 |
||
888 |
(holder := builder bindingAt:#methodsOnlyInA) isNil ifTrue:[ |
|
889 |
builder aspectAt:#methodsOnlyInA put:(holder := List new). |
|
890 |
]. |
|
891 |
^ holder. |
|
892 |
! |
|
893 |
||
894 |
methodsOnlyInASelection |
|
2507 | 895 |
" |
896 |
aspect for the selection holder of 'method only in version A'-list. |
|
2221 | 897 |
|
2507 | 898 |
<return: ValueHolder on: nil> |
899 |
" |
|
2221 | 900 |
|
901 |
|holder| |
|
902 |
||
903 |
(holder := builder bindingAt:#methodsOnlyInASelection) isNil ifTrue:[ |
|
904 |
builder aspectAt:#methodsOnlyInASelection put:(holder := ValueHolder new). |
|
905 |
]. |
|
906 |
^ holder. |
|
907 |
! |
|
908 |
||
909 |
methodsOnlyInB |
|
2507 | 910 |
" |
911 |
aspect for the 'method only in version B' list. |
|
2221 | 912 |
|
2507 | 913 |
<return: List> |
914 |
" |
|
2221 | 915 |
|
916 |
|holder| |
|
917 |
||
918 |
(holder := builder bindingAt:#methodsOnlyInB) isNil ifTrue:[ |
|
919 |
builder aspectAt:#methodsOnlyInB put:(holder := List new). |
|
920 |
]. |
|
921 |
^ holder. |
|
922 |
! |
|
923 |
||
924 |
methodsOnlyInBSelection |
|
2507 | 925 |
" |
926 |
aspect for the selection holder of 'method only in version B'-list. |
|
2221 | 927 |
|
2507 | 928 |
<return: ValueHolder on: nil> |
929 |
" |
|
2221 | 930 |
|
931 |
|holder| |
|
932 |
||
933 |
(holder := builder bindingAt:#methodsOnlyInBSelection) isNil ifTrue:[ |
|
934 |
builder aspectAt:#methodsOnlyInBSelection put:(holder := ValueHolder new). |
|
935 |
]. |
|
936 |
^ holder. |
|
937 |
! |
|
938 |
||
939 |
onlyInALabelHolder |
|
2507 | 940 |
" |
941 |
aspect for the label for 'method only in version A'. |
|
2221 | 942 |
|
2507 | 943 |
<return: ValueHolder on: nil> |
944 |
" |
|
2221 | 945 |
|
946 |
|holder| |
|
947 |
||
948 |
(holder := builder bindingAt:#onlyInALabelHolder) isNil ifTrue:[ |
|
949 |
builder aspectAt:#onlyInALabelHolder put:(holder := ValueHolder new). |
|
950 |
]. |
|
951 |
^ holder. |
|
952 |
! |
|
953 |
||
954 |
onlyInBLabelHolder |
|
2507 | 955 |
" |
956 |
aspect for the label for 'method only in version B'. |
|
2221 | 957 |
|
2507 | 958 |
<return: ValueHolder on: nil> |
959 |
" |
|
2221 | 960 |
|
961 |
|holder| |
|
962 |
||
963 |
(holder := builder bindingAt:#onlyInBLabelHolder) isNil ifTrue:[ |
|
964 |
builder aspectAt:#onlyInBLabelHolder put:(holder := ValueHolder new). |
|
965 |
]. |
|
966 |
^ holder. |
|
967 |
! ! |
|
968 |
||
2725 | 969 |
!VersionDiffBrowser methodsFor:'aspects-exported'! |
2695 | 970 |
|
971 |
changedLabelHolder:aValueHolder |
|
972 |
builder aspectAt:#changedLabelHolder put:aValueHolder. |
|
973 |
||
974 |
! |
|
975 |
||
976 |
classHolder:aValueHolder |
|
977 |
|holder| |
|
978 |
||
979 |
(holder := builder bindingAt:#classHolder) notNil ifTrue:[ |
|
980 |
holder removeDependent:self |
|
981 |
]. |
|
982 |
builder aspectAt:#classHolder put:aValueHolder. |
|
983 |
aValueHolder notNil ifTrue:[ |
|
984 |
aValueHolder addDependent:self |
|
985 |
] |
|
986 |
! |
|
987 |
||
988 |
onlyInALabelHolder:aValueHolder |
|
989 |
builder aspectAt:#onlyInALabelHolder put:aValueHolder. |
|
990 |
! |
|
991 |
||
992 |
onlyInBLabelHolder:aValueHolder |
|
993 |
builder aspectAt:#onlyInBLabelHolder put:aValueHolder. |
|
994 |
! |
|
995 |
||
996 |
versionAHolder:aValueHolder |
|
997 |
|holder| |
|
998 |
||
999 |
(holder := builder bindingAt:#versionAHolder) notNil ifTrue:[ |
|
1000 |
holder removeDependent:self |
|
1001 |
]. |
|
1002 |
builder aspectAt:#versionAHolder put:aValueHolder. |
|
1003 |
aValueHolder notNil ifTrue:[ |
|
1004 |
aValueHolder addDependent:self |
|
1005 |
] |
|
1006 |
! |
|
1007 |
||
1008 |
versionBHolder:aValueHolder |
|
1009 |
|holder| |
|
1010 |
||
1011 |
(holder := builder bindingAt:#versionBHolder) notNil ifTrue:[ |
|
1012 |
holder removeDependent:self |
|
1013 |
]. |
|
1014 |
builder aspectAt:#versionBHolder put:aValueHolder. |
|
1015 |
aValueHolder notNil ifTrue:[ |
|
1016 |
aValueHolder addDependent:self |
|
1017 |
] |
|
1018 |
! ! |
|
1019 |
||
1020 |
!VersionDiffBrowser methodsFor:'change & update'! |
|
1021 |
||
1022 |
update:something with:parameter from:changedObject |
|
1023 |
|classHolder versionAHolder versionBHolder| |
|
1024 |
||
1025 |
classHolder := self classHolder. |
|
1026 |
versionAHolder := self versionAHolder. |
|
1027 |
versionBHolder := self versionBHolder. |
|
1028 |
||
1029 |
(changedObject == classHolder |
|
1030 |
or:[changedObject == versionAHolder |
|
1031 |
or:[changedObject == versionBHolder]]) ifTrue:[ |
|
1032 |
self setupForClass:(classHolder value) versionA:(versionAHolder value) versionB:(versionBHolder value) |
|
1033 |
. ^ self |
|
1034 |
]. |
|
1035 |
super update:something with:parameter from:changedObject |
|
1036 |
! ! |
|
1037 |
||
2221 | 1038 |
!VersionDiffBrowser methodsFor:'initialization & release'! |
1039 |
||
1040 |
postBuildWith:aBuilder |
|
2507 | 1041 |
" |
1042 |
components which are invisible should be ignored by the panel. |
|
1043 |
Cannot be set via the interface builder. |
|
2221 | 1044 |
|
2507 | 1045 |
<return: self> |
1046 |
" |
|
2221 | 1047 |
(aBuilder componentAt:#TopHorizontalPanel) ignoreInvisibleComponents:true. |
1048 |
^ super postBuildWith:aBuilder |
|
1049 |
! ! |
|
1050 |
||
1051 |
!VersionDiffBrowser methodsFor:'menu action'! |
|
1052 |
||
2465 | 1053 |
browseChange:aChange |
2507 | 1054 |
" |
1055 |
browse the change in aChange |
|
1056 |
||
1057 |
<return: self> |
|
1058 |
" |
|
2650
447c99ac6f76
oops - inspect & browse menu was broken.
Claus Gittinger <cg@exept.de>
parents:
2626
diff
changeset
|
1059 |
|cls sel m| |
447c99ac6f76
oops - inspect & browse menu was broken.
Claus Gittinger <cg@exept.de>
parents:
2626
diff
changeset
|
1060 |
|
2578
29264fb3847e
avoid debugger in browse-menu
Claus Gittinger <cg@exept.de>
parents:
2536
diff
changeset
|
1061 |
aChange isNil ifTrue:[^ self]. |
2650
447c99ac6f76
oops - inspect & browse menu was broken.
Claus Gittinger <cg@exept.de>
parents:
2626
diff
changeset
|
1062 |
cls := aChange changeClass. |
447c99ac6f76
oops - inspect & browse menu was broken.
Claus Gittinger <cg@exept.de>
parents:
2626
diff
changeset
|
1063 |
sel := aChange changeSelector. |
447c99ac6f76
oops - inspect & browse menu was broken.
Claus Gittinger <cg@exept.de>
parents:
2626
diff
changeset
|
1064 |
(cls compiledMethodAt:sel) isNil ifTrue:[ |
447c99ac6f76
oops - inspect & browse menu was broken.
Claus Gittinger <cg@exept.de>
parents:
2626
diff
changeset
|
1065 |
self information:'Method does not exist.' |
447c99ac6f76
oops - inspect & browse menu was broken.
Claus Gittinger <cg@exept.de>
parents:
2626
diff
changeset
|
1066 |
]. |
447c99ac6f76
oops - inspect & browse menu was broken.
Claus Gittinger <cg@exept.de>
parents:
2626
diff
changeset
|
1067 |
|
2697
b4f4e431b71e
browserClass from preferences
Claus Gittinger <cg@exept.de>
parents:
2695
diff
changeset
|
1068 |
UserPreferences current systemBrowserClass openInClass:cls selector:sel. |
2465 | 1069 |
! |
1070 |
||
1071 |
browseClassInA |
|
2507 | 1072 |
" |
1073 |
browse the selected method. |
|
1074 |
||
1075 |
<return: self> |
|
1076 |
" |
|
2465 | 1077 |
self browseChange:(self selectedChangeInA). |
1078 |
! |
|
2221 | 1079 |
|
2465 | 1080 |
browseClassInB |
2507 | 1081 |
" |
1082 |
browse the selected method. |
|
1083 |
||
1084 |
<return: self> |
|
1085 |
" |
|
2465 | 1086 |
self browseChange:(self selectedChangeInB). |
1087 |
! |
|
1088 |
||
1089 |
browseClassInM |
|
2507 | 1090 |
" |
1091 |
browse the selected method. |
|
1092 |
||
1093 |
<return: self> |
|
1094 |
" |
|
2465 | 1095 |
self browseChange:(self selectedChangesInM first). |
1096 |
! |
|
1097 |
||
2469 | 1098 |
createPatchFile |
1099 |
"create a pacthFile, to patch the old version (versionB) into |
|
1100 |
the new version (versionA)" |
|
1101 |
||
1102 |
|oldVersion newVersion vsnMthdA vsnMthdB vsnA vsnB info| |
|
2507 | 1103 |
self halt. |
2497 | 1104 |
vsnMthdA := self changeSetA |
2469 | 1105 |
detect:[:ch | ch isMethodChange |
1106 |
and:[ch changeClass isMeta |
|
1107 |
and:[ch changeSelector = #version]]] |
|
1108 |
ifNone:nil. |
|
2497 | 1109 |
vsnMthdB := self changeSetA |
2469 | 1110 |
detect:[:ch | ch isMethodChange |
1111 |
and:[ch changeClass isMeta |
|
1112 |
and:[ch changeSelector = #version]]] |
|
1113 |
ifNone:nil. |
|
1114 |
||
1115 |
vsnMthdA notNil ifTrue:[ |
|
1116 |
"/ extract the version |
|
1117 |
vsnA := Class revisionStringFromSource:vsnMthdA source. |
|
1118 |
vsnA notNil ifTrue:[ |
|
1119 |
info := Class revisionInfoFromString:vsnA. |
|
1120 |
info notNil ifTrue:[ |
|
1121 |
vsnA := info at:#revision ifAbsent:nil. |
|
1122 |
] ifFalse:[ |
|
1123 |
vsnA := nil. |
|
1124 |
]. |
|
1125 |
]. |
|
1126 |
]. |
|
1127 |
vsnMthdB notNil ifTrue:[ |
|
1128 |
"/ extract the version |
|
1129 |
vsnB := Class revisionStringFromSource:vsnMthdB source. |
|
1130 |
vsnB notNil ifTrue:[ |
|
1131 |
info := Class revisionInfoFromString:vsnB. |
|
1132 |
info notNil ifTrue:[ |
|
1133 |
vsnB := info at:#revision ifAbsent:nil. |
|
1134 |
] ifFalse:[ |
|
1135 |
vsnB := nil. |
|
1136 |
]. |
|
1137 |
]. |
|
1138 |
]. |
|
1139 |
||
2507 | 1140 |
(vsnA isNil or:[vsnB isNil or:[vsnA = vsnB]]) ifTrue:[ |
2469 | 1141 |
self warn:'The generated patch file will not be able to validate/update the class version'. |
1142 |
]. |
|
1143 |
||
1144 |
self halt. |
|
1145 |
||
1146 |
! |
|
1147 |
||
2465 | 1148 |
inspectSelectedChangeInA |
2507 | 1149 |
" |
1150 |
inspect the selected method change for the 'method only in version A'. |
|
1151 |
||
1152 |
<return: self> |
|
1153 |
" |
|
2465 | 1154 |
self selectedChangeInA inspect. |
2221 | 1155 |
! |
1156 |
||
1157 |
inspectSelectedChangeInB |
|
2507 | 1158 |
" |
1159 |
inspect the selected method change for the 'method only in version B'. |
|
1160 |
||
1161 |
<return: self> |
|
1162 |
" |
|
2465 | 1163 |
self selectedChangeInB inspect. |
1164 |
! |
|
1165 |
||
1166 |
inspectSelectedChangeInM |
|
2507 | 1167 |
" |
1168 |
inspect the two method changes for the selected 'changed method'. |
|
1169 |
||
1170 |
<return: self> |
|
1171 |
" |
|
2465 | 1172 |
|changes| |
1173 |
||
1174 |
changes := self selectedChangesInM. |
|
1175 |
changes do:[:change | |
|
1176 |
change inspect |
|
1177 |
]. |
|
1178 |
! |
|
1179 |
||
2501 | 1180 |
mainMenu |
2507 | 1181 |
" |
1182 |
if this application runs as an subapplication, |
|
1183 |
the menu bar should not be used. |
|
1184 |
||
1185 |
<return: self> |
|
1186 |
" |
|
2501 | 1187 |
self masterApplication isNil ifTrue:[ |
1188 |
^ self class mainMenu |
|
1189 |
]. |
|
1190 |
^ nil |
|
2221 | 1191 |
! ! |
1192 |
||
1193 |
!VersionDiffBrowser methodsFor:'private'! |
|
1194 |
||
2497 | 1195 |
generator |
2507 | 1196 |
" |
1197 |
generate a print string for a change. |
|
2497 | 1198 |
|
2507 | 1199 |
<return: Block> |
1200 |
" |
|
1201 |
^[:aChange | |
|
2585 | 1202 |
|result mPkg cPkg cls m changeClassName| |
1203 |
||
2507 | 1204 |
aChange isClassDefinitionChange ifTrue:[ |
2585 | 1205 |
result := aChange printStringWithoutClassName |
2497 | 1206 |
] ifFalse:[ |
2507 | 1207 |
aChange isDoIt ifTrue:[ |
1208 |
result := aChange source , ' (doIt)' |
|
2497 | 1209 |
] ifFalse:[ |
2585 | 1210 |
changeClassName := aChange className. |
1211 |
changeClassName = self classBeingCompared name ifTrue:[ |
|
1212 |
result := aChange printStringWithoutClassName. |
|
2507 | 1213 |
aChange isMethodChange ifTrue:[ |
1214 |
cls := aChange changeClass. |
|
2497 | 1215 |
cls notNil ifTrue:[ |
2507 | 1216 |
m := cls compiledMethodAt:aChange selector. |
2497 | 1217 |
(m notNil |
1218 |
and:[m package ~= cls package]) ifTrue:[ |
|
2585 | 1219 |
result := aChange printStringWithoutClassName , ' [' , m package , ']'. |
2497 | 1220 |
]. |
1221 |
]. |
|
1222 |
] |
|
1223 |
] ifFalse:[ |
|
1224 |
"/ include name in private class changes |
|
2585 | 1225 |
(changeClassName startsWith:(self classBeingCompared name , '::')) ifTrue:[ |
1226 |
result := (changeClassName copyFrom:(self classBeingCompared name size + 3)) , ' ' , aChange printStringWithoutClassName |
|
2497 | 1227 |
] ifFalse:[ |
2507 | 1228 |
result := aChange printString |
2497 | 1229 |
] |
1230 |
] |
|
1231 |
] |
|
1232 |
]. |
|
1233 |
result |
|
1234 |
]. |
|
1235 |
||
1236 |
! |
|
1237 |
||
2501 | 1238 |
resetSelectionHolders |
2507 | 1239 |
" |
1240 |
reset all selection holders when a new change set is given. |
|
1241 |
First set the selection to nil. |
|
1242 |
||
1243 |
<return: self> |
|
1244 |
" |
|
2501 | 1245 |
|
1246 |
self methodsChangedSelection value:nil. |
|
1247 |
self methodsOnlyInASelection value:nil. |
|
1248 |
self methodsOnlyInBSelection value:nil. |
|
2507 | 1249 |
self diffTextView text1:'' text2:''. |
1250 |
self methodText value:''. |
|
1251 |
||
1252 |
"/ self methodsChangedSelectionChanged. |
|
1253 |
"/ self methodsOnlyInASelectionChanged. |
|
1254 |
"/ self methodsOnlyInBSelectionChanged. |
|
2501 | 1255 |
|
1256 |
! |
|
1257 |
||
2221 | 1258 |
showDiffTextView |
2507 | 1259 |
" |
1260 |
if a method change is selected, then show the diff text view. |
|
1261 |
Add an accept entry to the popup menu. |
|
1262 |
||
1263 |
<return: self> |
|
1264 |
" |
|
2694 | 1265 |
|builder| |
1266 |
||
1267 |
builder := self builder. |
|
1268 |
(builder componentAt:#diffTextViewBox) raise; beVisible. |
|
1269 |
(builder componentAt:#singleTextView) beInvisible. |
|
1270 |
(builder componentAt:#diffTextView) realizeAllSubViews. |
|
1271 |
||
2465 | 1272 |
self addAcceptToTextViewMenus. |
2221 | 1273 |
! |
1274 |
||
1275 |
showSingleTextView |
|
2507 | 1276 |
" |
1277 |
if a method is selected which is only in version A or B of the class, |
|
1278 |
then show the text view. |
|
1279 |
Add an accept entry to the popup menu. |
|
1280 |
||
1281 |
<return: self> |
|
1282 |
" |
|
1283 |
||
2694 | 1284 |
|builder| |
1285 |
||
1286 |
builder := self builder. |
|
1287 |
(builder componentAt:#singleTextView) raise; beVisible. |
|
1288 |
(builder componentAt:#diffTextViewBox) beInvisible. |
|
2501 | 1289 |
self addAcceptToTextViewMenus. |
2221 | 1290 |
! |
1291 |
||
2497 | 1292 |
updateLabels |
2507 | 1293 |
" |
1294 |
update the labels of the diff text view. Show the version numbers |
|
1295 |
of the class. |
|
2221 | 1296 |
|
2507 | 1297 |
<return: self> |
1298 |
" |
|
2221 | 1299 |
|
2694 | 1300 |
|theVersionA theVersionB builder| |
2224 | 1301 |
|
2694 | 1302 |
builder := self builder. |
2497 | 1303 |
(theVersionA := self versionA) notNil ifTrue:[ |
1304 |
self diffTextLabelA value:theVersionA. |
|
2714 | 1305 |
self onlyInALabelHolder value:('Only in ' , theVersionA , ' (i.e. removed)'). |
2694 | 1306 |
(builder componentAt:#OnlyInALabel) backgroundColor:Color green darkened. |
2224 | 1307 |
]. |
2497 | 1308 |
(theVersionB :=self versionB) notNil ifTrue:[ |
1309 |
self diffTextLabelB value:theVersionB. |
|
2714 | 1310 |
self onlyInBLabelHolder value:('Only in ' , theVersionB , ' (i.e. added)'). |
2694 | 1311 |
(builder componentAt:#OnlyInBLabel) backgroundColor:Color red darkened. |
2224 | 1312 |
]. |
1313 |
! |
|
1314 |
||
1315 |
updateLists |
|
2507 | 1316 |
"walk over the two changeSets and add change to one of the tree lists. |
1317 |
Methods which belong to the version A of the class or version B go |
|
1318 |
to the list methodsOnlyInA or methodsOnlyInB. |
|
1319 |
Methods which are changed from version A to B go to the list methodsChanged. |
|
1320 |
||
1321 |
<return: self> |
|
1322 |
" |
|
2585 | 1323 |
|classChangeSet| |
2230
5e10eebb1de2
move change-compare code to where it belongs (Change-hierarchy)
Claus Gittinger <cg@exept.de>
parents:
2229
diff
changeset
|
1324 |
|
2585 | 1325 |
classChangeSet := self classChangeSet. |
1326 |
||
1327 |
self methodsOnlyInA |
|
1328 |
removeAll; addAll: (classChangeSet methodsOnlyInA collect:self generator). |
|
1329 |
||
1330 |
self methodsOnlyInB |
|
1331 |
removeAll; addAll: (classChangeSet methodsOnlyInB collect:self generator). |
|
2221 | 1332 |
|
2585 | 1333 |
self methodsChanged |
1334 |
removeAll; addAll: (classChangeSet methodsChanged collect:[:arr| self generator value:(arr first)]). |
|
2221 | 1335 |
|
2585 | 1336 |
self boxAVisible value:(self methodsOnlyInA notEmpty). |
1337 |
self boxBVisible value:(self methodsOnlyInB notEmpty). |
|
2221 | 1338 |
|
2585 | 1339 |
self boxMVisible value:(self methodsChanged isEmpty |
1340 |
and: [(self methodsOnlyInA notEmpty |
|
1341 |
or:[self methodsOnlyInB notEmpty])]) not. |
|
2221 | 1342 |
! ! |
1343 |
||
2501 | 1344 |
!VersionDiffBrowser methodsFor:'setup'! |
1345 |
||
2695 | 1346 |
setupForClass:aClass againstVersion:aVersionA |
1347 |
" |
|
1348 |
compute the class change set for the class aClass of its current version against the repository version A. |
|
1349 |
When setting the class change set, the labels, list etc. of the receiver |
|
1350 |
are updated. |
|
1351 |
||
1352 |
<return: self> |
|
1353 |
" |
|
1354 |
self classChangeSet:(ClassChangeSet newForClass:aClass againstVersion:aVersionA) |
|
1355 |
! |
|
1356 |
||
2510 | 1357 |
setupForClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB |
1358 |
" |
|
1359 |
generate the class change set from the two source files A and B. |
|
1360 |
When setting the class change set, the labels, list etc. of the receiver |
|
1361 |
are updated. |
|
1362 |
||
1363 |
<return: self> |
|
1364 |
" |
|
1365 |
self classChangeSet:(ClassChangeSet newForClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB) |
|
1366 |
! |
|
1367 |
||
2501 | 1368 |
setupForClass:aClass versionA:aVersionA versionB:aVersionB |
2507 | 1369 |
" |
1370 |
compute the class change set for the class aClass and the versions A and B. |
|
1371 |
When setting the class change set, the labels, list etc. of the receiver |
|
1372 |
are updated. |
|
2501 | 1373 |
|
2507 | 1374 |
<return: self> |
1375 |
" |
|
2501 | 1376 |
self classChangeSet:(ClassChangeSet newForClass:aClass versionA:aVersionA versionB:aVersionB) |
1377 |
! ! |
|
1378 |
||
2221 | 1379 |
!VersionDiffBrowser methodsFor:'values'! |
1380 |
||
2465 | 1381 |
addAcceptToTextViewMenus |
2507 | 1382 |
" |
1383 |
add to the standard diff text view or single text views menu an accept entry. |
|
2694 | 1384 |
The acceptAction will fetch the corresponding change and apply it |
1385 |
(not the shown text) |
|
2507 | 1386 |
|
1387 |
<return: self> |
|
1388 |
" |
|
1389 |
||
2694 | 1390 |
|m v diffTextView leftView rightView singleView| |
1391 |
||
1392 |
diffTextView := self diffTextView. |
|
1393 |
leftView := diffTextView leftTextView. |
|
1394 |
rightView := diffTextView rightTextView. |
|
1395 |
singleView := self builder componentAt:#singleTextView. |
|
2465 | 1396 |
|
1397 |
(Array |
|
2694 | 1398 |
with:leftView |
1399 |
with:rightView |
|
1400 |
with:singleView) |
|
2465 | 1401 |
do:[:v | |
1402 |
m := v editMenu. |
|
2536 | 1403 |
(m selectorAt:#accept) isNil ifTrue:[ |
1404 |
m addLabels:#('-' 'accept') |
|
1405 |
selectors:(Array with:nil with:#accept) |
|
1406 |
after:#copySelection. |
|
1407 |
]. |
|
2465 | 1408 |
m |
1409 |
actionAt:#accept |
|
2694 | 1410 |
put:[ |
1411 |
|idx idx2 text change changeSet| |
|
1412 |
||
1413 |
changeSet := self classChangeSet. |
|
2465 | 1414 |
|
2694 | 1415 |
v == singleView ifTrue:[ |
1416 |
self methodsOnlyInASelection value notNil |
|
1417 |
ifTrue: [ |
|
1418 |
change := (changeSet methodsOnlyInA at: self methodsOnlyInASelection value) |
|
1419 |
] ifFalse:[ |
|
1420 |
change := (changeSet methodsOnlyInB at: self methodsOnlyInBSelection value) |
|
1421 |
]. |
|
1422 |
] ifFalse:[ |
|
1423 |
idx := self methodsChangedSelection value. |
|
1424 |
||
1425 |
v == self diffTextView leftTextView ifTrue:[ |
|
1426 |
change := (changeSet methodsChanged at:idx) first. |
|
1427 |
] ifFalse:[ |
|
1428 |
change := (changeSet methodsChanged at:idx) second. |
|
1429 |
]. |
|
1430 |
]. |
|
2501 | 1431 |
change apply |
2694 | 1432 |
]. |
2465 | 1433 |
m selectorAt:#accept put:nil. |
1434 |
v menuHolder:m. |
|
1435 |
v menuMessage:#value. |
|
1436 |
] |
|
2497 | 1437 |
! ! |
1438 |
||
1439 |
!VersionDiffBrowser::ClassChangeSet class methodsFor:'instance creation'! |
|
1440 |
||
2695 | 1441 |
changeSetForClass:aClass |
1442 |
"return a ChangeSet for the class aClass and its current source. |
|
1443 |
The source is generated into a stream and then the change set is generated |
|
1444 |
from the source stream. |
|
1445 |
||
1446 |
<return: ChangeSet|nil> |
|
1447 |
" |
|
1448 |
|theChangeSet source s| |
|
1449 |
||
1450 |
s := '' writeStream. |
|
1451 |
aClass fileOutOn:s. |
|
1452 |
source := s contents. |
|
1453 |
||
1454 |
theChangeSet := ChangeSet fromStream:(source readStream). |
|
1455 |
^theChangeSet |
|
1456 |
! |
|
1457 |
||
2497 | 1458 |
changeSetForClass:aClass andRevision:aVersion |
1459 |
"return a ChangeSet for the class aClass and version aVersion. |
|
1460 |
The version from the class source stream is checked out from the repositiory |
|
1461 |
into a source stream. Then the change set is generated from the source stream. |
|
1462 |
||
1463 |
<return: ChangeSet|nil> |
|
1464 |
" |
|
1465 |
|theSourceCodeManager theSourceStream theChangeSet| |
|
1466 |
||
1467 |
theSourceCodeManager := aClass sourceCodeManager. |
|
1468 |
[theSourceStream := theSourceCodeManager getSourceStreamFor:aClass revision:aVersion. |
|
1469 |
theSourceStream notNil |
|
1470 |
ifTrue:[theChangeSet:=ChangeSet fromStream:theSourceStream]] |
|
1471 |
valueNowOrOnUnwindDo: |
|
1472 |
[theSourceStream notNil ifTrue:[theSourceStream close]]. |
|
1473 |
^theChangeSet |
|
1474 |
! |
|
1475 |
||
1476 |
changeSetForClass:aClass andSource:aSource |
|
1477 |
"return a ChangeSet for the class aClass and source aSource. |
|
1478 |
The source is converted to a stream and then the change set is generated |
|
1479 |
from the source stream. |
|
1480 |
||
1481 |
<return: ChangeSet|nil> |
|
1482 |
" |
|
1483 |
|theChangeSet theSourceStream| |
|
1484 |
||
1485 |
[(theSourceStream := aSource readStream) notNil |
|
1486 |
ifTrue:[theChangeSet:=ChangeSet fromStream:(theSourceStream := aSource readStream)]] |
|
1487 |
valueNowOrOnUnwindDo: |
|
1488 |
[theSourceStream notNil |
|
1489 |
ifTrue:[theSourceStream close]]. |
|
1490 |
^theChangeSet |
|
1491 |
! |
|
1492 |
||
2695 | 1493 |
newForClass:aClass againstVersion:aVersionA |
1494 |
"return a ClassChangeSet for the class aClass against some verison in the repository. |
|
1495 |
A new instance of ClassChangeSet is generated containing |
|
1496 |
the correspondenting changes. |
|
1497 |
||
1498 |
<return: ClassChangeSet> |
|
1499 |
" |
|
2710
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1500 |
|theChangeSetA theChangeSetB theClassChangeSet versionCompared diffSet| |
2695 | 1501 |
|
1502 |
theClassChangeSet := self new. |
|
1503 |
theClassChangeSet classBeingCompared:aClass. |
|
1504 |
versionCompared := aVersionA. |
|
1505 |
aVersionA isNil ifTrue:[ |
|
1506 |
theClassChangeSet labelA:(versionCompared := aClass revision). |
|
1507 |
] ifFalse:[ |
|
1508 |
aVersionA == #newest ifTrue:[ |
|
1509 |
theClassChangeSet labelA:'newest'. |
|
1510 |
] ifFalse:[ |
|
1511 |
theClassChangeSet labelA:versionCompared. |
|
1512 |
] |
|
1513 |
]. |
|
1514 |
theClassChangeSet labelB:'current'. |
|
1515 |
theChangeSetA := self changeSetForClass: aClass andRevision: versionCompared. |
|
1516 |
theChangeSetB := self changeSetForClass: aClass. |
|
1517 |
theChangeSetA isNil |
|
1518 |
ifTrue: [theChangeSetA := ChangeSet new]. |
|
1519 |
theChangeSetB isNil |
|
1520 |
ifTrue: [theChangeSetB := ChangeSet new]. |
|
2710
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1521 |
"/ 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
|
1522 |
aClass isPrivate ifTrue:[ |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1523 |
theChangeSetA removeAllSuchThat:[:aChange | |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1524 |
aChange className ~= aClass name |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1525 |
]. |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1526 |
theChangeSetB removeAllSuchThat:[:aChange | |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1527 |
aChange className ~= aClass name |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1528 |
]. |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1529 |
]. |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1530 |
self activityNotification:'generating diff-set...'. |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1531 |
diffSet := theClassChangeSet diffSet:(theChangeSetA diffSetsAgainst:theChangeSetB). |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1532 |
self activityNotification:nil. |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1533 |
^ diffSet |
2695 | 1534 |
! |
1535 |
||
2497 | 1536 |
newForClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB |
1537 |
"return a ClassChangeSet for the class aClass and the two sources. |
|
1538 |
The two classes are compared via the source files. A new instance of |
|
1539 |
ClassChangeSet is generated containing the correspondenting changes. |
|
1540 |
||
1541 |
<return: ClassChangeSet> |
|
1542 |
" |
|
1543 |
|theChangeSetA theChangeSetB theClassChangeSet| |
|
1544 |
||
1545 |
theClassChangeSet := self new. |
|
1546 |
theClassChangeSet classBeingCompared:aClass. |
|
1547 |
theClassChangeSet labelA:aLabelA. |
|
1548 |
theClassChangeSet labelB:aLabelB. |
|
1549 |
theChangeSetA:=self changeSetForClass:aClass andSource:aSourceA. |
|
1550 |
theChangeSetB:=self changeSetForClass:aClass andSource:aSourceB. |
|
1551 |
theChangeSetA isNil |
|
1552 |
ifTrue: [theChangeSetA := ChangeSet new]. |
|
1553 |
theChangeSetB isNil |
|
1554 |
ifTrue: [theChangeSetB := ChangeSet new]. |
|
2695 | 1555 |
^theClassChangeSet diffSet:(theChangeSetA diffSetsAgainst:theChangeSetB) |
2465 | 1556 |
! |
1557 |
||
2497 | 1558 |
newForClass:aClass versionA:aVersionA versionB:aVersionB |
1559 |
"return a ClassChangeSet for the class aClass and the two versions. |
|
1560 |
The two class version are checked out from the repository and then being |
|
1561 |
compared. A new instance of ClassChangeSet is generated containing |
|
1562 |
the correspondenting changes. |
|
1563 |
||
1564 |
<return: ClassChangeSet> |
|
1565 |
" |
|
1566 |
|theChangeSetA theChangeSetB theClassChangeSet| |
|
1567 |
||
1568 |
theClassChangeSet := self new. |
|
1569 |
theClassChangeSet classBeingCompared:aClass. |
|
1570 |
theClassChangeSet labelA:aVersionA. |
|
1571 |
theClassChangeSet labelB:aVersionB. |
|
1572 |
theChangeSetA := self changeSetForClass: aClass andRevision: aVersionA. |
|
1573 |
theChangeSetB := self changeSetForClass: aClass andRevision: aVersionB. |
|
1574 |
theChangeSetA isNil |
|
1575 |
ifTrue: [theChangeSetA := ChangeSet new]. |
|
1576 |
theChangeSetB isNil |
|
1577 |
ifTrue: [theChangeSetB := ChangeSet new]. |
|
2695 | 1578 |
^theClassChangeSet diffSet:(theChangeSetA diffSetsAgainst:theChangeSetB) |
2497 | 1579 |
|
1580 |
! ! |
|
1581 |
||
1582 |
!VersionDiffBrowser::ClassChangeSet methodsFor:'accessing'! |
|
1583 |
||
1584 |
classBeingCompared |
|
1585 |
"returns the value of the class which is compared |
|
1586 |
||
1587 |
<return: Behavior> |
|
1588 |
" |
|
1589 |
||
1590 |
^ classBeingCompared |
|
1591 |
! |
|
2221 | 1592 |
|
2497 | 1593 |
classBeingCompared:something |
1594 |
"set the value of the class which is compared |
|
1595 |
||
1596 |
<return: self>" |
|
1597 |
||
1598 |
classBeingCompared := something. |
|
1599 |
! |
|
1600 |
||
2695 | 1601 |
diffSet |
1602 |
"returns a identity dictionary containing the different changes. |
|
1603 |
key: value: |
|
1604 |
#changed OrderedCollection of arrays containing ChangeSets for methods |
|
1605 |
which are changed and exists in the class versionA and versionB |
|
1606 |
#onlyInArg ChangeSet for the methods which exists only in the class versionB |
|
1607 |
#onlyInReceiver ChangeSet for the methods which exists only in the class versionA |
|
1608 |
||
1609 |
<return: IdentityDictionary> |
|
1610 |
" |
|
1611 |
^ diffSet |
|
1612 |
! |
|
1613 |
||
1614 |
diffSet:something |
|
1615 |
"sets a identity dictionary containing the different changes. |
|
1616 |
key: value: |
|
1617 |
#changed OrderedCollection of arrays containing ChangeSets for methods |
|
1618 |
which are changed and exists in the class versionA and versionB |
|
1619 |
#onlyInArg ChangeSet for the methods which exists only in the class versionB |
|
1620 |
#onlyInReceiver ChangeSet for the methods which exists only in the class versionA |
|
1621 |
||
1622 |
<return: self> |
|
1623 |
" |
|
1624 |
||
1625 |
diffSet := something. |
|
1626 |
! |
|
1627 |
||
2497 | 1628 |
labelA |
1629 |
"returns the label for the class versionA |
|
1630 |
||
1631 |
<return: String> |
|
1632 |
" |
|
1633 |
^ labelA |
|
1634 |
! |
|
1635 |
||
1636 |
labelA:something |
|
1637 |
"sets the label for the class versionA |
|
1638 |
||
1639 |
<return: self> |
|
1640 |
" |
|
1641 |
labelA := something. |
|
1642 |
! |
|
1643 |
||
1644 |
labelB |
|
1645 |
"returns the label for the class versionB |
|
1646 |
||
1647 |
<return: String> |
|
1648 |
" |
|
1649 |
^ labelB |
|
1650 |
! |
|
2465 | 1651 |
|
2497 | 1652 |
labelB:something |
1653 |
"sets the label for the class versionB |
|
1654 |
||
1655 |
<return: self> |
|
1656 |
" |
|
1657 |
||
1658 |
labelB := something. |
|
1659 |
! |
|
1660 |
||
1661 |
methodsChanged |
|
1662 |
"returns a OrderedCollection of arrays containing ChangeSets for methods |
|
1663 |
which are changed and exists in the class versionA and versionB |
|
1664 |
||
1665 |
<return: OrderedCollection> |
|
1666 |
" |
|
2695 | 1667 |
^ self diffSet at:#changed |
2497 | 1668 |
! |
1669 |
||
1670 |
methodsOnlyInA |
|
1671 |
"returns a ChangeSet for the methods which exists only in the class versionA |
|
1672 |
||
1673 |
<return: ChangeSet> |
|
1674 |
" |
|
1675 |
||
2695 | 1676 |
^ self diffSet at:#onlyInReceiver |
2497 | 1677 |
! |
1678 |
||
1679 |
methodsOnlyInB |
|
1680 |
"returns a ChangeSet for the methods which exists only in the class versionB |
|
1681 |
||
1682 |
<return: ChangeSet> |
|
1683 |
" |
|
1684 |
||
2695 | 1685 |
^ self diffSet at:#onlyInArg |
2221 | 1686 |
! ! |
1687 |
||
1688 |
!VersionDiffBrowser class methodsFor:'documentation'! |
|
1689 |
||
1690 |
version |
|
2725 | 1691 |
^ '$Header: /cvs/stx/stx/libtool/VersionDiffBrowser.st,v 1.29 2000-08-21 22:45:50 cg Exp $' |
2221 | 1692 |
! ! |