82 VersionDiffBrowser open |
82 VersionDiffBrowser open |
83 " |
83 " |
84 |
84 |
85 <resource: #canvas> |
85 <resource: #canvas> |
86 |
86 |
87 ^ |
87 ^ |
88 #(FullSpec |
88 #(FullSpec |
89 name: windowSpec |
89 name: windowSpec |
90 window: |
90 window: |
91 (WindowSpec |
91 (WindowSpec |
92 label: 'Version DiffBrowser' |
92 label: 'Version DiffBrowser' |
93 name: 'Version DiffBrowser' |
93 name: 'Version DiffBrowser' |
94 min: (Point 10 10) |
94 min: (Point 10 10) |
95 bounds: (Rectangle 0 0 865 504) |
95 bounds: (Rectangle 0 0 865 504) |
96 menu: mainMenu |
96 menu: mainMenu |
97 ) |
97 ) |
98 component: |
98 component: |
99 (SpecCollection |
99 (SpecCollection |
100 collection: ( |
100 collection: ( |
101 (VariableVerticalPanelSpec |
101 (VariableVerticalPanelSpec |
102 name: 'VariableVerticalPanel1' |
102 name: 'VariableVerticalPanel1' |
103 layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 -25 1.0) |
103 layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 -25 1.0) |
104 component: |
104 component: |
105 (SpecCollection |
105 (SpecCollection |
106 collection: ( |
106 collection: ( |
107 (HorizontalPanelViewSpec |
107 (HorizontalPanelViewSpec |
108 name: 'TopHorizontalPanel' |
108 name: 'TopHorizontalPanel' |
109 horizontalLayout: fit |
109 horizontalLayout: fit |
110 verticalLayout: fit |
110 verticalLayout: fit |
111 horizontalSpace: 3 |
111 horizontalSpace: 3 |
112 verticalSpace: 3 |
112 verticalSpace: 3 |
113 component: |
113 component: |
114 (SpecCollection |
114 (SpecCollection |
115 collection: ( |
115 collection: ( |
116 (ViewSpec |
116 (ViewSpec |
117 name: 'BoxA' |
117 name: 'BoxA' |
118 level: 0 |
118 level: 0 |
119 visibilityChannel: boxAVisible |
119 visibilityChannel: boxAVisible |
120 component: |
120 component: |
121 (SpecCollection |
121 (SpecCollection |
122 collection: ( |
122 collection: ( |
123 (LabelSpec |
123 (LabelSpec |
124 label: 'Only in A' |
124 label: 'Only in A' |
125 name: 'OnlyInALabel' |
125 name: 'OnlyInALabel' |
126 layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 20 0) |
126 layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 20 0) |
127 translateLabel: true |
127 translateLabel: true |
128 labelChannel: onlyInALabelHolder |
128 labelChannel: onlyInALabelHolder |
129 ) |
129 ) |
130 (SequenceViewSpec |
130 (SequenceViewSpec |
131 name: 'ListA' |
131 name: 'ListA' |
132 layout: (LayoutFrame 0 0.0 20 0.0 0 1.0 -3 1.0) |
132 layout: (LayoutFrame 0 0.0 20 0.0 0 1.0 -3 1.0) |
133 model: methodsOnlyInASelection |
133 model: methodsOnlyInASelection |
134 menu: menuA |
134 menu: menuA |
135 hasHorizontalScrollBar: true |
135 hasHorizontalScrollBar: true |
136 hasVerticalScrollBar: true |
136 hasVerticalScrollBar: true |
137 miniScrollerHorizontal: true |
137 miniScrollerHorizontal: true |
138 doubleClickSelector: methodInADoubleClicked: |
138 doubleClickSelector: methodInADoubleClicked: |
139 valueChangeSelector: methodsOnlyInASelectionChanged |
139 valueChangeSelector: methodsOnlyInASelectionChanged |
140 useIndex: true |
140 useIndex: true |
141 sequenceList: methodsOnlyInA |
141 sequenceList: methodsOnlyInA |
142 ) |
142 ) |
143 ) |
143 ) |
144 |
144 |
145 ) |
145 ) |
146 extent: (Point 286 199) |
146 extent: (Point 286 199) |
147 ) |
147 ) |
148 (ViewSpec |
148 (ViewSpec |
149 name: 'BoxM' |
149 name: 'BoxM' |
150 visibilityChannel: boxMVisible |
150 visibilityChannel: boxMVisible |
151 component: |
151 component: |
152 (SpecCollection |
152 (SpecCollection |
153 collection: ( |
153 collection: ( |
154 (LabelSpec |
154 (LabelSpec |
155 label: 'Changed' |
155 label: 'Changed' |
156 name: 'ChangedLabel' |
156 name: 'ChangedLabel' |
157 layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 20 0) |
157 layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 20 0) |
158 translateLabel: true |
158 translateLabel: true |
159 labelChannel: changedLabelHolder |
159 labelChannel: changedLabelHolder |
160 ) |
160 ) |
161 (SequenceViewSpec |
161 (SequenceViewSpec |
162 name: 'ListM' |
162 name: 'ListM' |
163 layout: (LayoutFrame 0 0.0 20 0.0 0 1.0 -3 1.0) |
163 layout: (LayoutFrame 0 0.0 20 0.0 0 1.0 -3 1.0) |
164 model: methodsChangedSelection |
164 model: methodsChangedSelection |
165 menu: menuM |
165 menu: menuM |
166 hasHorizontalScrollBar: true |
166 hasHorizontalScrollBar: true |
167 hasVerticalScrollBar: true |
167 hasVerticalScrollBar: true |
168 miniScrollerHorizontal: true |
168 miniScrollerHorizontal: true |
169 doubleClickSelector: methodInChangedDoubleClicked: |
169 doubleClickSelector: methodInChangedDoubleClicked: |
170 valueChangeSelector: methodsChangedSelectionChanged |
170 valueChangeSelector: methodsChangedSelectionChanged |
171 useIndex: true |
171 useIndex: true |
172 sequenceList: methodsChanged |
172 sequenceList: methodsChanged |
173 ) |
173 ) |
174 ) |
174 ) |
175 |
175 |
176 ) |
176 ) |
177 extent: (Point 286 199) |
177 extent: (Point 286 199) |
178 ) |
178 ) |
179 (ViewSpec |
179 (ViewSpec |
180 name: 'BoxB' |
180 name: 'BoxB' |
181 visibilityChannel: boxBVisible |
181 visibilityChannel: boxBVisible |
182 component: |
182 component: |
183 (SpecCollection |
183 (SpecCollection |
184 collection: ( |
184 collection: ( |
185 (LabelSpec |
185 (LabelSpec |
186 label: 'Only in B' |
186 label: 'Only in B' |
187 name: 'OnlyInBLabel' |
187 name: 'OnlyInBLabel' |
188 layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 20 0) |
188 layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 20 0) |
189 translateLabel: true |
189 translateLabel: true |
190 labelChannel: onlyInBLabelHolder |
190 labelChannel: onlyInBLabelHolder |
191 ) |
191 ) |
192 (SequenceViewSpec |
192 (SequenceViewSpec |
193 name: 'ListB' |
193 name: 'ListB' |
194 layout: (LayoutFrame 0 0.0 20 0.0 0 1.0 -3 1.0) |
194 layout: (LayoutFrame 0 0.0 20 0.0 0 1.0 -3 1.0) |
195 model: methodsOnlyInBSelection |
195 model: methodsOnlyInBSelection |
196 menu: menuB |
196 menu: menuB |
197 hasHorizontalScrollBar: true |
197 hasHorizontalScrollBar: true |
198 hasVerticalScrollBar: true |
198 hasVerticalScrollBar: true |
199 miniScrollerHorizontal: true |
199 miniScrollerHorizontal: true |
200 doubleClickSelector: methodInBDoubleClicked: |
200 doubleClickSelector: methodInBDoubleClicked: |
201 valueChangeSelector: methodsOnlyInBSelectionChanged |
201 valueChangeSelector: methodsOnlyInBSelectionChanged |
202 useIndex: true |
202 useIndex: true |
203 sequenceList: methodsOnlyInB |
203 sequenceList: methodsOnlyInB |
204 ) |
204 ) |
205 ) |
205 ) |
206 |
206 |
207 ) |
207 ) |
208 extent: (Point 287 199) |
208 extent: (Point 287 199) |
209 ) |
209 ) |
210 ) |
210 ) |
211 |
211 |
212 ) |
212 ) |
213 ) |
213 ) |
214 (ViewSpec |
214 (ViewSpec |
215 name: 'Box4' |
215 name: 'Box4' |
216 component: |
216 component: |
217 (SpecCollection |
217 (SpecCollection |
218 collection: ( |
218 collection: ( |
219 (ViewSpec |
219 (ViewSpec |
220 name: 'diffTextViewBox' |
220 name: 'diffTextViewBox' |
221 layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
221 layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
222 initiallyInvisible: true |
222 initiallyInvisible: true |
223 component: |
223 component: |
224 (SpecCollection |
224 (SpecCollection |
225 collection: ( |
225 collection: ( |
226 (LabelSpec |
226 (LabelSpec |
227 label: 'A' |
227 label: 'A' |
228 name: 'DiffTextLabelA' |
228 name: 'DiffTextLabelA' |
229 layout: (LayoutFrame 0 0 0 0 0 0.5 20 0) |
229 layout: (LayoutFrame 0 0 0 0 0 0.5 20 0) |
230 translateLabel: true |
230 translateLabel: true |
231 labelChannel: diffTextLabelA |
231 labelChannel: diffTextLabelA |
232 ) |
232 ) |
233 (LabelSpec |
233 (LabelSpec |
234 label: 'B' |
234 label: 'B' |
235 name: 'DiffTextLabelB' |
235 name: 'DiffTextLabelB' |
236 layout: (LayoutFrame 0 0.5 0 0 0 1 20 0) |
236 layout: (LayoutFrame 0 0.5 0 0 0 1 20 0) |
237 translateLabel: true |
237 translateLabel: true |
238 labelChannel: diffTextLabelB |
238 labelChannel: diffTextLabelB |
239 ) |
239 ) |
240 (ArbitraryComponentSpec |
240 (ArbitraryComponentSpec |
241 name: 'diffTextView' |
241 name: 'diffTextView' |
242 layout: (LayoutFrame 0 0.0 20 0.0 0 1.0 0 1.0) |
242 layout: (LayoutFrame 0 0.0 20 0.0 0 1.0 0 1.0) |
243 hasBorder: false |
243 hasBorder: false |
244 component: diffTextView |
244 component: diffTextView |
245 ) |
245 ) |
246 ) |
246 ) |
247 |
247 |
248 ) |
248 ) |
249 ) |
249 ) |
250 (CodeViewSpec |
250 (CodeViewSpec |
251 name: 'singleTextView' |
251 name: 'singleTextView' |
252 layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
252 layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
253 model: methodText |
253 model: methodText |
254 hasHorizontalScrollBar: true |
254 hasHorizontalScrollBar: true |
255 hasVerticalScrollBar: true |
255 hasVerticalScrollBar: true |
256 miniScrollerHorizontal: true |
256 miniScrollerHorizontal: true |
257 isReadOnly: true |
257 isReadOnly: true |
258 hasKeyboardFocusInitially: false |
258 hasKeyboardFocusInitially: false |
259 ) |
259 ) |
260 ) |
260 ) |
261 |
261 |
262 ) |
262 ) |
263 ) |
263 ) |
264 ) |
264 ) |
265 |
265 |
266 ) |
266 ) |
267 handles: (Any 0.42379958246347 1.0) |
267 handles: (Any 0.42379958246347 1.0) |
268 ) |
268 ) |
269 (LabelSpec |
269 (LabelSpec |
270 name: 'InfoLabel' |
270 name: 'InfoLabel' |
271 layout: (LayoutFrame 0 0 -25 1 0 1 0 1) |
271 layout: (LayoutFrame 0 0 -25 1 0 1 0 1) |
272 level: -1 |
272 level: -1 |
273 translateLabel: true |
273 translateLabel: true |
274 labelChannel: infoHolder |
274 labelChannel: infoHolder |
275 adjust: left |
275 adjust: left |
276 ) |
276 ) |
277 ) |
277 ) |
278 |
278 |
279 ) |
279 ) |
280 ) |
280 ) |
281 ! ! |
281 ! ! |
282 |
282 |
283 !VersionDiffBrowser class methodsFor:'menu specs'! |
283 !VersionDiffBrowser class methodsFor:'menu specs'! |
284 |
284 |
430 (Menu new fromLiteralArrayEncoding:(VersionDiffBrowser menuB)) startUp |
430 (Menu new fromLiteralArrayEncoding:(VersionDiffBrowser menuB)) startUp |
431 " |
431 " |
432 |
432 |
433 <resource: #menu> |
433 <resource: #menu> |
434 |
434 |
435 ^ |
435 ^ |
436 #(#Menu |
436 #(#Menu |
437 #( |
437 #( |
438 #(#MenuItem |
438 #(#MenuItem |
439 #label: 'Apply' |
439 #label: 'Apply' |
440 #translateLabel: true |
440 #translateLabel: true |
441 #value: #applySelectedChangeInB |
441 #value: #applySelectedChangeInB |
442 #enabled: #hasChangeSelectedInB |
442 #enabled: #hasChangeSelectedInB |
443 ) |
443 ) |
444 #(#MenuItem |
444 #(#MenuItem |
445 #label: 'Browse' |
445 #label: 'Browse' |
446 #translateLabel: true |
446 #translateLabel: true |
447 #value: #browseClassInB |
447 #value: #browseClassInB |
448 #enabled: #hasChangeSelectedInB |
448 #enabled: #hasChangeSelectedInB |
449 ) |
449 ) |
450 #(#MenuItem |
450 #(#MenuItem |
451 #label: '-' |
451 #label: '-' |
452 ) |
452 ) |
453 #(#MenuItem |
453 #(#MenuItem |
454 #label: 'Remove in Image' |
454 #label: 'Remove in Image' |
455 #translateLabel: true |
455 #translateLabel: true |
456 #value: #removeSelectedChangeInBFromImage |
456 #value: #removeSelectedChangeInBFromImage |
457 #enabled: #hasChangeSelectedInB |
457 #enabled: #hasChangeSelectedInB |
458 ) |
458 ) |
459 #(#MenuItem |
459 #(#MenuItem |
460 #label: '-' |
460 #label: '-' |
461 ) |
461 ) |
462 #(#MenuItem |
462 #(#MenuItem |
463 #label: 'Inspect' |
463 #label: 'Inspect' |
464 #translateLabel: true |
464 #translateLabel: true |
465 #value: #inspectSelectedChangeInB |
465 #value: #inspectSelectedChangeInB |
466 #choiceValue: 'nil "UndefinedObject" ' |
466 #choiceValue: 'nil "UndefinedObject" ' |
467 #enabled: #hasChangeSelectedInB |
467 #enabled: #hasChangeSelectedInB |
468 ) |
468 ) |
469 ) |
469 ) |
470 nil |
470 nil |
471 nil |
471 nil |
472 ) |
472 ) |
473 |
473 |
474 "Modified: / 15-08-2010 / 21:24:49 / cg" |
474 "Modified: / 15-08-2010 / 21:24:49 / cg" |
475 ! |
475 ! |
476 |
476 |
486 (Menu new fromLiteralArrayEncoding:(VersionDiffBrowser menu1)) startUp |
486 (Menu new fromLiteralArrayEncoding:(VersionDiffBrowser menu1)) startUp |
487 " |
487 " |
488 |
488 |
489 <resource: #menu> |
489 <resource: #menu> |
490 |
490 |
491 ^ |
491 ^ |
492 #(#Menu |
492 #(#Menu |
493 #( |
493 #( |
494 #(#MenuItem |
494 #(#MenuItem |
495 #label: 'Browse' |
495 #label: 'Browse' |
496 #translateLabel: true |
496 #translateLabel: true |
497 #value: #browseClassInM |
497 #value: #browseClassInM |
498 #enabled: #hasChangeSelectedInM |
498 #enabled: #hasChangeSelectedInM |
499 ) |
499 ) |
500 #(#MenuItem |
500 #(#MenuItem |
501 #label: '-' |
501 #label: '-' |
502 ) |
502 ) |
503 #(#MenuItem |
503 #(#MenuItem |
504 #label: 'Apply Left Version' |
504 #label: 'Apply Left Version' |
505 #translateLabel: true |
505 #translateLabel: true |
506 #value: #acceptInLeftView |
506 #value: #acceptInLeftView |
507 #enabled: #hasChangeSelectedInM |
507 #enabled: #hasChangeSelectedInM |
508 ) |
508 ) |
509 #(#MenuItem |
509 #(#MenuItem |
510 #label: 'Apply Right Version' |
510 #label: 'Apply Right Version' |
511 #translateLabel: true |
511 #translateLabel: true |
512 #value: #acceptInRightView |
512 #value: #acceptInRightView |
513 #enabled: #hasChangeSelectedInM |
513 #enabled: #hasChangeSelectedInM |
514 ) |
514 ) |
515 #(#MenuItem |
515 #(#MenuItem |
516 #label: '-' |
516 #label: '-' |
517 ) |
517 ) |
518 #(#MenuItem |
518 #(#MenuItem |
519 #label: 'Inspect both' |
519 #label: 'Inspect both' |
520 #translateLabel: true |
520 #translateLabel: true |
521 #value: #inspectSelectedChangeInM |
521 #value: #inspectSelectedChangeInM |
522 #choiceValue: 'nil "UndefinedObject" ' |
522 #choiceValue: 'nil "UndefinedObject" ' |
523 #enabled: #hasChangeSelectedInM |
523 #enabled: #hasChangeSelectedInM |
524 ) |
524 ) |
525 ) |
525 ) |
526 nil |
526 nil |
527 nil |
527 nil |
528 ) |
528 ) |
529 |
529 |
530 "Modified: / 31-08-2007 / 14:16:39 / cg" |
530 "Modified: / 31-08-2007 / 14:16:39 / cg" |
531 ! ! |
531 ! ! |
532 |
532 |
602 |classChangeSet| |
602 |classChangeSet| |
603 |
603 |
604 classChangeSet := ClassChangeSet newForClass:classA labelA:aLabelA andClass:classB labelB:aLabelB. |
604 classChangeSet := ClassChangeSet newForClass:classA labelA:aLabelA andClass:classB labelB:aLabelB. |
605 classChangeSet removeAllVersionMethods. |
605 classChangeSet removeAllVersionMethods. |
606 sameAction notNil ifTrue:[ |
606 sameAction notNil ifTrue:[ |
607 "/ check if same ... |
607 "/ check if same ... |
608 (classChangeSet methodsOnlyInA isEmpty |
608 (classChangeSet methodsOnlyInA isEmpty |
609 and:[classChangeSet methodsOnlyInB isEmpty |
609 and:[classChangeSet methodsOnlyInB isEmpty |
610 and:[classChangeSet diffSet isEmpty]]) ifTrue:[ |
610 and:[classChangeSet diffSet isEmpty]]) ifTrue:[ |
611 sameAction value. |
611 sameAction value. |
612 ^ self "/ do not open |
612 ^ self "/ do not open |
613 ] |
613 ] |
614 ]. |
614 ]. |
615 |
615 |
616 ^ self openOnClassChangeSet:classChangeSet title:ignoredTitle |
616 ^ self openOnClassChangeSet:classChangeSet title:ignoredTitle |
617 ! |
617 ! |
618 |
618 |
619 openOnClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB |
619 openOnClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB |
620 "create a VersionDiffBrowser instance and set the class change set of the |
620 "create a VersionDiffBrowser instance and set the class change set of the |
621 browser. The class diff set is generated from two source files." |
621 browser. The class diff set is generated from two source files." |
622 |
622 |
623 ^ self |
623 ^ self |
624 openOnClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB |
624 openOnClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB |
625 title:nil |
625 title:nil |
626 ! |
626 ! |
627 |
627 |
628 openOnClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB title:ignoredTitle |
628 openOnClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB title:ignoredTitle |
629 "create a VersionDiffBrowser instance and set the class change set of the |
629 "create a VersionDiffBrowser instance and set the class change set of the |
630 browser. The class diff set is generated from two source files." |
630 browser. The class diff set is generated from two source files." |
631 |
631 |
632 ^ self |
632 ^ self |
633 openOnClass:aClass labelA:aLabelA sourceA:aSourceA |
633 openOnClass:aClass labelA:aLabelA sourceA:aSourceA |
634 labelB:aLabelB sourceB:aSourceB |
634 labelB:aLabelB sourceB:aSourceB |
635 title:ignoredTitle ifSame:nil |
635 title:ignoredTitle ifSame:nil |
636 ! |
636 ! |
637 |
637 |
638 openOnClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB title:ignoredTitle ifSame:sameAction |
638 openOnClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB title:ignoredTitle ifSame:sameAction |
639 "create a VersionDiffBrowser instance and set the class change set of the |
639 "create a VersionDiffBrowser instance and set the class change set of the |
640 browser. The class diff set is generated from two source files." |
640 browser. The class diff set is generated from two source files." |
642 |diffs hasChangedMethods classChangeSet versionMethodChanges| |
642 |diffs hasChangedMethods classChangeSet versionMethodChanges| |
643 |
643 |
644 classChangeSet := ClassChangeSet newForClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB. |
644 classChangeSet := ClassChangeSet newForClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB. |
645 classChangeSet removeAllVersionMethods. |
645 classChangeSet removeAllVersionMethods. |
646 sameAction notNil ifTrue:[ |
646 sameAction notNil ifTrue:[ |
647 "/ check if same ... |
647 "/ check if same ... |
648 (classChangeSet methodsOnlyInA isEmpty |
648 (classChangeSet methodsOnlyInA isEmpty |
649 and:[classChangeSet methodsOnlyInB isEmpty]) ifTrue:[ |
649 and:[classChangeSet methodsOnlyInB isEmpty]) ifTrue:[ |
650 diffs := classChangeSet diffSet. |
650 diffs := classChangeSet diffSet. |
651 |
651 |
652 hasChangedMethods := diffs changed notEmpty. |
652 hasChangedMethods := diffs changed notEmpty. |
653 hasChangedMethods ifTrue:[ |
653 hasChangedMethods ifTrue:[ |
654 versionMethodChanges := diffs changed select:[:eachDifference | |
654 versionMethodChanges := diffs changed select:[:eachDifference | |
655 |eachChange| |
655 |eachChange| |
656 eachChange := eachDifference first. |
656 eachChange := eachDifference first. |
657 (eachChange isMethodChange |
657 (eachChange isMethodChange |
658 and:[ (AbstractSourceCodeManager isVersionMethodSelector:eachChange selector) |
658 and:[ (AbstractSourceCodeManager isVersionMethodSelector:eachChange selector) |
659 and:[ eachChange changeClass isMeta ]]). |
659 and:[ eachChange changeClass isMeta ]]). |
660 ]. |
660 ]. |
661 diffs changed size == versionMethodChanges size ifTrue: [ |
661 diffs changed size == versionMethodChanges size ifTrue: [ |
662 hasChangedMethods := false. |
662 hasChangedMethods := false. |
663 ]. |
663 ]. |
664 "/ diffs changed size == 1 ifTrue:[ |
664 "/ diffs changed size == 1 ifTrue:[ |
665 "/ theOnlyDifference := diffs changed first. |
665 "/ theOnlyDifference := diffs changed first. |
666 "/ theOnlyChange := theOnlyDifference first. |
666 "/ theOnlyChange := theOnlyDifference first. |
667 "/ (theOnlyChange isMethodChange |
667 "/ (theOnlyChange isMethodChange |
668 "/ and:[ ((theOnlyChange selector == #version) or:[theOnlyChange selector startsWith:'version_']) |
668 "/ and:[ ((theOnlyChange selector == #version) or:[theOnlyChange selector startsWith:'version_']) |
669 "/ and:[ theOnlyChange changeClass isMeta ]]) ifTrue:[ |
669 "/ and:[ theOnlyChange changeClass isMeta ]]) ifTrue:[ |
670 "/ hasChangedMethods := false |
670 "/ hasChangedMethods := false |
671 "/ ] |
671 "/ ] |
672 "/ ] |
672 "/ ] |
673 ]. |
673 ]. |
674 |
674 |
675 (hasChangedMethods not |
675 (hasChangedMethods not |
676 and:[diffs onlyInArg isEmpty |
676 and:[diffs onlyInArg isEmpty |
677 and:[diffs onlyInReceiver isEmpty]]) ifTrue:[ |
677 and:[diffs onlyInReceiver isEmpty]]) ifTrue:[ |
678 sameAction value. |
678 sameAction value. |
679 ^ self "/ do not open |
679 ^ self "/ do not open |
680 ]. |
680 ]. |
681 ] |
681 ] |
682 ]. |
682 ]. |
683 |
683 |
684 ^ self openOnClassChangeSet:classChangeSet title:ignoredTitle |
684 ^ self openOnClassChangeSet:classChangeSet title:ignoredTitle |
685 |
685 |
686 "Modified: / 13-10-2006 / 01:01:05 / cg" |
686 "Modified: / 13-10-2006 / 01:01:05 / cg" |
976 |
976 |
977 self infoHolder value:''. |
977 self infoHolder value:''. |
978 |
978 |
979 sel := self methodsChangedSelection value. |
979 sel := self methodsChangedSelection value. |
980 sel notNil ifTrue:[ |
980 sel notNil ifTrue:[ |
981 self methodsOnlyInASelection value:nil. |
981 self methodsOnlyInASelection value:nil. |
982 self methodsOnlyInBSelection value:nil. |
982 self methodsOnlyInBSelection value:nil. |
983 methodsChanged := self classChangeSet methodsChanged. |
983 methodsChanged := self classChangeSet methodsChanged. |
984 changeA := (methodsChanged at:sel) first. |
984 changeA := (methodsChanged at:sel) first. |
985 changeB := (methodsChanged at:sel) second. |
985 changeB := (methodsChanged at:sel) second. |
986 self withReadCursorDo:[ |
986 self withReadCursorDo:[ |
987 "/ see if the semantics have changed (or only prettyPrinted) |
987 "/ see if the semantics have changed (or only prettyPrinted) |
988 RBParser notNil ifTrue:[ |
988 RBParser notNil ifTrue:[ |
989 (classChangeSet notNil |
989 (classChangeSet notNil |
990 and:[ classChangeSet classBeingCompared notNil ]) ifTrue:[ |
990 and:[ classChangeSet classBeingCompared notNil ]) ifTrue:[ |
991 parseError := false. |
991 parseError := false. |
992 treeA := RBParser parseMethod:changeA source onError: [:str :pos | parseError := true]. |
992 treeA := RBParser parseMethod:changeA source onError: [:str :pos | parseError := true]. |
993 treeB := RBParser parseMethod:changeB source onError: [:str :pos | parseError := true]. |
993 treeB := RBParser parseMethod:changeB source onError: [:str :pos | parseError := true]. |
994 parseError ifFalse:[ |
994 parseError ifFalse:[ |
995 (treeA equalTo:treeB withMapping:(Dictionary new)) ifTrue:[ |
995 (treeA equalTo:treeB withMapping:(Dictionary new)) ifTrue:[ |
996 self infoHolder value:'Methods only differ in formatting / comments.'. |
996 self infoHolder value:'Methods only differ in formatting / comments.'. |
997 ] |
997 ] |
998 ] |
998 ] |
999 ]. |
999 ]. |
1000 ]. |
1000 ]. |
1001 self diffTextView |
1001 self diffTextView |
1002 text1:(changeA prettyPrintedSource) text2:(changeB prettyPrintedSource); |
1002 text1:(changeA prettyPrintedSource) text2:(changeB prettyPrintedSource); |
1003 moveToNextChanged |
1003 moveToNextChanged |
1004 ]. |
1004 ]. |
1005 self showDiffTextView. |
1005 self showDiffTextView. |
1006 ] |
1006 ] |
1007 |
1007 |
1008 "Modified: / 3.9.1999 / 15:01:30 / ps" |
1008 "Modified: / 3.9.1999 / 15:01:30 / ps" |
1009 ! |
1009 ! |
1010 |
1010 |
1042 |
1042 |
1043 self infoHolder value:''. |
1043 self infoHolder value:''. |
1044 |
1044 |
1045 sel := self methodsOnlyInBSelection value. |
1045 sel := self methodsOnlyInBSelection value. |
1046 sel notNil ifTrue:[ |
1046 sel notNil ifTrue:[ |
1047 self methodsOnlyInASelection value:nil. |
1047 self methodsOnlyInASelection value:nil. |
1048 self methodsChangedSelection value:nil. |
1048 self methodsChangedSelection value:nil. |
1049 change := self changeSetB at:sel. |
1049 change := self changeSetB at:sel. |
1050 self methodText value:(change prettyPrintedSource). |
1050 self methodText value:(change prettyPrintedSource). |
1051 self showSingleTextView. |
1051 self showSingleTextView. |
1052 ] |
1052 ] |
1053 ! |
1053 ! |
1054 |
1054 |
1055 removeSelectedChangeInBFromImage |
1055 removeSelectedChangeInBFromImage |
1056 |change cls sel op| |
1056 |change cls sel op| |
1057 |
1057 |
1058 change := self selectedChangeInB. |
1058 change := self selectedChangeInB. |
1059 change isMethodChange ifTrue:[ |
1059 change isMethodChange ifTrue:[ |
1060 (cls := change changeClass) notNil ifTrue:[ |
1060 (cls := change changeClass) notNil ifTrue:[ |
1061 (sel := change selector) notNil ifTrue:[ |
1061 (sel := change selector) notNil ifTrue:[ |
1062 RefactoryChangeManager notNil ifTrue:[ |
1062 RefactoryChangeManager notNil ifTrue:[ |
1063 op := RemoveMethodChange remove:sel from:cls. |
1063 op := RemoveMethodChange remove:sel from:cls. |
1064 RefactoryChangeManager performChange: op. |
1064 RefactoryChangeManager performChange: op. |
1065 ] ifFalse:[ |
1065 ] ifFalse:[ |
1066 cls removeSelector:sel |
1066 cls removeSelector:sel |
1067 ] |
1067 ] |
1068 ] |
1068 ] |
1069 ] |
1069 ] |
1070 ] |
1070 ] |
1071 |
1071 |
1072 "Modified: / 15-08-2010 / 21:35:00 / cg" |
1072 "Modified: / 15-08-2010 / 21:35:00 / cg" |
1073 ! ! |
1073 ! ! |
1074 |
1074 |
1075 !VersionDiffBrowser methodsFor:'aspects'! |
1075 !VersionDiffBrowser methodsFor:'aspects'! |
1076 |
1076 |
1077 boxAVisible |
1077 boxAVisible |
1078 boxAVisible isNil ifTrue:[ |
1078 boxAVisible isNil ifTrue:[ |
1079 boxAVisible := true asValue. |
1079 boxAVisible := true asValue. |
1080 ]. |
1080 ]. |
1081 ^ boxAVisible. |
1081 ^ boxAVisible. |
1082 ! |
1082 ! |
1083 |
1083 |
1084 boxBVisible |
1084 boxBVisible |
1085 boxBVisible isNil ifTrue:[ |
1085 boxBVisible isNil ifTrue:[ |
1086 boxBVisible := true asValue. |
1086 boxBVisible := true asValue. |
1087 ]. |
1087 ]. |
1088 ^ boxBVisible. |
1088 ^ boxBVisible. |
1089 ! |
1089 ! |
1090 |
1090 |
1091 boxMVisible |
1091 boxMVisible |
1092 boxMVisible isNil ifTrue:[ |
1092 boxMVisible isNil ifTrue:[ |
1093 boxMVisible := true asValue. |
1093 boxMVisible := true asValue. |
1094 ]. |
1094 ]. |
1095 ^ boxMVisible. |
1095 ^ boxMVisible. |
1096 ! |
1096 ! |
1097 |
1097 |
1098 canIncludeExtensionsHolder |
1098 canIncludeExtensionsHolder |
1099 "can include extensions ? (menu item enabler)" |
1099 "can include extensions ? (menu item enabler)" |
1100 |
1100 |
1101 canIncludeExtensionsHolder isNil ifTrue:[ |
1101 canIncludeExtensionsHolder isNil ifTrue:[ |
1102 canIncludeExtensionsHolder := true asValue. |
1102 canIncludeExtensionsHolder := true asValue. |
1103 ]. |
1103 ]. |
1104 ^ canIncludeExtensionsHolder. |
1104 ^ canIncludeExtensionsHolder. |
1105 ! |
1105 ! |
1106 |
1106 |
1107 changedLabelHolder |
1107 changedLabelHolder |
1228 |
1228 |
1229 <return: ValueHolder on: nil> |
1229 <return: ValueHolder on: nil> |
1230 " |
1230 " |
1231 |
1231 |
1232 methodsChangedSelection isNil ifTrue:[ |
1232 methodsChangedSelection isNil ifTrue:[ |
1233 methodsChangedSelection := ValueHolder new. |
1233 methodsChangedSelection := ValueHolder new. |
1234 ]. |
1234 ]. |
1235 ^ methodsChangedSelection. |
1235 ^ methodsChangedSelection. |
1236 ! |
1236 ! |
1237 |
1237 |
1238 methodsOnlyInA |
1238 methodsOnlyInA |
1239 "aspect for the 'method only in version A' list." |
1239 "aspect for the 'method only in version A' list." |
1240 |
1240 |
1241 methodsOnlyInA isNil ifTrue:[ |
1241 methodsOnlyInA isNil ifTrue:[ |
1242 methodsOnlyInA := List new. |
1242 methodsOnlyInA := List new. |
1243 ]. |
1243 ]. |
1244 ^ methodsOnlyInA. |
1244 ^ methodsOnlyInA. |
1245 |
1245 |
1246 "Modified: / 25-07-2006 / 11:14:43 / cg" |
1246 "Modified: / 25-07-2006 / 11:14:43 / cg" |
1247 ! |
1247 ! |
1248 |
1248 |
1249 methodsOnlyInASelection |
1249 methodsOnlyInASelection |
1250 "aspect for the selection holder of 'method only in version A'-list." |
1250 "aspect for the selection holder of 'method only in version A'-list." |
1251 |
1251 |
1252 methodsOnlyInASelection isNil ifTrue:[ |
1252 methodsOnlyInASelection isNil ifTrue:[ |
1253 methodsOnlyInASelection := ValueHolder new. |
1253 methodsOnlyInASelection := ValueHolder new. |
1254 ]. |
1254 ]. |
1255 ^ methodsOnlyInASelection. |
1255 ^ methodsOnlyInASelection. |
1256 |
1256 |
1257 "Modified: / 25-07-2006 / 11:14:53 / cg" |
1257 "Modified: / 25-07-2006 / 11:14:53 / cg" |
1258 ! |
1258 ! |
1259 |
1259 |
1260 methodsOnlyInB |
1260 methodsOnlyInB |
1261 "aspect for the 'method only in version B' list" |
1261 "aspect for the 'method only in version B' list" |
1262 |
1262 |
1263 methodsOnlyInB isNil ifTrue:[ |
1263 methodsOnlyInB isNil ifTrue:[ |
1264 methodsOnlyInB := List new. |
1264 methodsOnlyInB := List new. |
1265 ]. |
1265 ]. |
1266 ^ methodsOnlyInB. |
1266 ^ methodsOnlyInB. |
1267 |
1267 |
1268 "Modified: / 25-07-2006 / 11:14:48 / cg" |
1268 "Modified: / 25-07-2006 / 11:14:48 / cg" |
1269 ! |
1269 ! |
1270 |
1270 |
1271 methodsOnlyInBSelection |
1271 methodsOnlyInBSelection |
1272 "aspect for the selection holder of 'method only in version B'-list." |
1272 "aspect for the selection holder of 'method only in version B'-list." |
1273 |
1273 |
1274 methodsOnlyInBSelection isNil ifTrue:[ |
1274 methodsOnlyInBSelection isNil ifTrue:[ |
1275 methodsOnlyInBSelection := ValueHolder new. |
1275 methodsOnlyInBSelection := ValueHolder new. |
1276 ]. |
1276 ]. |
1277 ^ methodsOnlyInBSelection. |
1277 ^ methodsOnlyInBSelection. |
1278 |
1278 |
1279 "Modified: / 25-07-2006 / 11:15:00 / cg" |
1279 "Modified: / 25-07-2006 / 11:15:00 / cg" |
1280 ! |
1280 ! |
1281 |
1281 |
1282 onlyInALabelHolder |
1282 onlyInALabelHolder |
1283 "aspect for the label for 'method only in version A'." |
1283 "aspect for the label for 'method only in version A'." |
1284 |
1284 |
1285 onlyInALabelHolder isNil ifTrue:[ |
1285 onlyInALabelHolder isNil ifTrue:[ |
1286 onlyInALabelHolder := ValueHolder new. |
1286 onlyInALabelHolder := ValueHolder new. |
1287 ]. |
1287 ]. |
1288 ^ onlyInALabelHolder. |
1288 ^ onlyInALabelHolder. |
1289 |
1289 |
1290 "Modified: / 25-07-2006 / 11:15:12 / cg" |
1290 "Modified: / 25-07-2006 / 11:15:12 / cg" |
1291 ! |
1291 ! |
1292 |
1292 |
1293 onlyInBLabelHolder |
1293 onlyInBLabelHolder |
1294 "aspect for the label for 'method only in version B'." |
1294 "aspect for the label for 'method only in version B'." |
1295 |
1295 |
1296 onlyInBLabelHolder isNil ifTrue:[ |
1296 onlyInBLabelHolder isNil ifTrue:[ |
1297 onlyInBLabelHolder := ValueHolder new. |
1297 onlyInBLabelHolder := ValueHolder new. |
1298 ]. |
1298 ]. |
1299 ^ onlyInBLabelHolder. |
1299 ^ onlyInBLabelHolder. |
1300 |
1300 |
1301 "Modified: / 25-07-2006 / 11:15:07 / cg" |
1301 "Modified: / 25-07-2006 / 11:15:07 / cg" |
1302 ! ! |
1302 ! ! |
1456 |
1456 |
1457 defaultName := 'patchFile.chg'. |
1457 defaultName := 'patchFile.chg'. |
1458 |
1458 |
1459 classBeingCompared := classChangeSet classBeingCompared. |
1459 classBeingCompared := classChangeSet classBeingCompared. |
1460 classBeingCompared notNil ifTrue:[ |
1460 classBeingCompared notNil ifTrue:[ |
1461 defaultName := classBeingCompared nameWithoutPrefix. |
1461 defaultName := classBeingCompared nameWithoutPrefix. |
1462 classChangeSet versionA notNil ifTrue:[ |
1462 classChangeSet versionA notNil ifTrue:[ |
1463 defaultName := defaultName , '-'. |
1463 defaultName := defaultName , '-'. |
1464 defaultName := defaultName , classChangeSet versionA. |
1464 defaultName := defaultName , classChangeSet versionA. |
1465 classChangeSet versionB notNil ifTrue:[ |
1465 classChangeSet versionB notNil ifTrue:[ |
1466 defaultName := defaultName , '-'. |
1466 defaultName := defaultName , '-'. |
1467 defaultName := defaultName , classChangeSet versionB. |
1467 defaultName := defaultName , classChangeSet versionB. |
1468 ]. |
1468 ]. |
1469 ]. |
1469 ]. |
1470 defaultName := defaultName , '.chg'. |
1470 defaultName := defaultName , '.chg'. |
1471 ]. |
1471 ]. |
1472 f := Dialog |
1472 f := Dialog |
1473 requestFileNameForSave:'Name of patchFile:' |
1473 requestFileNameForSave:'Name of patchFile:' |
1474 default:defaultName. |
1474 default:defaultName. |
1475 self warn:'Sorry: This function is not yet implemented'. |
1475 self warn:'Sorry: This function is not yet implemented'. |
1476 ^ self. |
1476 ^ self. |
1477 |
1477 |
1478 "/ vsnMthdA := self changeSetA |
1478 "/ vsnMthdA := self changeSetA |
1479 "/ detect:[:ch | ch isMethodChange |
1479 "/ detect:[:ch | ch isMethodChange |
1480 "/ and:[ch changeClass isMeta |
1480 "/ and:[ch changeClass isMeta |
1481 "/ and:[ch changeSelector = #version]]] |
1481 "/ and:[ch changeSelector = #version]]] |
1482 "/ ifNone:nil. |
1482 "/ ifNone:nil. |
1483 "/ vsnMthdB := self changeSetA |
1483 "/ vsnMthdB := self changeSetA |
1484 "/ detect:[:ch | ch isMethodChange |
1484 "/ detect:[:ch | ch isMethodChange |
1485 "/ and:[ch changeClass isMeta |
1485 "/ and:[ch changeClass isMeta |
1486 "/ and:[ch changeSelector = #version]]] |
1486 "/ and:[ch changeSelector = #version]]] |
1487 "/ ifNone:nil. |
1487 "/ ifNone:nil. |
1488 "/ |
1488 "/ |
1489 "/ vsnMthdA notNil ifTrue:[ |
1489 "/ vsnMthdA notNil ifTrue:[ |
1490 "/ "/ extract the version |
1490 "/ "/ extract the version |
1491 "/ vsnA := Class revisionStringFromSource:vsnMthdA source. |
1491 "/ vsnA := Class revisionStringFromSource:vsnMthdA source. |
1492 "/ vsnA notNil ifTrue:[ |
1492 "/ vsnA notNil ifTrue:[ |
1493 "/ info := Class revisionInfoFromString:vsnA. |
1493 "/ info := Class revisionInfoFromString:vsnA. |
1494 "/ info notNil ifTrue:[ |
1494 "/ info notNil ifTrue:[ |
1495 "/ vsnA := info at:#revision ifAbsent:nil. |
1495 "/ vsnA := info at:#revision ifAbsent:nil. |
1580 diffTextView := self diffTextView. |
1580 diffTextView := self diffTextView. |
1581 leftView := diffTextView leftTextView. |
1581 leftView := diffTextView leftTextView. |
1582 rightView := diffTextView rightTextView. |
1582 rightView := diffTextView rightTextView. |
1583 singleView := self componentAt:#singleTextView. |
1583 singleView := self componentAt:#singleTextView. |
1584 |
1584 |
1585 (Array |
1585 (Array |
1586 with:leftView |
1586 with:leftView |
1587 with:rightView |
1587 with:rightView |
1588 with:singleView) |
1588 with:singleView) |
1589 do:[:v | |
1589 do:[:v | |
1590 |mGen| |
1590 |mGen| |
1591 |
1591 |
1592 mGen := [ |
1592 mGen := [ |
1593 |m| |
1593 |m| |
1594 |
1594 |
1595 m := v editMenu. |
1595 m := v editMenu. |
1596 |
1596 |
1597 (m selectorAt:#accept) isNil ifTrue:[ |
1597 (m selectorAt:#accept) isNil ifTrue:[ |
1598 m addLabels:(resources array:#('-' 'Accept')) |
1598 m addLabels:(resources array:#('-' 'Accept')) |
1599 selectors:(Array with:nil with:#accept) |
1599 selectors:(Array with:nil with:#accept) |
1600 after:#copySelection. |
1600 after:#copySelection. |
1601 ]. |
1601 ]. |
1602 m |
1602 m |
1603 actionAt:#accept |
1603 actionAt:#accept |
1604 put:[ |
1604 put:[ |
1605 v == singleView ifTrue:[ |
1605 v == singleView ifTrue:[ |
1606 self acceptInSingleView |
1606 self acceptInSingleView |
1607 ] ifFalse:[ |
1607 ] ifFalse:[ |
1608 v == leftView ifTrue:[ |
1608 v == leftView ifTrue:[ |
1609 self acceptInLeftView |
1609 self acceptInLeftView |
1610 ] ifFalse:[ |
1610 ] ifFalse:[ |
1611 self acceptInRightView |
1611 self acceptInRightView |
1612 ]. |
1612 ]. |
1613 ]. |
1613 ]. |
1614 ]. |
1614 ]. |
1615 m selectorAt:#accept put:nil. |
1615 m selectorAt:#accept put:nil. |
1616 m enable:#copySelection. |
1616 m enable:#copySelection. |
1617 m setEnable:#accept to:[self canAcceptInCodeView]. |
1617 m setEnable:#accept to:[self canAcceptInCodeView]. |
1618 m |
1618 m |
1619 ]. |
1619 ]. |
1620 v menuHolder:mGen. |
1620 v menuHolder:mGen. |
1621 v menuMessage:#value. |
1621 v menuMessage:#value. |
1622 ] |
1622 ] |
1623 ! |
1623 ! |
1624 |
1624 |
1625 applyChange:change |
1625 applyChange:change |
1626 change notNil ifTrue:[ |
1626 change notNil ifTrue:[ |
1627 change apply |
1627 change apply |
1628 ] |
1628 ] |
1629 ! |
1629 ! |
1630 |
1630 |
1631 printStringForChange:aChange |
1631 printStringForChange:aChange |
1632 "generate a print string for a change." |
1632 "generate a print string for a change." |
1633 |
1633 |
1634 |m changeClassName useChangesString selectorString |
1634 |m changeClassName useChangesString selectorString |
1635 singleComparedClass singleComparedClassesName singleComparedMetaclassesName| |
1635 singleComparedClass singleComparedClassesName singleComparedMetaclassesName| |
1636 |
1636 |
1637 (singleComparedClass := self classBeingCompared) notNil ifTrue:[ |
1637 (singleComparedClass := self classBeingCompared) notNil ifTrue:[ |
1638 singleComparedClassesName := singleComparedClass name. |
1638 singleComparedClassesName := singleComparedClass name. |
1639 singleComparedMetaclassesName := singleComparedClass theMetaclass name. |
1639 singleComparedMetaclassesName := singleComparedClass theMetaclass name. |
1640 ]. |
1640 ]. |
1641 |
1641 |
1642 aChange isClassDefinitionChange ifTrue:[ |
1642 aChange isClassDefinitionChange ifTrue:[ |
1643 ^ aChange printStringWithoutClassName |
1643 ^ aChange printStringWithoutClassName |
1644 ]. |
1644 ]. |
1645 aChange isDoIt ifTrue:[ |
1645 aChange isDoIt ifTrue:[ |
1646 ^ aChange source , ' (doIt)' |
1646 ^ aChange source , ' (doIt)' |
1647 ]. |
1647 ]. |
1648 aChange isNameSpaceCreationChange ifTrue:[ |
1648 aChange isNameSpaceCreationChange ifTrue:[ |
1649 ^ aChange source |
1649 ^ aChange source |
1650 ]. |
1650 ]. |
1651 |
1651 |
1652 changeClassName := aChange className. |
1652 changeClassName := aChange className. |
1653 changeClassName isNil ifTrue:[ |
1653 changeClassName isNil ifTrue:[ |
1654 ^ aChange source |
1654 ^ aChange source |
1655 ]. |
1655 ]. |
1656 useChangesString := false. |
1656 useChangesString := false. |
1657 |
1657 |
1658 (changeClassName = singleComparedClassesName) ifTrue:[ |
1658 (changeClassName = singleComparedClassesName) ifTrue:[ |
1659 changeClassName := ''. |
1659 changeClassName := ''. |
1660 useChangesString := true. |
1660 useChangesString := true. |
1661 ] ifFalse:[ |
1661 ] ifFalse:[ |
1662 (changeClassName = singleComparedMetaclassesName) ifTrue:[ |
1662 (changeClassName = singleComparedMetaclassesName) ifTrue:[ |
1663 changeClassName := 'class '. |
1663 changeClassName := 'class '. |
1664 useChangesString := true. |
1664 useChangesString := true. |
1665 ] ifFalse:[ |
1665 ] ifFalse:[ |
1666 ((changeClassName includes:$:) and:[ changeClassName startsWith:((singleComparedClassesName ? ''),'::') ]) ifTrue:[ |
1666 ((changeClassName includes:$:) and:[ changeClassName startsWith:((singleComparedClassesName ? ''),'::') ]) ifTrue:[ |
1667 changeClassName := changeClassName copyFrom:(singleComparedClassesName,'::') size+1. |
1667 changeClassName := changeClassName copyFrom:(singleComparedClassesName,'::') size+1. |
1668 ]. |
1668 ]. |
1669 ]. |
1669 ]. |
1670 ]. |
1670 ]. |
1671 |
1671 |
1672 selectorString := ''. |
1672 selectorString := ''. |
1673 (aChange isMethodChange |
1673 (aChange isMethodChange |
1674 and:[ aChange changeClass notNil ]) ifTrue:[ |
1674 and:[ aChange changeClass notNil ]) ifTrue:[ |
1675 selectorString := aChange selector. |
1675 selectorString := aChange selector. |
1676 m := aChange changeMethod. |
1676 m := aChange changeMethod. |
1677 m notNil ifTrue:[ |
1677 m notNil ifTrue:[ |
1678 m := m originalMethodIfWrapped. |
1678 m := m originalMethodIfWrapped. |
1679 selectorString := m printStringForBrowserWithSelector:aChange selector inClass:aChange changeClass. |
1679 selectorString := m printStringForBrowserWithSelector:aChange selector inClass:aChange changeClass. |
1680 ]. |
1680 ]. |
1681 selectorString := ' ',selectorString |
1681 selectorString := ' ',selectorString |
1682 ]. |
1682 ]. |
1683 |
1683 |
1684 aChange isMethodCategoryChange ifTrue:[ |
1684 aChange isMethodCategoryChange ifTrue:[ |
1685 ^ changeClassName,selectorString, ' (category)' |
1685 ^ changeClassName,selectorString, ' (category)' |
1686 ]. |
1686 ]. |
1687 ^ changeClassName,selectorString |
1687 ^ changeClassName,selectorString |
1688 |
1688 |
1689 "Modified: / 24-11-2011 / 12:11:02 / cg" |
1689 "Modified: / 24-11-2011 / 12:11:02 / cg" |
1690 ! |
1690 ! |
1691 |
1691 |
1692 resetSelectionHolders |
1692 resetSelectionHolders |
1693 " |
1693 " |
1694 reset all selection holders when a new change set is given. |
1694 reset all selection holders when a new change set is given. |
1695 First set the selection to nil. |
1695 First set the selection to nil. |
1696 |
1696 |
1697 <return: self> |
1697 <return: self> |
1698 " |
1698 " |
1699 |
1699 |
1700 self methodsChangedSelection value:nil. |
1700 self methodsChangedSelection value:nil. |
1743 |
1743 |
1744 |theVersionA theVersionB builder| |
1744 |theVersionA theVersionB builder| |
1745 |
1745 |
1746 builder := self builder. |
1746 builder := self builder. |
1747 (theVersionA := self versionA) notNil ifTrue:[ |
1747 (theVersionA := self versionA) notNil ifTrue:[ |
1748 self diffTextLabelA value:theVersionA. |
1748 self diffTextLabelA value:theVersionA. |
1749 self onlyInALabelHolder value:('Only in ' , theVersionA). |
1749 self onlyInALabelHolder value:('Only in ' , theVersionA). |
1750 (self componentAt:#OnlyInALabel) |
1750 (self componentAt:#OnlyInALabel) |
1751 foregroundColor:Color white; |
1751 foregroundColor:Color white; |
1752 backgroundColor:Color green darkened. |
1752 backgroundColor:Color green darkened. |
1753 ]. |
1753 ]. |
1754 (theVersionB :=self versionB) notNil ifTrue:[ |
1754 (theVersionB :=self versionB) notNil ifTrue:[ |
1755 self diffTextLabelB value:theVersionB. |
1755 self diffTextLabelB value:theVersionB. |
1756 self onlyInBLabelHolder value:('Only in ' , theVersionB). |
1756 self onlyInBLabelHolder value:('Only in ' , theVersionB). |
1757 (self componentAt:#OnlyInBLabel) |
1757 (self componentAt:#OnlyInBLabel) |
1758 foregroundColor:Color white; |
1758 foregroundColor:Color white; |
1759 backgroundColor:Color red darkened. |
1759 backgroundColor:Color red darkened. |
1760 ]. |
1760 ]. |
1761 |
1761 |
1762 self changedLabelHolder value:('Different'). |
1762 self changedLabelHolder value:('Different'). |
1763 |
1763 |
1764 "Modified: / 13-10-2006 / 01:07:08 / cg" |
1764 "Modified: / 13-10-2006 / 01:07:08 / cg" |
1765 ! |
1765 ! |
1766 |
1766 |
1767 updateLists |
1767 updateLists |
1768 |classChangeSet listOnlyInA listOnlyInB listChanged |
1768 |classChangeSet listOnlyInA listOnlyInB listChanged |
1769 printStringGenerator sortBlockForChangeLists filteredList |
1769 printStringGenerator sortBlockForChangeLists filteredList |
1770 isIgnoredChange numIgnoredExtensions| |
1770 isIgnoredChange numIgnoredExtensions| |
1771 |
1771 |
1772 classChangeSet := self classChangeSet. |
1772 classChangeSet := self classChangeSet. |
1773 |
1773 |
1774 printStringGenerator := [:aChange | self printStringForChange:aChange]. |
1774 printStringGenerator := [:aChange | self printStringForChange:aChange]. |
1775 sortBlockForChangeLists := [:a :b | (printStringGenerator value:a) < (printStringGenerator value:b)]. |
1775 sortBlockForChangeLists := [:a :b | (printStringGenerator value:a) < (printStringGenerator value:b)]. |
1776 |
1776 |
1777 numIgnoredExtensions := 0. |
1777 numIgnoredExtensions := 0. |
1778 |
1778 |
1779 isIgnoredChange := |
1779 isIgnoredChange := |
1780 [:change | |
1780 [:change | |
1781 |packageOfMethodInChange packageOfMethodInImage changeMethod ignored| |
1781 |packageOfMethodInChange packageOfMethodInImage changeMethod ignored| |
1782 |
1782 |
1783 ignored := false. |
1783 ignored := false. |
1784 change isMethodCodeChange ifTrue:[ |
1784 change isMethodCodeChange ifTrue:[ |
1785 packageOfMethodInChange := change package. |
1785 packageOfMethodInChange := change package. |
1786 (packageOfMethodInChange notNil |
1786 (packageOfMethodInChange notNil |
1787 and:[ packageOfMethodInChange ~= PackageId noProjectID |
1787 and:[ packageOfMethodInChange ~= PackageId noProjectID |
1788 and:[ packageOfMethodInChange ~= change changeClass package ]]) ifTrue:[ |
1788 and:[ packageOfMethodInChange ~= change changeClass package ]]) ifTrue:[ |
1789 ignored := true |
1789 ignored := true |
1790 ]. |
1790 ]. |
1791 |
1791 |
1792 changeMethod := change changeMethod. |
1792 changeMethod := change changeMethod. |
1793 changeMethod notNil ifTrue:[ |
1793 changeMethod notNil ifTrue:[ |
1794 packageOfMethodInImage := changeMethod package. |
1794 packageOfMethodInImage := changeMethod package. |
1795 (true "packageOfMethodInImage notNil" |
1795 (true "packageOfMethodInImage notNil" |
1796 and:[ packageOfMethodInImage ~= PackageId noProjectID |
1796 and:[ packageOfMethodInImage ~= PackageId noProjectID |
1797 and:[ packageOfMethodInImage ~= changeMethod mclass package ]]) ifTrue:[ |
1797 and:[ packageOfMethodInImage ~= changeMethod mclass package ]]) ifTrue:[ |
1798 ignored := true |
1798 ignored := true |
1799 ]. |
1799 ]. |
1800 ]. |
1800 ]. |
1801 numIgnoredExtensions := numIgnoredExtensions + (ignored ifTrue:[1] ifFalse:[0]). |
1801 numIgnoredExtensions := numIgnoredExtensions + (ignored ifTrue:[1] ifFalse:[0]). |
1802 ]. |
1802 ]. |
1803 ignored. |
1803 ignored. |
1804 ]. |
1804 ]. |
1805 |
1805 |
1806 listOnlyInA := self methodsOnlyInA. |
1806 listOnlyInA := self methodsOnlyInA. |
1807 listOnlyInA removeAll. |
1807 listOnlyInA removeAll. |
1808 classChangeSet notNil ifTrue:[ |
1808 classChangeSet notNil ifTrue:[ |
1809 "/ classChangeSet methodsOnlyInA sort:sortBlockForChangeLists. |
1809 "/ classChangeSet methodsOnlyInA sort:sortBlockForChangeLists. |
1810 filteredList := classChangeSet methodsOnlyInA. |
1810 filteredList := classChangeSet methodsOnlyInA. |
1811 self includeExtensions ifFalse:[ |
1811 self includeExtensions ifFalse:[ |
1812 filteredList := filteredList reject:isIgnoredChange. |
1812 filteredList := filteredList reject:isIgnoredChange. |
1813 ]. |
1813 ]. |
1814 listOnlyInA addAll: (filteredList collect:printStringGenerator). |
1814 listOnlyInA addAll: (filteredList collect:printStringGenerator). |
1815 ]. |
1815 ]. |
1816 |
1816 |
1817 listOnlyInB := self methodsOnlyInB. |
1817 listOnlyInB := self methodsOnlyInB. |
1818 listOnlyInB removeAll. |
1818 listOnlyInB removeAll. |
1819 classChangeSet notNil ifTrue:[ |
1819 classChangeSet notNil ifTrue:[ |
1820 "/ classChangeSet methodsOnlyInB sort:sortBlockForChangeLists. |
1820 "/ classChangeSet methodsOnlyInB sort:sortBlockForChangeLists. |
1821 filteredList := classChangeSet methodsOnlyInB. |
1821 filteredList := classChangeSet methodsOnlyInB. |
1822 self includeExtensions ifFalse:[ |
1822 self includeExtensions ifFalse:[ |
1823 filteredList := filteredList reject:isIgnoredChange. |
1823 filteredList := filteredList reject:isIgnoredChange. |
1824 ]. |
1824 ]. |
1825 listOnlyInB addAll: (filteredList collect:printStringGenerator). |
1825 listOnlyInB addAll: (filteredList collect:printStringGenerator). |
1826 ]. |
1826 ]. |
1827 |
1827 |
1828 listChanged := self methodsChanged. |
1828 listChanged := self methodsChanged. |
1829 listChanged removeAll. |
1829 listChanged removeAll. |
1830 classChangeSet notNil ifTrue:[ |
1830 classChangeSet notNil ifTrue:[ |
1831 "/ classChangeSet methodsChanged sort:[:a :b | sortBlockForChangeLists value:a first value:b first]. |
1831 "/ classChangeSet methodsChanged sort:[:a :b | sortBlockForChangeLists value:a first value:b first]. |
1832 filteredList := classChangeSet methodsChanged. |
1832 filteredList := classChangeSet methodsChanged. |
1833 self includeExtensions ifFalse:[ |
1833 self includeExtensions ifFalse:[ |
1834 filteredList := filteredList reject:[:entry | isIgnoredChange value:entry first]. |
1834 filteredList := filteredList reject:[:entry | isIgnoredChange value:entry first]. |
1835 ]. |
1835 ]. |
1836 listChanged addAll: (filteredList collect:[:entry| printStringGenerator value:(entry first)]). |
1836 listChanged addAll: (filteredList collect:[:entry| printStringGenerator value:(entry first)]). |
1837 ]. |
1837 ]. |
1838 |
1838 |
1839 self boxAVisible value:(listOnlyInA notEmpty). |
1839 self boxAVisible value:(listOnlyInA notEmpty). |
1840 self boxBVisible value:(listOnlyInB notEmpty). |
1840 self boxBVisible value:(listOnlyInB notEmpty). |
1841 |
1841 |
1842 self boxMVisible value:(listChanged isEmpty |
1842 self boxMVisible value:(listChanged isEmpty |
1843 and: [(listOnlyInA notEmpty |
1843 and: [(listOnlyInA notEmpty |
1844 or:[listOnlyInB notEmpty])]) not. |
1844 or:[listOnlyInB notEmpty])]) not. |
1845 |
1845 |
1846 numIgnoredExtensions ~~ 0 ifTrue:[ |
1846 numIgnoredExtensions ~~ 0 ifTrue:[ |
1847 infoHolder value:('%1 extension methods ignored.' bindWith:numIgnoredExtensions) |
1847 self infoHolder value:('%1 extension methods ignored.' bindWith:numIgnoredExtensions) |
1848 ] ifFalse:[ |
1848 ] ifFalse:[ |
1849 infoHolder value:nil |
1849 self infoHolder value:nil |
1850 ]. |
1850 ]. |
1851 |
1851 |
1852 "Modified: / 13-09-2011 / 12:08:06 / cg" |
1852 "Modified: / 21-03-2012 / 17:00:13 / cg" |
1853 ! ! |
1853 ! ! |
1854 |
1854 |
1855 !VersionDiffBrowser methodsFor:'setup'! |
1855 !VersionDiffBrowser methodsFor:'setup'! |
1856 |
1856 |
1857 setupForClass:aClass againstVersion:aVersionA |
1857 setupForClass:aClass againstVersion:aVersionA |
1946 |
1946 |
1947 |theSourceCodeManager theSourceStream theChangeSet| |
1947 |theSourceCodeManager theSourceStream theChangeSet| |
1948 |
1948 |
1949 theSourceCodeManager := SourceCodeManagerUtilities default sourceCodeManagerFor:aClass. |
1949 theSourceCodeManager := SourceCodeManagerUtilities default sourceCodeManagerFor:aClass. |
1950 [ |
1950 [ |
1951 theSourceStream := theSourceCodeManager getSourceStreamFor:aClass revision:aVersion. |
1951 theSourceStream := theSourceCodeManager getSourceStreamFor:aClass revision:aVersion. |
1952 theSourceStream notNil |
1952 theSourceStream notNil |
1953 ifTrue:[theChangeSet := ChangeSet fromStream:theSourceStream] |
1953 ifTrue:[theChangeSet := ChangeSet fromStream:theSourceStream] |
1954 ] ensure:[ |
1954 ] ensure:[ |
1955 theSourceStream notNil ifTrue:[theSourceStream close] |
1955 theSourceStream notNil ifTrue:[theSourceStream close] |
1956 ]. |
1956 ]. |
1957 self sortChangeSet:theChangeSet. |
1957 self sortChangeSet:theChangeSet. |
1958 ^ theChangeSet |
1958 ^ theChangeSet |
1959 |
1959 |
1960 "Modified: / 12-09-2006 / 14:24:51 / cg" |
1960 "Modified: / 12-09-2006 / 14:24:51 / cg" |
1961 ! |
1961 ! |
1962 |
1962 |
1963 changeSetForClass:aClass andSource:aSource |
1963 changeSetForClass:aClass andSource:aSource |
1964 "return a ChangeSet for the class aClass and source aSource. |
1964 "return a ChangeSet for the class aClass and source aSource. |
1965 The source is converted to a stream and then the change set is generated |
1965 The source is converted to a stream and then the change set is generated |
1966 from the source stream. |
1966 from the source stream. |
1967 Raise an error if the source stream cannot be opened." |
1967 Raise an error if the source stream cannot be opened." |
1968 |
1968 |
1969 |theChangeSet theSourceStream| |
1969 |theChangeSet theSourceStream| |
1970 |
1970 |
1971 [ |
1971 [ |
1972 theSourceStream := aSource readStream. |
1972 theSourceStream := aSource readStream. |
1973 theChangeSet := ChangeSet fromStream:(theSourceStream := aSource readStream) |
1973 theChangeSet := ChangeSet fromStream:(theSourceStream := aSource readStream) |
1974 ] ensure:[ |
1974 ] ensure:[ |
1975 theSourceStream notNil ifTrue:[ |
1975 theSourceStream notNil ifTrue:[ |
1976 theSourceStream close |
1976 theSourceStream close |
1977 ] |
1977 ] |
1978 ]. |
1978 ]. |
1979 self sortChangeSet:theChangeSet. |
1979 self sortChangeSet:theChangeSet. |
1980 ^ theChangeSet |
1980 ^ theChangeSet |
1981 ! |
1981 ! |
1982 |
1982 |
1983 newForClass:aClass againstVersion:aVersionA |
1983 newForClass:aClass againstVersion:aVersionA |
1984 "return a ClassChangeSet for the class aClass against some verson in the repository. |
1984 "return a ClassChangeSet for the class aClass against some verson in the repository. |
1985 A new instance of ClassChangeSet is generated containing |
1985 A new instance of ClassChangeSet is generated containing |
1986 the correspondenting changes." |
1986 the correspondenting changes." |
1987 |
1987 |
1988 |theClassChangeSet| |
1988 |theClassChangeSet| |
1989 |
1989 |
1990 theClassChangeSet := self new. |
1990 theClassChangeSet := self new. |
2011 aStream := '' writeStream. |
2011 aStream := '' writeStream. |
2012 Method flushSourceStreamCache. |
2012 Method flushSourceStreamCache. |
2013 classB fileOutOn:aStream withTimeStamp:false. |
2013 classB fileOutOn:aStream withTimeStamp:false. |
2014 sourceB := aStream contents asString. |
2014 sourceB := aStream contents asString. |
2015 |
2015 |
2016 theChangeSetA:=self changeSetForClass:classA andSource:sourceA. |
2016 theChangeSetA:=self changeSetForClass:classA andSource:sourceA. |
2017 theChangeSetB:=self changeSetForClass:classB andSource:sourceB. |
2017 theChangeSetB:=self changeSetForClass:classB andSource:sourceB. |
2018 theChangeSetA isNil |
2018 theChangeSetA isNil |
2019 ifTrue: [theChangeSetA := ChangeSet new]. |
2019 ifTrue: [theChangeSetA := ChangeSet new]. |
2020 theChangeSetB isNil |
2020 theChangeSetB isNil |
2021 ifTrue: [theChangeSetB := ChangeSet new]. |
2021 ifTrue: [theChangeSetB := ChangeSet new]. |
2022 |
2022 |
2023 "/ just in case (if comparing a class against another), |
2023 "/ just in case (if comparing a class against another), |
2024 "/ unify the classes of the changes (to avoid that all changes are detected as different) |
2024 "/ unify the classes of the changes (to avoid that all changes are detected as different) |
2025 |
2025 |
2026 theChangeSetB do:[:eachChange | |
2026 theChangeSetB do:[:eachChange | |
2027 eachChange isMethodChange ifTrue:[ |
2027 eachChange isMethodChange ifTrue:[ |
2028 eachChange changeClass isMeta ifTrue:[ |
2028 eachChange changeClass isMeta ifTrue:[ |
2029 eachChange changeClass ~~ classA theMetaclass ifTrue:[ |
2029 eachChange changeClass ~~ classA theMetaclass ifTrue:[ |
2030 eachChange changeClass:classA theMetaclass. |
2030 eachChange changeClass:classA theMetaclass. |
2031 ] |
2031 ] |
2032 ] ifFalse:[ |
2032 ] ifFalse:[ |
2033 eachChange changeClass ~~ classA theNonMetaclass ifTrue:[ |
2033 eachChange changeClass ~~ classA theNonMetaclass ifTrue:[ |
2034 eachChange changeClass:classA theNonMetaclass. |
2034 eachChange changeClass:classA theNonMetaclass. |
2035 ] |
2035 ] |
2036 ]. |
2036 ]. |
2037 ]. |
2037 ]. |
2038 ]. |
2038 ]. |
2039 "/ remove all #initialize doIts |
2039 "/ remove all #initialize doIts |
2040 theChangeSetA := theChangeSetA select:[:eachChange | eachChange isDoIt not or:[eachChange isInitialize not]]. |
2040 theChangeSetA := theChangeSetA select:[:eachChange | eachChange isDoIt not or:[eachChange isInitialize not]]. |
2041 theChangeSetB := theChangeSetB select:[:eachChange | eachChange isDoIt not or:[eachChange isInitialize not]]. |
2041 theChangeSetB := theChangeSetB select:[:eachChange | eachChange isDoIt not or:[eachChange isInitialize not]]. |
2042 |
2042 |
2044 ^ theClassChangeSet |
2044 ^ theClassChangeSet |
2045 ! |
2045 ! |
2046 |
2046 |
2047 newForClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB |
2047 newForClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB |
2048 "return a ClassChangeSet for the class aClass and the two sources. |
2048 "return a ClassChangeSet for the class aClass and the two sources. |
2049 The two classes are compared via the source files. A new instance of |
2049 The two classes are compared via the source files. A new instance of |
2050 ClassChangeSet is generated containing the correspondenting changes." |
2050 ClassChangeSet is generated containing the correspondenting changes." |
2051 |
2051 |
2052 |theChangeSetA theChangeSetB theClassChangeSet className metaClassName| |
2052 |theChangeSetA theChangeSetB theClassChangeSet className metaClassName| |
2053 |
2053 |
2054 theClassChangeSet := self new. |
2054 theClassChangeSet := self new. |
2055 theClassChangeSet classBeingCompared:aClass. |
2055 theClassChangeSet classBeingCompared:aClass. |
2056 theClassChangeSet labelA:aLabelA. |
2056 theClassChangeSet labelA:aLabelA. |
2057 theClassChangeSet labelB:aLabelB. |
2057 theClassChangeSet labelB:aLabelB. |
2058 theChangeSetA:=self changeSetForClass:aClass andSource:aSourceA. |
2058 theChangeSetA:=self changeSetForClass:aClass andSource:aSourceA. |
2059 theChangeSetB:=self changeSetForClass:aClass andSource:aSourceB. |
2059 theChangeSetB:=self changeSetForClass:aClass andSource:aSourceB. |
2060 |
2060 |
2061 className := aClass name. |
2061 className := aClass name. |
2062 metaClassName := aClass class name. |
2062 metaClassName := aClass class name. |
2063 |
2063 |
2064 aClass isPrivate ifTrue:[ |
2064 aClass isPrivate ifTrue:[ |
2065 theChangeSetA := theChangeSetA select:[:change | change isMethodChange not |
2065 theChangeSetA := theChangeSetA select:[:change | change isMethodChange not |
2066 or:[change className = className or:[change className = metaClassName]]]. |
2066 or:[change className = className or:[change className = metaClassName]]]. |
2067 theChangeSetA := theChangeSetA select:[:change | change isClassDefinitionChange not |
2067 theChangeSetA := theChangeSetA select:[:change | change isClassDefinitionChange not |
2068 or:[change className = className or:[change className = metaClassName]]]. |
2068 or:[change className = className or:[change className = metaClassName]]]. |
2069 theChangeSetA := theChangeSetA select:[:change | change isDoIt not |
2069 theChangeSetA := theChangeSetA select:[:change | change isDoIt not |
2070 or:[change receiverClassName = className or:[change receiverClassName = metaClassName]]]. |
2070 or:[change receiverClassName = className or:[change receiverClassName = metaClassName]]]. |
2071 theChangeSetB := theChangeSetB select:[:change | change isMethodChange not |
2071 theChangeSetB := theChangeSetB select:[:change | change isMethodChange not |
2072 or:[change className = className or:[change className = metaClassName]]]. |
2072 or:[change className = className or:[change className = metaClassName]]]. |
2073 theChangeSetB := theChangeSetB select:[:change | change isClassDefinitionChange not |
2073 theChangeSetB := theChangeSetB select:[:change | change isClassDefinitionChange not |
2074 or:[change className = className or:[change className = metaClassName]]]. |
2074 or:[change className = className or:[change className = metaClassName]]]. |
2075 theChangeSetB := theChangeSetB select:[:change | change isDoIt not |
2075 theChangeSetB := theChangeSetB select:[:change | change isDoIt not |
2076 or:[change receiverClassName = className or:[change receiverClassName = metaClassName]]]. |
2076 or:[change receiverClassName = className or:[change receiverClassName = metaClassName]]]. |
2077 "/ there might be more needed... |
2077 "/ there might be more needed... |
2078 ]. |
2078 ]. |
2079 |
2079 |
2080 theChangeSetA isNil |
2080 theChangeSetA isNil |
2081 ifTrue: [theChangeSetA := ChangeSet new]. |
2081 ifTrue: [theChangeSetA := ChangeSet new]. |
2082 theChangeSetB isNil |
2082 theChangeSetB isNil |
2083 ifTrue: [theChangeSetB := ChangeSet new]. |
2083 ifTrue: [theChangeSetB := ChangeSet new]. |
2084 |
2084 |
2085 theClassChangeSet diffSet:(theChangeSetA diffSetsAgainst:theChangeSetB). |
2085 theClassChangeSet diffSet:(theChangeSetA diffSetsAgainst:theChangeSetB). |
2086 ^ theClassChangeSet |
2086 ^ theClassChangeSet |
2087 ! |
2087 ! |
2088 |
2088 |
2089 newForClass:aClass versionA:aVersionA versionB:aVersionB |
2089 newForClass:aClass versionA:aVersionA versionB:aVersionB |
2090 "return a ClassChangeSet for the class aClass and the two versions. |
2090 "return a ClassChangeSet for the class aClass and the two versions. |
2091 The two class version are checked out from the repository and then being |
2091 The two class version are checked out from the repository and then being |
2092 compared. A new instance of ClassChangeSet is generated containing |
2092 compared. A new instance of ClassChangeSet is generated containing |
2093 the correspondenting changes." |
2093 the correspondenting changes." |
2094 |
2094 |
2095 |theChangeSetA theChangeSetB theClassChangeSet| |
2095 |theChangeSetA theChangeSetB theClassChangeSet| |
2096 |
2096 |
2097 theClassChangeSet := self new. |
2097 theClassChangeSet := self new. |
2255 |
2255 |
2256 !VersionDiffBrowser::ClassChangeSet methodsFor:'setup'! |
2256 !VersionDiffBrowser::ClassChangeSet methodsFor:'setup'! |
2257 |
2257 |
2258 setupForClass:aClass againstVersion:aVersionA |
2258 setupForClass:aClass againstVersion:aVersionA |
2259 "return a ClassChangeSet for the class aClass against some verison in the repository. |
2259 "return a ClassChangeSet for the class aClass against some verison in the repository. |
2260 A new instance of ClassChangeSet is generated containing |
2260 A new instance of ClassChangeSet is generated containing |
2261 the correspondenting changes." |
2261 the correspondenting changes." |
2262 |
2262 |
2263 |theChangeSetA theChangeSetB versionCompared| |
2263 |theChangeSetA theChangeSetB versionCompared| |
2264 |
2264 |
2265 self classBeingCompared:aClass. |
2265 self classBeingCompared:aClass. |
2266 versionCompared := aVersionA. |
2266 versionCompared := aVersionA. |
2267 aVersionA isNil ifTrue:[ |
2267 aVersionA isNil ifTrue:[ |
2268 self labelA:(versionCompared := aClass revision). |
2268 self labelA:(versionCompared := aClass revision). |
2269 self versionA:versionCompared. |
2269 self versionA:versionCompared. |
2270 ] ifFalse:[ |
2270 ] ifFalse:[ |
2271 aVersionA == #newest ifTrue:[ |
2271 aVersionA == #newest ifTrue:[ |
2272 self labelA:(VersionDiffBrowser resources string:'Newest'). |
2272 self labelA:(VersionDiffBrowser resources string:'Newest'). |
2273 ] ifFalse:[ |
2273 ] ifFalse:[ |
2274 self labelA:versionCompared. |
2274 self labelA:versionCompared. |
2275 self versionA:versionCompared. |
2275 self versionA:versionCompared. |
2276 ] |
2276 ] |
2277 ]. |
2277 ]. |
2278 self labelB:(VersionDiffBrowser resources string:'Current'). |
2278 self labelB:(VersionDiffBrowser resources string:'Current'). |
2279 theChangeSetA := self class changeSetForClass: aClass andRevision: versionCompared. |
2279 theChangeSetA := self class changeSetForClass: aClass andRevision: versionCompared. |
2280 theChangeSetB := self class changeSetForClass: aClass. |
2280 theChangeSetB := self class changeSetForClass: aClass. |
2281 theChangeSetA isNil ifTrue: [theChangeSetA := ChangeSet new]. |
2281 theChangeSetA isNil ifTrue: [theChangeSetA := ChangeSet new]. |
2282 theChangeSetB isNil ifTrue: [theChangeSetB := ChangeSet new]. |
2282 theChangeSetB isNil ifTrue: [theChangeSetB := ChangeSet new]. |
2283 |
2283 |
2284 "/ if we are comparing a private class, prune out other changes |
2284 "/ if we are comparing a private class, prune out other changes |
2285 aClass isPrivate ifTrue:[ |
2285 aClass isPrivate ifTrue:[ |
2286 theChangeSetA removeAllSuchThat:[:aChange | aChange className ~= aClass name ]. |
2286 theChangeSetA removeAllSuchThat:[:aChange | aChange className ~= aClass name ]. |
2287 theChangeSetB removeAllSuchThat:[:aChange | aChange className ~= aClass name ]. |
2287 theChangeSetB removeAllSuchThat:[:aChange | aChange className ~= aClass name ]. |
2288 ]. |
2288 ]. |
2289 self activityNotification:'Generating diff-set...'. |
2289 self activityNotification:'Generating diff-set...'. |
2290 self diffSet:(theChangeSetA diffSetsAgainst:theChangeSetB). |
2290 self diffSet:(theChangeSetA diffSetsAgainst:theChangeSetB). |
2291 self activityNotification:nil. |
2291 self activityNotification:nil. |
2292 ^ diffSet |
2292 ^ diffSet |
2293 ! ! |
2293 ! ! |
2294 |
2294 |
2295 !VersionDiffBrowser class methodsFor:'documentation'! |
2295 !VersionDiffBrowser class methodsFor:'documentation'! |
2296 |
2296 |
2297 version |
2297 version |
2298 ^ '$Header: /cvs/stx/stx/libtool/VersionDiffBrowser.st,v 1.102 2012/03/06 14:43:53 cg Exp $' |
2298 ^ '$Header: /cvs/stx/stx/libtool/VersionDiffBrowser.st,v 1.104 2012/03/22 08:32:02 cg Exp $' |
2299 ! |
2299 ! |
2300 |
2300 |
2301 version_CVS |
2301 version_CVS |
2302 ^ '§Header: /cvs/stx/stx/libtool/VersionDiffBrowser.st,v 1.102 2012/03/06 14:43:53 cg Exp §' |
2302 ^ '§Header: /cvs/stx/stx/libtool/VersionDiffBrowser.st,v 1.104 2012/03/22 08:32:02 cg Exp §' |
2303 ! |
2303 ! |
2304 |
2304 |
2305 version_SVN |
2305 version_SVN |
2306 ^ '$Id: VersionDiffBrowser.st 7952 2012-03-21 17:50:14Z vranyj1 $' |
2306 ^ '$Id: VersionDiffBrowser.st 7978 2012-04-13 13:15:47Z vranyj1 $' |
2307 ! ! |
2307 ! ! |