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