author | Claus Gittinger <cg@exept.de> |
Wed, 06 Dec 1995 17:14:40 +0100 | |
changeset 241 | 9366ced0db42 |
parent 226 | 4b050498fe46 |
child 255 | 08ec5e9cdbd2 |
permissions | -rw-r--r-- |
0 | 1 |
" |
4 | 2 |
COPYRIGHT (c) 1990 by Claus Gittinger |
45 | 3 |
All Rights Reserved |
0 | 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 |
StandardSystemView subclass:#ChangesBrowser |
|
45 | 14 |
instanceVariableNames:'changeListView codeView changeFileName changeChunks |
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
15 |
changePositions changeClassNames changeHeaderLines anyChanges |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
16 |
changeNrShown changeNrProcessed skipSignal compareChanges |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
17 |
compareCheckBox changeFileSize changeFileTimestamp checkBlock |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
18 |
changeTimeStamps tabSpec autoUpdate' |
58 | 19 |
classVariableNames:'CompressSnapshotInfo' |
45 | 20 |
poolDictionaries:'' |
21 |
category:'Interface-Browsers' |
|
0 | 22 |
! |
23 |
||
29 | 24 |
!ChangesBrowser class methodsFor:'documentation'! |
25 |
||
26 |
copyright |
|
27 |
" |
|
28 |
COPYRIGHT (c) 1990 by Claus Gittinger |
|
45 | 29 |
All Rights Reserved |
0 | 30 |
|
29 | 31 |
This software is furnished under a license and may be used |
32 |
only in accordance with the terms of that license and with the |
|
33 |
inclusion of the above copyright notice. This software may not |
|
34 |
be provided or otherwise made available to, or used by, any |
|
35 |
other person. No title to or ownership of the software is |
|
36 |
hereby transferred. |
|
37 |
" |
|
38 |
! |
|
39 |
||
40 |
documentation |
|
41 |
" |
|
42 |
this implements a browser for the changes-file. |
|
43 |
See the extra document 'doc/misc/cbrowser.doc' for how to use this browser. |
|
44 |
||
45 |
written jan 90 by claus |
|
51 | 46 |
|
58 | 47 |
Class variables: |
48 |
CompressSnapshotInfo if true (the default), snapshot entries |
|
49 |
are also compressed in the compress function. |
|
50 |
Some users prefer them to be not compressed. |
|
51 |
Set it to false for this. |
|
52 |
||
51 | 53 |
Notice: |
54 |
this needs a total rewrite, to build up a changeSet from the file |
|
123 | 55 |
(which did not exist when the ChangesBrowser was originally written) |
56 |
and manipulate that changeSet. |
|
57 |
||
58 | 58 |
This way, we get a browser for any upcoming incore changeSets for |
59 |
free. Also, this will put the chunk analyzation code into Change and |
|
60 |
subclasses (where it belongs) and give a better encapsulation and |
|
61 |
overall structure. Do not take this as an example for good style ;-) |
|
29 | 62 |
" |
63 |
! ! |
|
0 | 64 |
|
45 | 65 |
!ChangesBrowser class methodsFor:'instance creation'! |
66 |
||
67 |
new |
|
68 |
"create a new changes browser" |
|
69 |
||
70 |
^ super label:'Changes Browser' |
|
71 |
icon:(Form fromFile:'CBrowser.xbm' resolution:100) |
|
72 |
! |
|
73 |
||
74 |
openOn:aFileName |
|
75 |
"create c changes browser on a change file" |
|
76 |
||
49 | 77 |
^ ((self new label:'Changes Browser: ', aFileName) changeFileName:aFileName) open |
45 | 78 |
! ! |
79 |
||
0 | 80 |
!ChangesBrowser class methodsFor:'behavior'! |
81 |
||
82 |
autoSelectNext |
|
83 |
"returning true here, makes a Delete operation automatically |
|
84 |
select the next change" |
|
85 |
||
86 |
^ true |
|
87 |
! ! |
|
88 |
||
73 | 89 |
!ChangesBrowser class methodsFor:'defaults'! |
0 | 90 |
|
73 | 91 |
defaultLabel |
92 |
^ 'Changes Browser' |
|
28 | 93 |
! ! |
94 |
||
202 | 95 |
!ChangesBrowser methodsFor:'compiler interface'! |
96 |
||
97 |
wantChangeLog |
|
98 |
"sent by the compiler to ask if a changeLog entry should |
|
99 |
be written. Return false here." |
|
100 |
||
101 |
^ false |
|
102 |
! ! |
|
103 |
||
104 |
!ChangesBrowser methodsFor:'error handling'! |
|
105 |
||
106 |
correctableError:aString position:relPos to:relEndPos from:aCompiler |
|
107 |
"compiler notifys us of an error - this should really not happen since |
|
108 |
changes ought to be correct (did someone edit the changes file ??). |
|
109 |
Show the bad change in the codeView and let codeView hilight the error; |
|
110 |
no corrections allowed here therefore return false" |
|
111 |
||
112 |
self error:aString position:relPos to:relEndPos from:aCompiler. |
|
113 |
^ false |
|
114 |
! |
|
115 |
||
116 |
error:aString position:relPos to:relEndPos from:aCompiler |
|
117 |
"compiler notifys us of an error - this should really not happen since |
|
118 |
changes ought to be correct (did someone edit the changes file ??). |
|
119 |
Show the bad change in the codeView and let codeView hilight the error" |
|
120 |
||
121 |
|action| |
|
122 |
||
123 |
(changeNrProcessed ~~ changeNrShown) ifTrue:[ |
|
124 |
self changeSelection:changeNrProcessed |
|
125 |
]. |
|
126 |
(skipSignal notNil) ifTrue:[ |
|
127 |
||
128 |
codeView highlightingErrorPosition:relPos to:relEndPos do:[ |
|
129 |
|box| |
|
0 | 130 |
|
202 | 131 |
" |
132 |
start dialog - make certain cleanup is done |
|
133 |
" |
|
134 |
action := OptionBox |
|
135 |
request:aString |
|
136 |
label:'Error' |
|
137 |
form:(WarningBox iconBitmap) |
|
138 |
buttonLabels:#('abort' 'skip' 'continue') |
|
139 |
values:#(#abort #skip #continue) |
|
140 |
default:#continue. |
|
141 |
]. |
|
0 | 142 |
|
202 | 143 |
action == #abort ifTrue:[ |
144 |
Object abortSignal raise. |
|
145 |
^ false |
|
146 |
]. |
|
147 |
action == #skip ifTrue:[ |
|
148 |
skipSignal raise. |
|
149 |
^ false |
|
150 |
]. |
|
151 |
^ false |
|
152 |
]. |
|
153 |
^ codeView error:aString position:relPos to:relEndPos from:aCompiler |
|
154 |
! |
|
155 |
||
156 |
warning:aString position:relPos to:relEndPos from:aCompiler |
|
157 |
"compiler notifys us of a warning - ignore it" |
|
158 |
||
159 |
^ self |
|
160 |
! ! |
|
161 |
||
162 |
!ChangesBrowser methodsFor:'event handling '! |
|
163 |
||
164 |
handlesKeyPress:key inView:view |
|
165 |
"this method is reached via delegation: are we prepared to handle |
|
166 |
a keyPress in some other view ?" |
|
167 |
||
168 |
view == changeListView ifTrue:[ |
|
169 |
(key == #Delete or:[key == #BackSpace]) ifTrue:[^ true]. |
|
170 |
]. |
|
171 |
^ false |
|
0 | 172 |
! |
173 |
||
202 | 174 |
keyPress:key x:x y:y view:view |
175 |
"this method is reached via delegation from the changeListView" |
|
176 |
||
177 |
(key == #Delete or:[key == #BackSpace]) ifTrue:[ |
|
178 |
self doDelete. |
|
179 |
^ self |
|
180 |
]. |
|
181 |
changeListView keyPress:key x:x y:y |
|
182 |
! ! |
|
183 |
||
184 |
!ChangesBrowser methodsFor:'help '! |
|
185 |
||
186 |
helpTextFor:aComponent |
|
187 |
|s| |
|
188 |
||
189 |
aComponent == codeView ifTrue:[ |
|
190 |
s := 'HELP_CODEVIEW' |
|
191 |
]. |
|
192 |
aComponent == changeListView ifTrue:[ |
|
193 |
s := 'HELP_CHANGELIST' |
|
194 |
]. |
|
195 |
((aComponent == compareCheckBox) |
|
196 |
or:[aComponent superView == compareCheckBox]) ifTrue:[ |
|
197 |
s := 'HELP_CHECK_COMPARE' |
|
198 |
]. |
|
199 |
s notNil ifTrue:[ |
|
200 |
^ resources string:s |
|
201 |
]. |
|
202 |
^ nil |
|
203 |
! ! |
|
204 |
||
205 |
!ChangesBrowser methodsFor:'initialize / release'! |
|
206 |
||
207 |
changeListMenu |
|
208 |
|labels selectors m| |
|
209 |
||
210 |
||
221 | 211 |
"/ self sensor ctrlDown ifTrue:[ |
212 |
"/ labels := #( |
|
213 |
"/ '\c auto update' |
|
214 |
"/ ). |
|
215 |
"/ selectors := #( |
|
216 |
"/ autoUpdate: |
|
217 |
"/ ). |
|
218 |
"/ ] ifFalse:[ |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
219 |
labels := #( |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
220 |
'apply change' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
221 |
'apply changes to end' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
222 |
'apply changes for this class to end' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
223 |
'apply all changes' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
224 |
'-' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
225 |
'delete' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
226 |
'delete to end' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
227 |
'delete changes for this class to end' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
228 |
'delete all changes for this class' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
229 |
'-' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
230 |
'update' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
231 |
'compress' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
232 |
'compare with current version' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
233 |
'browse' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
234 |
'-' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
235 |
'make change a patch' |
221 | 236 |
"/ 'update sourcefile from change' |
237 |
"/ '-' |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
238 |
'fileout & delete changes for this class' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
239 |
'-' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
240 |
'save change in file ...' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
241 |
'save changes to end in file ...' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
242 |
'save changes for this class to end in file ...' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
243 |
'save all changes for this class in file ...' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
244 |
'-' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
245 |
'writeback changeFile'). |
221 | 246 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
247 |
selectors := #( |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
248 |
doApply |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
249 |
doApplyRest |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
250 |
doApplyClassRest |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
251 |
doApplyAll |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
252 |
nil |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
253 |
doDelete |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
254 |
doDeleteRest |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
255 |
doDeleteClassRest |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
256 |
doDeleteClassAll |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
257 |
nil |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
258 |
doUpdate |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
259 |
doCompress |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
260 |
doCompare |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
261 |
doBrowse |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
262 |
nil |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
263 |
doMakePatch |
221 | 264 |
"/ doMakePermanent |
265 |
"/ nil |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
266 |
doFileoutAndDeleteClassAll |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
267 |
nil |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
268 |
doSave |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
269 |
doSaveRest |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
270 |
doSaveClassRest |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
271 |
doSaveClassAll |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
272 |
nil |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
273 |
doWriteBack |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
274 |
). |
221 | 275 |
"/ ]. |
202 | 276 |
|
277 |
m := PopUpMenu |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
278 |
labels:(resources array:labels) |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
279 |
selectors:selectors. |
202 | 280 |
|
221 | 281 |
"/ autoUpdate ifTrue:[ |
282 |
"/ m checkToggleAt:#autoUpdate: put:true |
|
283 |
"/ ]. |
|
202 | 284 |
changeListView hasSelection ifFalse:[ |
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
285 |
m disableAll:#(doApply doApplyClassRest doApplyRest doDelete doDeleteRest doDeleteClassRest |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
286 |
doDeleteClassAll doCompare doMakePatch doSaveChangeInFile doMakePermanent |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
287 |
doSave doSaveRest doSaveClassAll doSaveClassRest doBrowse) |
202 | 288 |
]. |
289 |
^ m |
|
290 |
||
291 |
"Modified: 6.9.1995 / 17:14:22 / claus" |
|
221 | 292 |
"Modified: 3.12.1995 / 14:31:44 / cg" |
202 | 293 |
! |
294 |
||
295 |
compare:aBoolean |
|
296 |
"sent from the compare-toggle" |
|
73 | 297 |
|
202 | 298 |
aBoolean ~~ compareChanges ifTrue:[ |
299 |
compareChanges := aBoolean. |
|
300 |
compareChanges ifTrue:[ |
|
301 |
tabSpec positions:#(0 0.15 5 8.5 ). |
|
302 |
self doUpdate |
|
303 |
] ifFalse:[ |
|
304 |
"/ |
|
305 |
"/ set tabs to hide compare-column |
|
306 |
"/ |
|
307 |
tabSpec positions:#(-1 0 5 8.5 ). |
|
308 |
changeListView clear; redraw. |
|
309 |
] |
|
310 |
] |
|
311 |
||
312 |
"Modified: 18.11.1995 / 17:30:20 / cg" |
|
313 |
! |
|
314 |
||
315 |
focusSequence |
|
316 |
^ Array with:changeListView with:codeView |
|
317 |
! |
|
318 |
||
319 |
initialize |
|
221 | 320 |
|panel v upperFrame buttonPanel autoUpdateCheckBox| |
202 | 321 |
|
322 |
super initialize. |
|
323 |
||
324 |
changeFileName := ObjectMemory nameForChanges. "/ 'changes'. |
|
325 |
compareChanges := false. |
|
221 | 326 |
autoUpdate := false. |
327 |
||
202 | 328 |
checkBlock := [self checkIfFileHasChanged]. |
329 |
||
330 |
panel := VariableVerticalPanel origin:(0.0 @ 0.0) |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
331 |
corner:(1.0 @ 1.0) |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
332 |
borderWidth:0 |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
333 |
in:self. |
202 | 334 |
|
335 |
upperFrame := View origin:(0.0 @ 0.0) corner:(1.0 @ 0.3) in:panel. |
|
336 |
||
337 |
v := HVScrollableView for:SelectionInListView miniScrollerH:true in:upperFrame. |
|
338 |
v origin:(0.0 @ 0.0) corner:(0.8 @ 1.0). |
|
339 |
changeListView := v scrolledView. |
|
340 |
changeListView delegate:self. |
|
341 |
changeListView menuHolder:self; menuPerformer:self; menuMessage:#changeListMenu. |
|
342 |
||
343 |
buttonPanel := VerticalPanelView in:upperFrame. |
|
344 |
buttonPanel origin:(0.8 @ 0.0) corner:(1.0 @ 1.0). |
|
221 | 345 |
buttonPanel verticalLayout:#topSpace; horizontalLayout:#leftSpace. |
202 | 346 |
|
347 |
compareCheckBox := CheckBox new. |
|
348 |
compareCheckBox label:(resources string:'compare'). |
|
349 |
compareCheckBox action:[:val | self compare:val]. |
|
350 |
buttonPanel addSubView:compareCheckBox. |
|
351 |
||
221 | 352 |
autoUpdateCheckBox := CheckBox new. |
353 |
autoUpdateCheckBox label:(resources string:'auto update'). |
|
354 |
autoUpdateCheckBox action:[:val | self autoUpdate:val]. |
|
355 |
buttonPanel addSubView:autoUpdateCheckBox. |
|
356 |
||
202 | 357 |
v := HVScrollableView for:CodeView miniScrollerH:true miniScrollerV:false in:panel. |
358 |
v origin:(0.0 @ 0.3) corner:(1.0 @ 1.0). |
|
359 |
codeView := v scrolledView. |
|
360 |
codeView readOnly. |
|
361 |
||
362 |
anyChanges := false. |
|
363 |
ObjectMemory addDependent:self. "to get shutdown-update" |
|
364 |
||
365 |
tabSpec := TabulatorSpecification new. |
|
366 |
tabSpec unit:#inch. |
|
367 |
tabSpec positions:#(-1 0 5 8.5 ). |
|
368 |
" +/- cls>>sel type info" |
|
369 |
tabSpec align: #(#left #left #left #left). |
|
370 |
||
221 | 371 |
"Modified: 3.12.1995 / 14:26:18 / cg" |
202 | 372 |
! |
373 |
||
374 |
realize |
|
375 |
super realize. |
|
376 |
self readChangesFileInBackground:true. |
|
377 |
self setChangeList. |
|
378 |
changeListView action:[:lineNr | self changeSelection:lineNr]. |
|
379 |
Processor addTimedBlock:checkBlock afterSeconds:5. |
|
380 |
! |
|
381 |
||
382 |
update:what |
|
383 |
|box| |
|
384 |
||
385 |
(what == #aboutToExit) ifTrue:[ |
|
386 |
" |
|
387 |
smalltalk is about to shut down - |
|
388 |
- if change list was modified, ask user and save if requested. |
|
389 |
" |
|
390 |
anyChanges ifTrue:[ |
|
391 |
self raiseDeiconified. |
|
392 |
||
393 |
box := YesNoBox new. |
|
394 |
box title:(resources at:'changefile has not been updated from the modified changelist.\\Update before exiting ?') withCRs. |
|
395 |
box noText:(resources at:'don''t update'). |
|
396 |
box okText:(resources at:'update'). |
|
397 |
box yesAction:[self writeBackChanges] |
|
398 |
noAction:[]. |
|
399 |
box showAtPointer |
|
400 |
]. |
|
401 |
^ self |
|
402 |
]. |
|
403 |
super update:what |
|
404 |
! ! |
|
405 |
||
406 |
!ChangesBrowser methodsFor:'private'! |
|
407 |
||
408 |
appendChange:changeNr toFile:fileName |
|
409 |
"append change to a file. return true if ok." |
|
410 |
||
411 |
|aStream outStream chunk sawExcla separator| |
|
412 |
||
413 |
outStream := FileStream oldFileNamed:fileName. |
|
414 |
outStream isNil ifTrue:[ |
|
415 |
outStream isNil ifTrue:[ |
|
416 |
outStream := FileStream newFileNamed:fileName. |
|
417 |
outStream isNil ifTrue:[ |
|
418 |
self warn:'cannot update file ''%1''' with:fileName. |
|
419 |
^ false |
|
420 |
] |
|
73 | 421 |
] |
422 |
]. |
|
202 | 423 |
|
424 |
outStream setToEnd. |
|
425 |
||
426 |
aStream := self streamForChange:changeNr. |
|
427 |
aStream isNil ifTrue:[ |
|
428 |
self warn:'oops cannot read change'. |
|
429 |
^ false |
|
430 |
]. |
|
73 | 431 |
|
202 | 432 |
separator := aStream class chunkSeparator. |
433 |
sawExcla := aStream peekFor:separator. |
|
434 |
sawExcla ifTrue:[ |
|
435 |
outStream nextPut:separator |
|
436 |
]. |
|
437 |
chunk := aStream nextChunk. |
|
438 |
outStream nextChunkPut:chunk. |
|
439 |
outStream cr. |
|
440 |
sawExcla ifTrue:[ |
|
441 |
chunk := aStream nextChunk. |
|
442 |
outStream nextChunkPut:chunk. |
|
443 |
outStream space |
|
444 |
]. |
|
445 |
sawExcla ifTrue:[ |
|
446 |
outStream nextPut:separator |
|
447 |
]. |
|
448 |
outStream cr. |
|
449 |
aStream close. |
|
450 |
outStream close. |
|
451 |
^ true |
|
73 | 452 |
! |
453 |
||
51 | 454 |
applyChange:changeNr |
455 |
"fileIn a change" |
|
456 |
||
163
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
457 |
|aStream nm| |
45 | 458 |
|
51 | 459 |
aStream := self streamForChange:changeNr. |
460 |
aStream isNil ifTrue:[^ self]. |
|
461 |
||
462 |
nm := self classNameOfChange:changeNr. |
|
463 |
nm notNil ifTrue:[ |
|
464 |
|cls| |
|
45 | 465 |
|
51 | 466 |
cls := Smalltalk at:(nm asSymbol) ifAbsent:[]. |
467 |
cls notNil ifTrue:[ |
|
468 |
cls isLoaded ifFalse:[ |
|
469 |
cls autoload |
|
470 |
] |
|
471 |
] |
|
472 |
]. |
|
45 | 473 |
|
51 | 474 |
changeNrProcessed := changeNr. |
45 | 475 |
|
132 | 476 |
Class withoutUpdatingChangesDo:[ |
51 | 477 |
|sig| |
45 | 478 |
|
51 | 479 |
(skipSignal notNil) ifTrue:[ |
480 |
sig := skipSignal |
|
481 |
] ifFalse:[ |
|
482 |
sig := Object abortSignal |
|
483 |
]. |
|
484 |
sig catch:[ |
|
485 |
aStream fileInNextChunkNotifying:self |
|
486 |
]. |
|
487 |
changeNrProcessed := nil. |
|
45 | 488 |
]. |
132 | 489 |
aStream close |
45 | 490 |
! |
491 |
||
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
492 |
numberOfChanges |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
493 |
^ changePositions size |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
494 |
|
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
495 |
"Created: 3.12.1995 / 18:15:39 / cg" |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
496 |
! |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
497 |
|
202 | 498 |
autoSelect:changeNr |
499 |
"select a change" |
|
73 | 500 |
|
202 | 501 |
self class autoSelectNext ifTrue:[ |
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
502 |
(changeNr <= self numberOfChanges) ifTrue:[ |
202 | 503 |
changeListView selection:changeNr. |
504 |
self changeSelection:changeNr. |
|
505 |
^ self |
|
506 |
] |
|
507 |
]. |
|
508 |
self clearCodeView. |
|
509 |
changeListView selection:nil. |
|
73 | 510 |
! |
511 |
||
202 | 512 |
autoSelectLast |
513 |
"select the last change" |
|
0 | 514 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
515 |
self autoSelect:(self numberOfChanges) |
202 | 516 |
! |
107 | 517 |
|
202 | 518 |
autoSelectOrEnd:changeNr |
519 |
"select the next change or the last" |
|
520 |
||
521 |
|last| |
|
50 | 522 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
523 |
last := self numberOfChanges. |
202 | 524 |
changeNr < last ifTrue:[ |
525 |
self autoSelect:changeNr |
|
133 | 526 |
] ifFalse:[ |
202 | 527 |
changeListView selection:last . |
528 |
self changeSelection:last. |
|
529 |
] |
|
530 |
! |
|
133 | 531 |
|
202 | 532 |
changeFileName:aFileName |
533 |
changeFileName := aFileName |
|
133 | 534 |
! |
535 |
||
536 |
checkIfFileHasChanged |
|
537 |
|f info | |
|
538 |
||
539 |
Processor removeTimedBlock:checkBlock. |
|
540 |
f := changeFileName asFilename. |
|
541 |
(info := f info) isNil ifTrue:[ |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
542 |
self newLabel:'(unaccessable)' |
133 | 543 |
] ifFalse:[ |
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
544 |
(info at:#modified) > changeFileTimestamp ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
545 |
self newLabel:'(outdated)'. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
546 |
autoUpdate ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
547 |
self doUpdate |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
548 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
549 |
] ifFalse:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
550 |
self newLabel:'' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
551 |
] |
133 | 552 |
]. |
553 |
Processor addTimedBlock:checkBlock afterSeconds:5. |
|
554 |
||
555 |
"Created: 8.9.1995 / 19:30:19 / claus" |
|
556 |
"Modified: 8.9.1995 / 19:38:18 / claus" |
|
221 | 557 |
"Modified: 3.12.1995 / 14:14:55 / cg" |
133 | 558 |
! |
559 |
||
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
560 |
fullClassNameOfChange:changeNr |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
561 |
"return the full classname of a change |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
562 |
(for classChanges (i.e. xxx class), a string ending in ' class' is returned. |
202 | 563 |
- since parsing ascii methods is slow, keep result cached in |
564 |
changeClassNames for the next query" |
|
565 |
||
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
566 |
|chunk aParseTree recTree sel name arg1Tree isMeta| |
202 | 567 |
|
568 |
changeNr isNil ifTrue:[^ nil]. |
|
569 |
||
570 |
" |
|
571 |
first look, if not already known |
|
572 |
" |
|
573 |
name := changeClassNames at:changeNr. |
|
574 |
name notNil ifTrue:[^ name]. |
|
575 |
||
576 |
" |
|
577 |
get the chunk |
|
578 |
" |
|
579 |
chunk := changeChunks at:changeNr. |
|
580 |
chunk isNil ifTrue:[^ nil]. "mhmh - empty" |
|
581 |
||
226 | 582 |
"/ fix it |
583 |
(chunk endsWith:'primitiveDefinitions:') ifTrue:[ |
|
584 |
chunk := chunk , '''''' |
|
585 |
]. |
|
586 |
(chunk endsWith:'primitiveFunctions:') ifTrue:[ |
|
587 |
chunk := chunk , '''''' |
|
588 |
]. |
|
589 |
(chunk endsWith:'primitiveVariables:') ifTrue:[ |
|
590 |
chunk := chunk , '''''' |
|
591 |
]. |
|
592 |
||
202 | 593 |
" |
594 |
use parser to construct a parseTree |
|
595 |
" |
|
596 |
aParseTree := Parser parseExpression:chunk. |
|
597 |
(aParseTree isNil or:[aParseTree == #Error]) ifTrue:[ |
|
598 |
^ nil "seems strange ... (could be a comment)" |
|
599 |
]. |
|
600 |
aParseTree isMessage ifFalse:[ |
|
601 |
^ nil "very strange ... (whats that ?)" |
|
602 |
]. |
|
603 |
||
604 |
" |
|
605 |
ask parser for selector |
|
606 |
" |
|
607 |
sel := aParseTree selector. |
|
608 |
recTree := aParseTree receiver. |
|
609 |
||
610 |
" |
|
611 |
is it a method-change, methodRemove or comment-change ? |
|
612 |
" |
|
613 |
(#(#'methodsFor:' |
|
614 |
#'privateMethodsFor:' |
|
615 |
#'protectedMethodsFor:' |
|
616 |
#'publicMethodsFor:' |
|
617 |
#'removeSelector:' |
|
618 |
#'comment:' |
|
619 |
#'primitiveDefinitions:' |
|
620 |
#'primitiveFunctions:' |
|
621 |
#'primitiveVariables:' |
|
622 |
#'renameCategory:to:' |
|
623 |
#'instanceVariableNames:' |
|
624 |
) includes:sel) ifTrue:[ |
|
625 |
" |
|
626 |
yes, the className is the receiver |
|
627 |
" |
|
628 |
(recTree notNil and:[recTree ~~ #Error]) ifTrue:[ |
|
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
629 |
isMeta := false. |
202 | 630 |
recTree isUnaryMessage ifTrue:[ |
631 |
(recTree selector ~~ #class) ifTrue:[^ nil]. |
|
632 |
"id class methodsFor:..." |
|
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
633 |
recTree := recTree receiver. |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
634 |
isMeta := true. |
202 | 635 |
]. |
636 |
recTree isPrimary ifTrue:[ |
|
637 |
name := recTree name. |
|
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
638 |
isMeta ifTrue:[ |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
639 |
name := name , ' class'. |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
640 |
]. |
202 | 641 |
changeClassNames at:changeNr put:name. |
642 |
^ name |
|
643 |
] |
|
644 |
]. |
|
645 |
"more strange things" |
|
646 |
^ nil |
|
647 |
]. |
|
648 |
||
649 |
" |
|
650 |
is it a change in a class-description ? |
|
651 |
" |
|
652 |
(('subclass:*' match:sel) |
|
653 |
or:[('variable*subclass:*' match:sel)]) ifTrue:[ |
|
654 |
arg1Tree := aParseTree arg1. |
|
655 |
(arg1Tree notNil and:[arg1Tree isConstant]) ifTrue:[ |
|
656 |
name := arg1Tree value asString. |
|
657 |
changeClassNames at:changeNr put:name. |
|
658 |
^ name |
|
659 |
]. |
|
660 |
"very strange" |
|
661 |
^ nil |
|
662 |
]. |
|
663 |
||
664 |
" |
|
665 |
is it a class remove ? |
|
666 |
" |
|
667 |
(sel == #removeClass:) ifTrue:[ |
|
668 |
(recTree notNil |
|
669 |
and:[recTree ~~ #Error |
|
670 |
and:[recTree isPrimary |
|
671 |
and:[recTree name = 'Smalltalk']]]) ifTrue:[ |
|
672 |
arg1Tree := aParseTree arg1. |
|
673 |
(arg1Tree notNil and:[arg1Tree isPrimary]) ifTrue:[ |
|
674 |
name := arg1Tree name. |
|
675 |
changeClassNames at:changeNr put:name. |
|
676 |
^ name |
|
677 |
]. |
|
678 |
] |
|
679 |
]. |
|
680 |
||
681 |
" |
|
682 |
is it a method category change ? |
|
683 |
" |
|
684 |
(sel == #category:) ifTrue:[ |
|
685 |
(recTree notNil |
|
686 |
and:[recTree ~~ #Error |
|
687 |
and:[recTree isMessage |
|
688 |
and:[recTree selector == #compiledMethodAt:]]]) ifTrue:[ |
|
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
689 |
isMeta := false. |
202 | 690 |
recTree := recTree receiver. |
691 |
recTree isUnaryMessage ifTrue:[ |
|
692 |
(recTree selector ~~ #class) ifTrue:[^ nil]. |
|
693 |
"id class " |
|
694 |
recTree := recTree receiver |
|
695 |
]. |
|
696 |
recTree isPrimary ifTrue:[ |
|
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
697 |
isMeta ifTrue:[ |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
698 |
name := name , ' class'. |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
699 |
]. |
202 | 700 |
name := recTree name. |
701 |
changeClassNames at:changeNr put:name. |
|
702 |
^ name |
|
703 |
] |
|
704 |
] |
|
705 |
]. |
|
706 |
^ nil |
|
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
707 |
|
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
708 |
"Modified: 6.12.1995 / 17:08:22 / cg" |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
709 |
! |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
710 |
|
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
711 |
classNameOfChange:changeNr |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
712 |
"return the classname of a change |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
713 |
(for classChanges (i.e. xxx class), the non-metaClassName (i.e. xxx) is returned)" |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
714 |
|
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
715 |
|name| |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
716 |
|
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
717 |
name := self fullClassNameOfChange:changeNr. |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
718 |
name isNil ifTrue:[^ nil]. |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
719 |
(name endsWith:' class') ifTrue:[ |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
720 |
^ name copyWithoutLast:6 |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
721 |
]. |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
722 |
^ name |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
723 |
|
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
724 |
"Modified: 6.12.1995 / 17:06:31 / cg" |
202 | 725 |
! |
726 |
||
727 |
clearCodeView |
|
728 |
self unselect "changeListView deselect". |
|
729 |
codeView contents:nil. |
|
730 |
changeNrShown := nil |
|
731 |
! |
|
732 |
||
733 |
compareChange:changeNr |
|
734 |
"compare a change with current version" |
|
735 |
||
736 |
|aStream chunk sawExcla parseTree thisClass cat oldSource newSource |
|
737 |
parser sel oldMethod outcome showDiff d t1 t2| |
|
738 |
||
739 |
aStream := self streamForChange:changeNr. |
|
740 |
aStream isNil ifTrue:[^ self]. |
|
741 |
||
742 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
|
743 |
chunk := aStream nextChunk. |
|
744 |
sawExcla ifFalse:[ |
|
207
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
745 |
outcome := 'not comparable ...' |
202 | 746 |
] ifTrue:[ |
207
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
747 |
parseTree := Parser parseExpression:chunk. |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
748 |
(parseTree notNil and:[parseTree isMessage]) ifTrue:[ |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
749 |
(parseTree selector == #methodsFor:) ifTrue:[ |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
750 |
thisClass := (parseTree receiver evaluate). |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
751 |
thisClass isBehavior ifTrue:[ |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
752 |
showDiff := false. |
202 | 753 |
|
207
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
754 |
cat := parseTree arg1 evaluate. |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
755 |
newSource := aStream nextChunk. |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
756 |
parser := Parser parseMethod:newSource in:thisClass. |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
757 |
(parser notNil and:[parser ~~ #Error]) ifTrue:[ |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
758 |
sel := parser selector. |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
759 |
oldMethod := thisClass compiledMethodAt:sel. |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
760 |
oldMethod notNil ifTrue:[ |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
761 |
(oldMethod category = cat) ifFalse:[ |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
762 |
Transcript showCr:'category changed.'. |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
763 |
]. |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
764 |
oldSource := oldMethod source. |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
765 |
(oldSource = newSource) ifTrue:[ |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
766 |
outcome := 'same source' |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
767 |
] ifFalse:[ |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
768 |
oldSource isNil ifTrue:[ |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
769 |
outcome := 'no source for compare.' |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
770 |
] ifFalse:[ |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
771 |
"/ |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
772 |
"/ compare for tabulator <-> space changes |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
773 |
"/ before showing diff ... |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
774 |
"/ |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
775 |
t1 := oldSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
776 |
t2 := newSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
777 |
t1 = t2 ifTrue:[ |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
778 |
outcome := 'same source' |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
779 |
] ifFalse:[ |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
780 |
outcome := 'source changed.'. |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
781 |
showDiff := true |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
782 |
] |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
783 |
] |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
784 |
] |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
785 |
] ifFalse:[ |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
786 |
outcome := 'method does not exist.' |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
787 |
] |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
788 |
] ifFalse:[ |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
789 |
outcome := 'change unparsable.' |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
790 |
]. |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
791 |
(showDiff and:[oldSource notNil and:[newSource notNil]]) ifTrue:[ |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
792 |
d := DiffTextView |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
793 |
openOn:oldSource label:'current version' |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
794 |
and:newSource label:'changeFile version'. |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
795 |
d label:'method differences'. |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
796 |
] |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
797 |
] ifFalse:[ |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
798 |
outcome := 'class does not exist.' |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
799 |
] |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
800 |
] ifFalse:[ |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
801 |
outcome := 'not comparable.' |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
802 |
] |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
803 |
] ifFalse:[ |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
804 |
outcome := 'not comparable.' |
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
805 |
] |
202 | 806 |
]. |
807 |
aStream close. |
|
808 |
showDiff ifFalse:[ |
|
207
8729533e8607
nobody likes class browsers - better open a full one
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
809 |
self information:outcome. |
202 | 810 |
"/ Transcript showCr:outcome. |
811 |
]. |
|
206
5d1e6d46ecbd
expand tabs when comparing (to show '=' in left col)
Claus Gittinger <cg@exept.de>
parents:
202
diff
changeset
|
812 |
|
5d1e6d46ecbd
expand tabs when comparing (to show '=' in left col)
Claus Gittinger <cg@exept.de>
parents:
202
diff
changeset
|
813 |
"Created: 24.11.1995 / 14:30:46 / cg" |
202 | 814 |
! |
815 |
||
816 |
contractClass:className selector:selector to:maxLen |
|
817 |
|s l| |
|
818 |
||
819 |
s := className , ' ', selector. |
|
820 |
s size > maxLen ifTrue:[ |
|
821 |
l := maxLen - 1 - selector size max:20. |
|
822 |
s := (className contractTo:l) , ' ' , selector. |
|
823 |
||
824 |
s size > maxLen ifTrue:[ |
|
825 |
l := maxLen - 1 - className size max:20. |
|
826 |
s := className , ' ', (selector contractTo:l). |
|
827 |
||
828 |
s size > maxLen ifTrue:[ |
|
829 |
s := (className contractTo:(maxLen // 2 - 1)) , ' ' , (selector contractTo:maxLen // 2) |
|
830 |
] |
|
831 |
] |
|
832 |
]. |
|
833 |
^ s |
|
834 |
! |
|
835 |
||
836 |
deleteChange:changeNr |
|
837 |
"delete a change" |
|
838 |
||
225 | 839 |
self deleteChangesFrom:changeNr to:changeNr |
202 | 840 |
! |
841 |
||
842 |
deleteChangesFrom:start to:stop |
|
843 |
"delete a range of changes" |
|
844 |
||
845 |
changeListView deselect. |
|
846 |
stop to:start by:-1 do:[:changeNr | |
|
847 |
self silentDeleteChange:changeNr |
|
848 |
]. |
|
849 |
self setChangeList |
|
850 |
||
851 |
! |
|
852 |
||
853 |
makeChangeAPatch:changeNr |
|
854 |
"append change to patchfile" |
|
855 |
||
856 |
self appendChange:changeNr toFile:'patches' |
|
857 |
! |
|
858 |
||
859 |
makeChangePermanent:changeNr |
|
860 |
"rewrite the source file where change changeNr lies" |
|
861 |
||
862 |
self notify:'this is not yet implemented' |
|
863 |
! |
|
864 |
||
865 |
newLabel:how |
|
866 |
|l| |
|
867 |
||
868 |
(changeFileName ~= 'changes') ifTrue:[ |
|
869 |
l := 'Changes Browser: ', changeFileName |
|
870 |
] ifFalse:[ |
|
871 |
l := 'Changes Browser' |
|
872 |
]. |
|
873 |
l := l , ' ' , how. |
|
874 |
self label:l |
|
875 |
||
876 |
"Created: 8.9.1995 / 19:32:04 / claus" |
|
877 |
"Modified: 8.9.1995 / 19:39:29 / claus" |
|
878 |
! |
|
879 |
||
880 |
queryCloseText |
|
881 |
"made this a method for easy redefinition in subclasses" |
|
882 |
||
883 |
^ 'Quit without updating changeFile ?' |
|
884 |
! |
|
885 |
||
886 |
readChangesFile |
|
887 |
"read the changes file, create a list of header-lines (changeChunks) |
|
888 |
and a list of chunk-positions (changePositions)" |
|
889 |
||
890 |
^ self readChangesFileInBackground:false |
|
891 |
! |
|
892 |
||
37 | 893 |
readChangesFileInBackground:inBackground |
894 |
"read the changes file, create a list of header-lines (changeChunks) |
|
51 | 895 |
and a list of chunk-positions (changePositions). |
896 |
Starting with 2.10.3, the entries are multi-col entries; |
|
897 |
the cols are: |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
898 |
1 delta (only if comparing) |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
899 |
'+' -> new method (w.r.t. current state) |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
900 |
'-' -> removed method (w.r.t. current state) |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
901 |
'?' -> class does not exist currently |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
902 |
'=' -> change is same as current methods source |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
903 |
2 class/selector |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
904 |
3 type of change |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
905 |
doit |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
906 |
method |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
907 |
category change |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
908 |
4 timestamp |
89 | 909 |
|
910 |
since comparing slows down startup time, it is now disabled by |
|
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
911 |
default and can be enabled via a toggle." |
37 | 912 |
|
133 | 913 |
|aStream maxLen f| |
50 | 914 |
|
221 | 915 |
self newLabel:'updating ...'. |
916 |
||
50 | 917 |
maxLen := 60. |
0 | 918 |
|
133 | 919 |
f := changeFileName asFilename. |
920 |
aStream := f readStream. |
|
0 | 921 |
aStream isNil ifTrue:[^ nil]. |
922 |
||
133 | 923 |
changeFileSize := f info at:#size. |
924 |
changeFileTimestamp := f info at:#modified. |
|
925 |
||
0 | 926 |
self withCursor:(Cursor read) do:[ |
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
927 |
|myProcess myPriority| |
49 | 928 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
929 |
" |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
930 |
this is a time consuming operation (especially, if reading an |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
931 |
NFS-mounted directory; therefore lower my priority ... |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
932 |
" |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
933 |
inBackground ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
934 |
myProcess := Processor activeProcess. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
935 |
myPriority := myProcess priority. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
936 |
myProcess priority:(Processor userBackgroundPriority). |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
937 |
]. |
51 | 938 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
939 |
[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
940 |
|excla timeStampInfo| |
50 | 941 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
942 |
changeChunks := OrderedCollection new. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
943 |
changeHeaderLines := OrderedCollection new. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
944 |
changePositions := OrderedCollection new. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
945 |
changeTimeStamps := OrderedCollection new. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
946 |
excla := aStream class chunkSeparator. |
0 | 947 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
948 |
[aStream atEnd] whileFalse:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
949 |
|entry changeDelta changeString changeType |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
950 |
line s l changeClass sawExcla category |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
951 |
chunkText chunkPos sel| |
51 | 952 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
953 |
" |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
954 |
get a chunk (separated by excla) |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
955 |
" |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
956 |
aStream skipSeparators. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
957 |
chunkPos := aStream position. |
73 | 958 |
|
959 |
||
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
960 |
sawExcla := aStream peekFor:excla. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
961 |
chunkText := aStream nextChunk. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
962 |
chunkText notNil ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
963 |
|index headerLine| |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
964 |
|
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
965 |
(chunkText startsWith:'''---- timestamp ') ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
966 |
timeStampInfo := (chunkText copyFrom:16 to:(chunkText size - 6)) withoutSpaces. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
967 |
] ifFalse:[ |
51 | 968 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
969 |
" |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
970 |
only first line is saved in changeChunks ... |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
971 |
" |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
972 |
index := chunkText indexOf:(Character cr). |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
973 |
(index ~~ 0) ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
974 |
chunkText := chunkText copyTo:(index - 1). |
45 | 975 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
976 |
"take care for comment changes - must still be a |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
977 |
valid expression for classNameOfChange: to work" |
50 | 978 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
979 |
(chunkText endsWith:'comment:''') ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
980 |
chunkText := chunkText , '...''' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
981 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
982 |
(chunkText endsWith:'primitiveDefinitions:''') ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
983 |
sel := 'primitiveDefinitions:'. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
984 |
chunkText := chunkText copyWithoutLast:1 |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
985 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
986 |
(chunkText endsWith:'primitiveVariables:''') ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
987 |
sel := 'primitiveVariables:'. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
988 |
chunkText := chunkText copyWithoutLast:1 |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
989 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
990 |
(chunkText endsWith:'primitiveFunctions:''') ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
991 |
sel := 'primitiveFunctions:'. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
992 |
chunkText := chunkText copyWithoutLast:1 |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
993 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
994 |
]. |
51 | 995 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
996 |
changeChunks add:chunkText. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
997 |
changePositions add:chunkPos. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
998 |
changeTimeStamps add:timeStampInfo. |
37 | 999 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1000 |
headerLine := nil. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1001 |
changeDelta := ' '. |
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1002 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1003 |
sawExcla ifFalse:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1004 |
(chunkText startsWith:'''---- snap') ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1005 |
changeType := ''. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1006 |
headerLine := chunkText. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1007 |
changeString := (chunkText contractTo:maxLen). |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1008 |
] ifFalse:[ |
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1009 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1010 |
|p cls| |
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1011 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1012 |
headerLine := chunkText , ' (doIt)'. |
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1013 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1014 |
" |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1015 |
first, assume doIt - then lets have a more detailed look ... |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1016 |
" |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1017 |
(chunkText startsWith:'''---- file') ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1018 |
changeType := ''. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1019 |
] ifFalse:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1020 |
changeType := '(doIt)'. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1021 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1022 |
changeString := (chunkText contractTo:maxLen). |
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1023 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1024 |
p := Parser parseExpression:chunkText. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1025 |
(p notNil |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1026 |
and:[p ~~ #Error |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1027 |
and:[p isMessage]]) ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1028 |
sel := p selector. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1029 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1030 |
(sel == #removeSelector:) ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1031 |
p receiver isUnaryMessage ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1032 |
cls := p receiver receiver name. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1033 |
changeClass := (Smalltalk classNamed:cls) class. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1034 |
cls := cls , ' class'. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1035 |
] ifFalse:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1036 |
cls := p receiver name. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1037 |
changeClass := (Smalltalk classNamed:cls) |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1038 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1039 |
sel := (p args at:1) evaluate. |
50 | 1040 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1041 |
compareChanges ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1042 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1043 |
changeDelta := '?' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1044 |
] ifFalse:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1045 |
(changeClass implements:sel asSymbol) ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1046 |
changeDelta := '-'. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1047 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1048 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1049 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1050 |
changeType := '(remove)'. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1051 |
changeString := self contractClass:cls selector:sel to:maxLen. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1052 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1053 |
(p ~~ #Error |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1054 |
and:[p isMessage |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1055 |
and:[p receiver isMessage |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1056 |
and:[p receiver selector == #compiledMethodAt:]]]) ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1057 |
p receiver receiver isUnaryMessage ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1058 |
cls := p receiver receiver receiver name. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1059 |
changeClass := (Smalltalk classNamed:cls) class. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1060 |
cls := cls , ' class'. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1061 |
] ifFalse:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1062 |
cls := p receiver receiver name. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1063 |
changeClass := (Smalltalk classNamed:cls) |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1064 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1065 |
(sel == #category:) ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1066 |
sel := (p receiver args at:1) evaluate. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1067 |
changeType := '(category change)'. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1068 |
changeString := self contractClass:cls selector:sel to:maxLen. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1069 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1070 |
(sel == #privacy:) ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1071 |
sel := (p receiver args at:1) evaluate. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1072 |
changeType := '(privacy change)'. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1073 |
changeString := self contractClass:cls selector:sel to:maxLen. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1074 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1075 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1076 |
(#(#'subclass:' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1077 |
#'variableSubclass:' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1078 |
#'variableByteSubclass:' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1079 |
#'variableWordSubclass:' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1080 |
#'variableLongSubclass:' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1081 |
#'variableFloatSubclass:' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1082 |
#'variableDoubleSubclass:' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1083 |
#'primitiveDefinitions:' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1084 |
#'primitiveFunctions:' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1085 |
#'primitiveVariables:' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1086 |
) includes:sel) ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1087 |
changeType := '(class definition)'. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1088 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1089 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1090 |
] ifTrue:[ "sawExcla" |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1091 |
|done first p cls text| |
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1092 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1093 |
" |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1094 |
method definitions actually consist of |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1095 |
two (or more) chunks; skip next chunk(s) |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1096 |
up to an empty one. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1097 |
The system only writes one chunk, |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1098 |
and we cannot handle more in this ChangesBrowser .... |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1099 |
" |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1100 |
cls := nil. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1101 |
p := Parser parseExpression:chunkText. |
89 | 1102 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1103 |
(p notNil and:[p ~~ #Error]) ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1104 |
sel := p selector. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1105 |
(sel == #methodsFor:) ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1106 |
p receiver isUnaryMessage ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1107 |
cls := p receiver receiver name. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1108 |
changeClass := (Smalltalk classNamed:cls) class. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1109 |
cls := cls , ' class'. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1110 |
] ifFalse:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1111 |
cls := p receiver name. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1112 |
changeClass := Smalltalk classNamed:cls |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1113 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1114 |
category := (p args at:1) evaluate. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1115 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1116 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1117 |
done := false. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1118 |
first := true. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1119 |
[done] whileFalse:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1120 |
text := aStream nextChunk. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1121 |
text isNil ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1122 |
done := true |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1123 |
] ifFalse:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1124 |
done := text isEmpty |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1125 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1126 |
done ifFalse:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1127 |
first ifFalse:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1128 |
Transcript showCr:'only one method per ''methodsFor:'' handled'. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1129 |
] ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1130 |
first := false. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1131 |
" |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1132 |
try to find the selector |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1133 |
" |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1134 |
sel := nil. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1135 |
cls notNil ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1136 |
p := Parser |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1137 |
parseMethodSpecification:text |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1138 |
in:nil |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1139 |
ignoreErrors:true |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1140 |
ignoreWarnings:true. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1141 |
(p notNil and:[p ~~ #Error]) ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1142 |
sel := p selector. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1143 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1144 |
]. |
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1145 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1146 |
sel isNil ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1147 |
changeString := (chunkText contractTo:maxLen). |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1148 |
changeType := '(change)'. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1149 |
] ifFalse:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1150 |
changeString := self contractClass:cls selector:sel to:maxLen. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1151 |
changeType := '(method in: ''' , category , ''')'. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1152 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1153 |
sel isNil ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1154 |
headerLine := chunkText , ' (change)'. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1155 |
] ifFalse:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1156 |
headerLine := cls , ' ' , sel , ' ' , '(change category: ''' , category , ''')'. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1157 |
]. |
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1158 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1159 |
compareChanges ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1160 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1161 |
changeDelta := '?' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1162 |
] ifFalse:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1163 |
(changeClass implements:sel asSymbol) ifFalse:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1164 |
changeDelta := '+'. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1165 |
] ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1166 |
|m currentText t1 t2| |
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1167 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1168 |
m := changeClass compiledMethodAt:sel asSymbol. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1169 |
currentText := m source. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1170 |
currentText notNil ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1171 |
text asString = currentText asString ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1172 |
changeDelta := '=' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1173 |
] ifFalse:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1174 |
t1 := currentText asCollectionOfLines collect:[:s | s withTabsExpanded]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1175 |
t2 := text asCollectionOfLines collect:[:s | s withTabsExpanded]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1176 |
t1 = t2 ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1177 |
changeDelta := '=' |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1178 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1179 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1180 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1181 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1182 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1183 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1184 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1185 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1186 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1187 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1188 |
changeString notNil ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1189 |
entry := MultiColListEntry new. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1190 |
entry tabulatorSpecification:tabSpec. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1191 |
entry colAt:1 put:changeDelta. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1192 |
entry colAt:2 put:changeString. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1193 |
entry colAt:3 put:changeType. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1194 |
entry colAt:4 put:timeStampInfo. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1195 |
changeHeaderLines add:entry |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1196 |
] ifFalse:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1197 |
headerLine notNil ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1198 |
changeHeaderLines add:headerLine |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1199 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1200 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1201 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1202 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1203 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1204 |
changeClassNames := OrderedCollection new grow:(changeChunks size). |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1205 |
aStream close. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1206 |
anyChanges := false |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1207 |
] valueNowOrOnUnwindDo:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1208 |
inBackground ifTrue:[myProcess priority:myPriority]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1209 |
]. |
133 | 1210 |
]. |
1211 |
||
1212 |
self checkIfFileHasChanged |
|
123 | 1213 |
|
1214 |
"Modified: 27.8.1995 / 23:06:55 / claus" |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1215 |
"Modified: 3.12.1995 / 18:52:34 / cg" |
45 | 1216 |
! |
37 | 1217 |
|
209
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1218 |
selectorOfMethodChange:changeNr |
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1219 |
"return a changes selector" |
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1220 |
|
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1221 |
|aStream chunk sawExcla parseTree thisClass newSource |
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1222 |
parser sel | |
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1223 |
|
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1224 |
aStream := self streamForChange:changeNr. |
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1225 |
aStream isNil ifTrue:[^ nil]. |
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1226 |
|
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1227 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1228 |
chunk := aStream nextChunk. |
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1229 |
sawExcla ifFalse:[^ nil]. |
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1230 |
parseTree := Parser parseExpression:chunk. |
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1231 |
(parseTree notNil and:[parseTree isMessage]) ifTrue:[ |
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1232 |
(parseTree selector == #methodsFor:) ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1233 |
newSource := aStream nextChunk. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1234 |
parser := Parser parseMethod:newSource. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1235 |
(parser notNil and:[parser ~~ #Error]) ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1236 |
sel := parser selector. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1237 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1238 |
] |
209
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1239 |
]. |
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1240 |
aStream close. |
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1241 |
^ sel |
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1242 |
|
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1243 |
"Created: 24.11.1995 / 14:30:46 / cg" |
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1244 |
"Modified: 24.11.1995 / 23:12:50 / cg" |
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1245 |
! |
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1246 |
|
202 | 1247 |
setChangeList |
1248 |
"extract type-information from changes and stuff into top selection |
|
1249 |
view" |
|
51 | 1250 |
|
202 | 1251 |
changeListView setList:changeHeaderLines expandTabs:false. |
1252 |
"/ changeListView deselect. |
|
51 | 1253 |
! |
1254 |
||
73 | 1255 |
silentDeleteChange:changeNr |
1256 |
"delete a change do not update changeListView" |
|
57 | 1257 |
|
73 | 1258 |
anyChanges := true. |
1259 |
changeChunks removeIndex:changeNr. |
|
1260 |
changePositions removeIndex:changeNr. |
|
1261 |
changeClassNames removeIndex:changeNr. |
|
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1262 |
changeHeaderLines removeIndex:changeNr. |
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1263 |
changeTimeStamps removeIndex:changeNr |
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1264 |
|
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1265 |
"Modified: 18.11.1995 / 17:08:44 / cg" |
45 | 1266 |
! |
1267 |
||
202 | 1268 |
silentDeleteChangesFor:aClassName from:start to:stop |
1269 |
"delete changes for a given class in a range" |
|
45 | 1270 |
|
202 | 1271 |
|thisClassName index| |
45 | 1272 |
|
202 | 1273 |
index := stop. |
1274 |
[index >= start] whileTrue:[ |
|
1275 |
thisClassName := self classNameOfChange:index. |
|
1276 |
thisClassName = aClassName ifTrue:[ |
|
1277 |
self silentDeleteChange:index |
|
51 | 1278 |
]. |
202 | 1279 |
index := index - 1 |
1280 |
] |
|
51 | 1281 |
|
45 | 1282 |
! |
1283 |
||
202 | 1284 |
streamForChange:changeNr |
1285 |
"answer a stream for change" |
|
1286 |
||
1287 |
|aStream| |
|
73 | 1288 |
|
202 | 1289 |
(changeNr between:1 and:changePositions size) ifFalse:[^ nil]. |
1290 |
aStream := FileStream readonlyFileNamed:changeFileName. |
|
1291 |
aStream isNil ifTrue:[^ nil]. |
|
1292 |
aStream position:(changePositions at:changeNr). |
|
1293 |
^ aStream |
|
1294 |
! |
|
1295 |
||
1296 |
unselect |
|
1297 |
"common unselect" |
|
1298 |
||
1299 |
changeListView deselect. |
|
73 | 1300 |
! |
1301 |
||
1302 |
withSelectedChangeDo:aBlock |
|
1303 |
"just a helper, check for a selected change and evaluate aBlock |
|
1304 |
with busy cursor" |
|
1305 |
||
1306 |
|changeNr| |
|
1307 |
||
1308 |
changeNr := changeListView selection. |
|
1309 |
changeNr notNil ifTrue:[ |
|
1310 |
self withCursor:(Cursor execute) do:[ |
|
1311 |
aBlock value:changeNr |
|
1312 |
] |
|
1313 |
] |
|
1314 |
! |
|
1315 |
||
45 | 1316 |
writeBackChanges |
163
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1317 |
"write back the changes file. To avoid problems when the disk is full |
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1318 |
or a crash occurs while writing (well, or someone kills us), |
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1319 |
first write the stuff to a new temporary file. If this works ok, |
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1320 |
rename the old change-file to a .bak file and finally rename the |
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1321 |
tempfile back to the change-file. |
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1322 |
That way, if anything happens, either the original file is left unchanged, |
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1323 |
or we have at least a backup of the previous change file." |
45 | 1324 |
|
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1325 |
|inStream outStream tempfile stamp| |
163
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1326 |
|
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1327 |
tempfile := Filename newTemporaryIn:nil. |
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1328 |
tempfile exists ifTrue:[tempfile remove]. |
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1329 |
|
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1330 |
outStream := tempfile writeStream. |
45 | 1331 |
outStream isNil ifTrue:[ |
163
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1332 |
self warn:'cannot create temporary file in current directory.'. |
45 | 1333 |
^ self |
1334 |
]. |
|
1335 |
||
1336 |
inStream := FileStream readonlyFileNamed:changeFileName. |
|
1337 |
inStream isNil ifTrue:[^ nil]. |
|
1338 |
||
1339 |
self withCursor:(Cursor write) do:[ |
|
51 | 1340 |
|excla sawExcla done dir chunk |
1341 |
nChanges "{Class:SmallInteger}" | |
|
1342 |
||
45 | 1343 |
excla := inStream class chunkSeparator. |
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1344 |
nChanges := self numberOfChanges. |
51 | 1345 |
|
1346 |
1 to:nChanges do:[:index | |
|
45 | 1347 |
inStream position:(changePositions at:index). |
1348 |
sawExcla := inStream peekFor:excla. |
|
1349 |
chunk := inStream nextChunk. |
|
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1350 |
(stamp := changeTimeStamps at:index) notNil ifTrue:[ |
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1351 |
outStream nextPutAll:'''---- timestamp ' , stamp , ' ----'''. |
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1352 |
outStream nextPut:excla; cr. |
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1353 |
]. |
45 | 1354 |
|
1355 |
sawExcla ifTrue:[ |
|
1356 |
outStream nextPut:excla. |
|
1357 |
outStream nextChunkPut:chunk. |
|
1358 |
outStream cr. |
|
51 | 1359 |
" |
1360 |
a method-definition chunk - skip followups |
|
1361 |
" |
|
45 | 1362 |
done := false. |
1363 |
[done] whileFalse:[ |
|
1364 |
chunk := inStream nextChunk. |
|
1365 |
chunk isNil ifTrue:[ |
|
1366 |
done := true |
|
1367 |
] ifFalse:[ |
|
1368 |
outStream nextChunkPut:chunk. |
|
1369 |
outStream cr. |
|
1370 |
done := chunk isEmpty |
|
1371 |
] |
|
1372 |
]. |
|
1373 |
] ifFalse:[ |
|
1374 |
outStream nextChunkPut:chunk. |
|
1375 |
outStream cr |
|
1376 |
] |
|
1377 |
]. |
|
1378 |
outStream close. |
|
1379 |
inStream close. |
|
1380 |
dir := FileDirectory currentDirectory. |
|
163
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1381 |
dir renameFile:changeFileName newName:(changeFileName , '.bak'). |
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1382 |
dir renameFile:tempfile name newName:changeFileName. |
45 | 1383 |
anyChanges := false |
1384 |
] |
|
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1385 |
|
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1386 |
"Modified: 18.11.1995 / 17:12:37 / cg" |
202 | 1387 |
! ! |
0 | 1388 |
|
202 | 1389 |
!ChangesBrowser methodsFor:'termination'! |
51 | 1390 |
|
202 | 1391 |
destroy |
1392 |
"destroy the receiver; make certain, that boxes are destroyed too" |
|
73 | 1393 |
|
202 | 1394 |
Processor removeTimedBlock:checkBlock. |
1395 |
ObjectMemory removeDependent:self. |
|
1396 |
super destroy |
|
51 | 1397 |
! |
1398 |
||
202 | 1399 |
saveAndTerminate |
1400 |
"update the changes file and quit. |
|
1401 |
Dont depend on this being sent, not all window managers |
|
1402 |
send it; instead, they simply destroy the view." |
|
28 | 1403 |
|
202 | 1404 |
anyChanges ifTrue:[ |
1405 |
self writeBackChanges. |
|
0 | 1406 |
]. |
202 | 1407 |
self destroy |
0 | 1408 |
! |
1409 |
||
202 | 1410 |
terminate |
1411 |
"window manager wants us to go away" |
|
28 | 1412 |
|
202 | 1413 |
|action| |
0 | 1414 |
|
202 | 1415 |
anyChanges ifTrue:[ |
1416 |
action := OptionBox |
|
1417 |
request:(resources at:'changefile has not been updated from the modified changelist.\\Update before closing ?') withCRs |
|
1418 |
label:'ChangesBrowser' |
|
1419 |
form:(WarningBox iconBitmap) |
|
1420 |
buttonLabels:(resources array:#('abort' 'don''t update' 'update')) |
|
1421 |
values:#(#abort #ignore #save) |
|
1422 |
default:#save. |
|
1423 |
action == #abort ifTrue:[^ self]. |
|
1424 |
action == #save ifTrue:[ |
|
1425 |
self writeBackChanges |
|
45 | 1426 |
]. |
202 | 1427 |
]. |
1428 |
self destroy |
|
0 | 1429 |
! ! |
1430 |
||
73 | 1431 |
!ChangesBrowser methodsFor:'user interaction'! |
51 | 1432 |
|
221 | 1433 |
autoUpdate:aBoolean |
1434 |
autoUpdate := aBoolean |
|
1435 |
||
1436 |
"Created: 3.12.1995 / 14:14:24 / cg" |
|
1437 |
"Modified: 3.12.1995 / 14:20:45 / cg" |
|
1438 |
! |
|
1439 |
||
0 | 1440 |
changeSelection:lineNr |
1441 |
"show a change in the codeView" |
|
1442 |
||
1443 |
|aStream sawExcla chunk| |
|
1444 |
||
1445 |
aStream := self streamForChange:lineNr. |
|
1446 |
aStream isNil ifTrue:[^ self]. |
|
1447 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
|
1448 |
chunk := aStream nextChunk. |
|
1449 |
sawExcla ifTrue:[ |
|
45 | 1450 |
chunk := aStream nextChunk |
0 | 1451 |
]. |
1452 |
aStream close. |
|
1453 |
codeView contents:chunk. |
|
13 | 1454 |
codeView acceptAction:[:theCode | self doApply "noChangesAllowed"]. |
15 | 1455 |
changeNrShown := lineNr. |
0 | 1456 |
|
51 | 1457 |
! |
1458 |
||
202 | 1459 |
doApply |
1460 |
"user wants a change to be applied" |
|
45 | 1461 |
|
202 | 1462 |
self withSelectedChangeDo:[:changeNr | |
1463 |
skipSignal := nil. |
|
1464 |
self applyChange:changeNr. |
|
1465 |
self autoSelect:(changeNr + 1) |
|
1466 |
] |
|
45 | 1467 |
! |
1468 |
||
202 | 1469 |
doApplyAll |
1470 |
"user wants all changes to be applied" |
|
37 | 1471 |
|
202 | 1472 |
self withCursor:(Cursor execute) do:[ |
1473 |
self clearCodeView. |
|
1474 |
skipSignal isNil ifTrue:[skipSignal := Signal new]. |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1475 |
1 to:(self numberOfChanges) do:[:changeNr | |
202 | 1476 |
changeListView selection:changeNr. |
1477 |
self applyChange:changeNr |
|
1478 |
]. |
|
1479 |
self autoSelectLast |
|
1480 |
] |
|
37 | 1481 |
! |
1482 |
||
202 | 1483 |
doApplyClassRest |
1484 |
"user wants all changes for this class from changeNr to be applied" |
|
1485 |
||
1486 |
self withSelectedChangeDo:[:changeNr | |
|
1487 |
|thisClassName classNameToApply lastChange| |
|
37 | 1488 |
|
202 | 1489 |
classNameToApply := self classNameOfChange:changeNr. |
1490 |
classNameToApply notNil ifTrue:[ |
|
1491 |
self clearCodeView. |
|
1492 |
skipSignal isNil ifTrue:[skipSignal := Signal new]. |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1493 |
changeNr to:(self numberOfChanges) do:[:changeNr | |
202 | 1494 |
thisClassName := self classNameOfChange:changeNr. |
1495 |
thisClassName = classNameToApply ifTrue:[ |
|
1496 |
changeListView selection:changeNr. |
|
1497 |
self applyChange:changeNr. |
|
1498 |
lastChange := changeNr |
|
1499 |
]. |
|
1500 |
]. |
|
1501 |
self autoSelect:lastChange. |
|
1502 |
] |
|
1503 |
] |
|
37 | 1504 |
! |
1505 |
||
202 | 1506 |
doApplyRest |
1507 |
"user wants all changes from changeNr to be applied" |
|
28 | 1508 |
|
202 | 1509 |
self withSelectedChangeDo:[:changeNr | |
1510 |
self clearCodeView. |
|
1511 |
skipSignal isNil ifTrue:[skipSignal := Signal new]. |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1512 |
changeNr to:(self numberOfChanges) do:[:changeNr | |
202 | 1513 |
changeListView selection:changeNr. |
1514 |
self applyChange:changeNr |
|
1515 |
]. |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1516 |
self autoSelect:self numberOfChanges. |
37 | 1517 |
] |
1518 |
! |
|
1519 |
||
45 | 1520 |
doBrowse |
1521 |
"user wants a browser on the class of a change" |
|
1522 |
||
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1523 |
|changeNr className cls isMeta| |
45 | 1524 |
|
1525 |
changeNr := changeListView selection. |
|
1526 |
changeNr notNil ifTrue:[ |
|
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1527 |
className := self fullClassNameOfChange:changeNr. |
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1528 |
className notNil ifTrue:[ |
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1529 |
isMeta := false. |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1530 |
(className endsWith:' class') ifTrue:[ |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1531 |
className := className copyWithoutLast:6. |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1532 |
isMeta := true. |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1533 |
]. |
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1534 |
(cls := Smalltalk classNamed:className) notNil ifTrue:[ |
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1535 |
isMeta ifTrue:[ |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1536 |
cls := cls class |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1537 |
]. |
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1538 |
SystemBrowser |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1539 |
openInClass:cls |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1540 |
selector:(self selectorOfMethodChange:changeNr) |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1541 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1542 |
] |
37 | 1543 |
] |
209
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1544 |
|
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1545 |
"Created: 24.11.1995 / 23:13:24 / cg" |
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1546 |
"Modified: 6.12.1995 / 17:09:26 / cg" |
37 | 1547 |
! |
1548 |
||
73 | 1549 |
doCompare |
1550 |
"compare change with current system version |
|
1551 |
- give a note in transcript" |
|
1552 |
||
1553 |
|changeNr| |
|
1554 |
||
1555 |
changeNr := changeListView selection. |
|
1556 |
changeNr notNil ifTrue:[ |
|
1557 |
self withCursor:(Cursor execute) do:[ |
|
1558 |
self compareChange:changeNr |
|
1559 |
] |
|
1560 |
] |
|
1561 |
! |
|
1562 |
||
45 | 1563 |
doCompress |
1564 |
"compress the change-set; this replaces multiple method-changes by the last |
|
1565 |
(i.e. the most recent) change" |
|
1566 |
||
51 | 1567 |
|aStream searchIndex anyMore deleteSet index |
1568 |
str snapshotProto snapshotPrefix snapshotNameIndex fileName| |
|
45 | 1569 |
|
1570 |
aStream := FileStream readonlyFileNamed:changeFileName. |
|
1571 |
aStream isNil ifTrue:[^ self]. |
|
1572 |
||
221 | 1573 |
self newLabel:'compressing ...'. |
1574 |
||
58 | 1575 |
CompressSnapshotInfo == true ifTrue:[ |
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1576 |
" |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1577 |
get a prototype snapshot record (to be independent of |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1578 |
the actual format .. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1579 |
" |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1580 |
str := WriteStream on:String new. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1581 |
Class addChangeRecordForSnapshot:'foo' to:str. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1582 |
snapshotProto := str contents. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1583 |
snapshotPrefix := snapshotProto copyTo:10. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1584 |
snapshotNameIndex := snapshotProto findString:'foo'. |
58 | 1585 |
]. |
45 | 1586 |
|
1587 |
self withCursor:(Cursor execute) do:[ |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1588 |
|numChanges classes selectors types excla sawExcla |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1589 |
changeNr chunk aParseTree parseTreeChunk |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1590 |
thisClass thisSelector codeChunk codeParser| |
51 | 1591 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1592 |
numChanges := self numberOfChanges. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1593 |
classes := Array new:numChanges. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1594 |
selectors := Array new:numChanges. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1595 |
types := Array new:numChanges. |
45 | 1596 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1597 |
"starting at the end, get the change class and change selector; |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1598 |
collect all in classes / selectors" |
45 | 1599 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1600 |
changeNr := numChanges. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1601 |
excla := aStream class chunkSeparator. |
45 | 1602 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1603 |
[changeNr >= 1] whileTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1604 |
aStream position:(changePositions at:changeNr). |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1605 |
sawExcla := aStream peekFor:excla. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1606 |
chunk := aStream nextChunk. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1607 |
sawExcla ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1608 |
"optimize a bit if multiple methods for same category arrive" |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1609 |
(chunk = parseTreeChunk) ifFalse:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1610 |
aParseTree := Parser parseExpression:chunk. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1611 |
parseTreeChunk := chunk |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1612 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1613 |
(aParseTree notNil |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1614 |
and:[(aParseTree ~~ #Error) |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1615 |
and:[aParseTree isMessage]]) ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1616 |
(aParseTree selector == #methodsFor:) ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1617 |
thisClass := (aParseTree receiver evaluate). |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1618 |
codeChunk := aStream nextChunk. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1619 |
codeParser := Parser |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1620 |
parseMethodSpecification:codeChunk |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1621 |
in:thisClass |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1622 |
ignoreErrors:true |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1623 |
ignoreWarnings:true. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1624 |
(codeParser notNil and:[codeParser ~~ #Error]) ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1625 |
selectors at:changeNr put:(codeParser selector). |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1626 |
classes at:changeNr put:thisClass. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1627 |
types at:changeNr put:#methodsFor |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1628 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1629 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1630 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1631 |
] ifFalse:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1632 |
aParseTree := Parser parseExpression:chunk. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1633 |
parseTreeChunk := chunk. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1634 |
(aParseTree notNil |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1635 |
and:[(aParseTree ~~ #Error) |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1636 |
and:[aParseTree isMessage]]) ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1637 |
(aParseTree selector == #removeSelector:) ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1638 |
selectors at:changeNr put:(aParseTree arg1 value ). |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1639 |
classes at:changeNr put:(aParseTree receiver evaluate). |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1640 |
types at:changeNr put:#removeSelector |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1641 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1642 |
] ifFalse:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1643 |
CompressSnapshotInfo == true ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1644 |
(chunk startsWith:snapshotPrefix) ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1645 |
str := chunk readStream position:snapshotNameIndex. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1646 |
fileName := str upTo:(Character space). |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1647 |
" |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1648 |
kludge to allow use of match-check below |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1649 |
" |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1650 |
selectors at:changeNr put:snapshotPrefix. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1651 |
classes at:changeNr put:fileName. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1652 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1653 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1654 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1655 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1656 |
changeNr := changeNr - 1 |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1657 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1658 |
aStream close. |
45 | 1659 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1660 |
"for all changes, look for another class/selector occurence later |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1661 |
in the list and, if there is one, add change number to the delete set" |
45 | 1662 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1663 |
deleteSet := OrderedCollection new. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1664 |
changeNr := 1. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1665 |
[changeNr < self numberOfChanges] whileTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1666 |
thisClass := classes at:changeNr. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1667 |
thisSelector := selectors at:changeNr. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1668 |
searchIndex := changeNr. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1669 |
anyMore := true. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1670 |
[anyMore] whileTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1671 |
searchIndex := classes indexOf:thisClass |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1672 |
startingAt:(searchIndex + 1). |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1673 |
(searchIndex ~~ 0) ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1674 |
((selectors at:searchIndex) == thisSelector) ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1675 |
thisClass notNil ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1676 |
deleteSet add:changeNr. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1677 |
anyMore := false |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1678 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1679 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1680 |
] ifFalse:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1681 |
anyMore := false |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1682 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1683 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1684 |
changeNr := changeNr + 1 |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1685 |
]. |
45 | 1686 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1687 |
"finally delete what has been found" |
45 | 1688 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1689 |
(deleteSet size > 0) ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1690 |
changeListView deselect. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1691 |
index := deleteSet size. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1692 |
[index > 0] whileTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1693 |
self silentDeleteChange:(deleteSet at:index). |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1694 |
index := index - 1 |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1695 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1696 |
self setChangeList. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1697 |
" |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1698 |
scroll back a bit, if we are left way behind the list |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1699 |
" |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1700 |
changeListView firstLineShown > self numberOfChanges ifTrue:[ |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1701 |
changeListView makeLineVisible:self numberOfChanges |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1702 |
]. |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1703 |
self clearCodeView |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1704 |
] |
221 | 1705 |
]. |
1706 |
self newLabel:''. |
|
1707 |
||
1708 |
"Created: 3.12.1995 / 14:29:54 / cg" |
|
45 | 1709 |
! |
1710 |
||
202 | 1711 |
doDelete |
1712 |
"delete currently selected change" |
|
1713 |
||
1714 |
|changeNr| |
|
73 | 1715 |
|
202 | 1716 |
changeNr := changeListView selection. |
1717 |
changeNr notNil ifTrue:[ |
|
1718 |
self deleteChange:changeNr. |
|
1719 |
self autoSelectOrEnd:changeNr |
|
73 | 1720 |
] |
1721 |
! |
|
1722 |
||
202 | 1723 |
doDeleteClassAll |
1724 |
"delete all changes with same class as currently selected change" |
|
1725 |
||
1726 |
self withSelectedChangeDo:[:changeNr | |
|
1727 |
| classNameToDelete | |
|
45 | 1728 |
|
202 | 1729 |
classNameToDelete := self classNameOfChange:changeNr. |
1730 |
classNameToDelete notNil ifTrue:[ |
|
1731 |
changeListView selection:nil. |
|
1732 |
self silentDeleteChangesFor:classNameToDelete |
|
1733 |
from:1 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1734 |
to:(self numberOfChanges). |
202 | 1735 |
self setChangeList. |
1736 |
self autoSelectOrEnd:changeNr |
|
51 | 1737 |
] |
1738 |
] |
|
1739 |
! |
|
1740 |
||
73 | 1741 |
doDeleteClassRest |
1742 |
"delete rest of changes with same class as currently selected change" |
|
1743 |
||
1744 |
self withSelectedChangeDo:[:changeNr | |
|
1745 |
| classNameToDelete | |
|
1746 |
||
1747 |
classNameToDelete := self classNameOfChange:changeNr. |
|
1748 |
classNameToDelete notNil ifTrue:[ |
|
1749 |
changeListView selection:nil. |
|
1750 |
self silentDeleteChangesFor:classNameToDelete |
|
1751 |
from:changeNr |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1752 |
to:(self numberOfChanges). |
73 | 1753 |
self setChangeList. |
1754 |
self autoSelectOrEnd:changeNr |
|
1755 |
] |
|
1756 |
] |
|
1757 |
! |
|
1758 |
||
202 | 1759 |
doDeleteRest |
1760 |
"delete all changes from current to the end" |
|
51 | 1761 |
|
202 | 1762 |
|changeNr| |
51 | 1763 |
|
202 | 1764 |
changeNr := changeListView selection. |
1765 |
changeNr notNil ifTrue:[ |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1766 |
self deleteChangesFrom:changeNr to:(self numberOfChanges). |
202 | 1767 |
self clearCodeView. |
1768 |
self autoSelectOrEnd:changeNr-1 |
|
51 | 1769 |
] |
132 | 1770 |
! |
1771 |
||
1772 |
doFileoutAndDeleteClassAll |
|
1773 |
"first fileOut the selected changes class then delete all changes |
|
1774 |
for it." |
|
1775 |
||
1776 |
self withSelectedChangeDo:[:changeNr | |
|
1777 |
| className class | |
|
1778 |
||
1779 |
className := self classNameOfChange:changeNr. |
|
1780 |
className notNil ifTrue:[ |
|
1781 |
class := Smalltalk classNamed:className. |
|
1782 |
class notNil ifTrue:[ |
|
1783 |
Class fileOutErrorSignal handle:[:ex | |
|
1784 |
self warn:('fileout failed: ' , ex errorString). |
|
1785 |
] do:[ |
|
1786 |
class fileOut. |
|
1787 |
self doDeleteClassAll |
|
1788 |
]. |
|
1789 |
]. |
|
1790 |
||
1791 |
]. |
|
1792 |
] |
|
1793 |
||
1794 |
"Modified: 6.9.1995 / 17:11:16 / claus" |
|
202 | 1795 |
! |
73 | 1796 |
|
202 | 1797 |
doMakePatch |
1798 |
"user wants a change to be made a patch |
|
1799 |
- copy it over to the patches file" |
|
89 | 1800 |
|
202 | 1801 |
|changeNr| |
89 | 1802 |
|
202 | 1803 |
changeNr := changeListView selection. |
1804 |
changeNr notNil ifTrue:[ |
|
1805 |
self makeChangeAPatch:changeNr. |
|
1806 |
self autoSelect:(changeNr + 1) |
|
1807 |
] |
|
73 | 1808 |
! |
1809 |
||
202 | 1810 |
doMakePermanent |
1811 |
"user wants a change to be made permanent |
|
1812 |
- rewrite the source file where this change has to go" |
|
1813 |
||
1814 |
|yesNoBox| |
|
73 | 1815 |
|
202 | 1816 |
yesNoBox := YesNoBox new. |
1817 |
yesNoBox title:(resources at:'Warning: this operation cannot be undone'). |
|
1818 |
yesNoBox okText:(resources at:'continue'). |
|
1819 |
yesNoBox noText:(resources at:'abort'). |
|
1820 |
yesNoBox okAction:[ |changeNr| |
|
1821 |
||
1822 |
changeNr := changeListView selection. |
|
1823 |
changeNr notNil ifTrue:[ |
|
1824 |
self makeChangePermanent:changeNr. |
|
1825 |
self autoSelect:(changeNr + 1) |
|
1826 |
] |
|
1827 |
]. |
|
1828 |
yesNoBox showAtPointer |
|
73 | 1829 |
! |
1830 |
||
202 | 1831 |
doSave |
1832 |
"user wants a change to be appended to a file" |
|
73 | 1833 |
|
202 | 1834 |
|changeNr fileName| |
73 | 1835 |
|
202 | 1836 |
changeNr := changeListView selection. |
1837 |
changeNr notNil ifTrue:[ |
|
1838 |
fileName := Dialog |
|
1839 |
requestFileName:'append change to:' |
|
1840 |
default:'' |
|
1841 |
ok:'append' |
|
1842 |
abort:'abort' |
|
1843 |
pattern:'*.chg'. |
|
1844 |
||
1845 |
fileName notNil ifTrue:[ |
|
1846 |
self withCursor:(Cursor write) do:[ |
|
1847 |
self appendChange:changeNr toFile:fileName. |
|
1848 |
]. |
|
1849 |
self autoSelect:(changeNr + 1) |
|
73 | 1850 |
]. |
202 | 1851 |
] |
73 | 1852 |
! |
1853 |
||
202 | 1854 |
doSaveClass |
1855 |
"user wants changes for some class from current to end to be appended to a file" |
|
89 | 1856 |
|
202 | 1857 |
self doSaveClassFrom:1 |
89 | 1858 |
! |
1859 |
||
202 | 1860 |
doSaveClassAll |
1861 |
"user wants changes for some class from current to end to be appended to a file" |
|
73 | 1862 |
|
202 | 1863 |
self doSaveClassFrom:1 |
1864 |
! |
|
1865 |
||
1866 |
doSaveClassFrom:startNr |
|
1867 |
"user wants changes from current to end to be appended to a file" |
|
1868 |
||
1869 |
|changeNr classNameToSave| |
|
73 | 1870 |
|
202 | 1871 |
changeNr := changeListView selection. |
1872 |
changeNr notNil ifTrue:[ |
|
1873 |
classNameToSave := self classNameOfChange:changeNr. |
|
1874 |
classNameToSave notNil ifTrue:[ |
|
1875 |
self saveClass:classNameToSave from:startNr |
|
1876 |
] |
|
1877 |
] |
|
1878 |
! |
|
73 | 1879 |
|
202 | 1880 |
doSaveClassRest |
1881 |
"user wants changes for some class from current to end to be appended to a file" |
|
73 | 1882 |
|
202 | 1883 |
|changeNr| |
132 | 1884 |
|
202 | 1885 |
changeNr := changeListView selection. |
1886 |
changeNr notNil ifTrue:[ |
|
1887 |
self doSaveClassFrom:changeNr |
|
1888 |
] |
|
81 | 1889 |
! |
1890 |
||
202 | 1891 |
doSaveRest |
1892 |
"user wants changes from current to end to be appended to a file" |
|
73 | 1893 |
|
202 | 1894 |
|changeNr fileName| |
51 | 1895 |
|
202 | 1896 |
changeNr := changeListView selection. |
1897 |
changeNr notNil ifTrue:[ |
|
1898 |
fileName := Dialog |
|
1899 |
requestFileName:'append changes to:' |
|
1900 |
default:'' |
|
1901 |
ok:'append' |
|
1902 |
abort:'abort' |
|
1903 |
pattern:'*.chg'. |
|
51 | 1904 |
|
202 | 1905 |
fileName notNil ifTrue:[ |
1906 |
self withCursor:(Cursor write) do:[ |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1907 |
changeNr to:(self numberOfChanges) do:[:changeNr | |
202 | 1908 |
changeListView selection:changeNr. |
1909 |
(self appendChange:changeNr toFile:fileName) ifFalse:[ |
|
1910 |
^ self |
|
1911 |
] |
|
1912 |
] |
|
1913 |
] |
|
73 | 1914 |
]. |
202 | 1915 |
] |
51 | 1916 |
! |
1917 |
||
202 | 1918 |
doUpdate |
1919 |
"reread the changes-file" |
|
51 | 1920 |
|
202 | 1921 |
self readChangesFileInBackground:true. |
1922 |
realized ifTrue:[ |
|
1923 |
self setChangeList. |
|
1924 |
] |
|
1925 |
||
51 | 1926 |
! |
1927 |
||
202 | 1928 |
doWriteBack |
1929 |
"write back the list onto the changes file" |
|
51 | 1930 |
|
1931 |
anyChanges ifTrue:[ |
|
1932 |
self writeBackChanges. |
|
202 | 1933 |
realized ifTrue:[ |
1934 |
self readChangesFileInBackground:false. |
|
1935 |
realized ifTrue:[ |
|
1936 |
self setChangeList |
|
1937 |
] |
|
1938 |
] |
|
1939 |
] |
|
1940 |
! |
|
126 | 1941 |
|
202 | 1942 |
noChangesAllowed |
1943 |
"show a warning that changes cannot be changed" |
|
93 | 1944 |
|
202 | 1945 |
self warn:'changes are not allowed to be changed' |
0 | 1946 |
! |
1947 |
||
202 | 1948 |
saveClass:aClassName from:startNr |
1949 |
"user wants changes from current to end to be appended to a file" |
|
51 | 1950 |
|
202 | 1951 |
|changeNr fileName| |
51 | 1952 |
|
202 | 1953 |
changeNr := changeListView selection. |
1954 |
changeNr notNil ifTrue:[ |
|
1955 |
fileName := Dialog |
|
1956 |
requestFileName:'append changes for class to:' |
|
1957 |
default:'' |
|
1958 |
ok:'append' |
|
1959 |
abort:'abort' |
|
1960 |
pattern:'*.chg'. |
|
0 | 1961 |
|
202 | 1962 |
fileName notNil ifTrue:[ |
1963 |
self withCursor:(Cursor write) do:[ |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1964 |
startNr to:(self numberOfChanges) do:[:changeNr | |
202 | 1965 |
|thisClassName| |
0 | 1966 |
|
202 | 1967 |
thisClassName := self classNameOfChange:changeNr. |
1968 |
thisClassName = aClassName ifTrue:[ |
|
1969 |
changeListView selection:changeNr. |
|
1970 |
(self appendChange:changeNr toFile:fileName) ifFalse:[ |
|
1971 |
^ self |
|
1972 |
] |
|
1973 |
] |
|
1974 |
] |
|
1975 |
] |
|
45 | 1976 |
]. |
202 | 1977 |
] |
1978 |
! ! |
|
0 | 1979 |
|
202 | 1980 |
!ChangesBrowser class methodsFor:'documentation'! |
1981 |
||
1982 |
version |
|
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1983 |
^ '$Header: /cvs/stx/stx/libtool/ChangesBrowser.st,v 1.58 1995-12-06 16:14:40 cg Exp $'! ! |