author | Claus Gittinger <cg@exept.de> |
Wed, 17 Sep 1997 19:57:43 +0200 | |
changeset 1321 | 3bbc90790749 |
parent 1316 | 3fefcc2e9b16 |
child 1359 | 17bc3051f5d7 |
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 |
|
275
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
14 |
instanceVariableNames:'changeListView codeView changeFileName changeChunks |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
15 |
changePositions changeClassNames changeHeaderLines |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
16 |
changeIsFollowupMethodChange anyChanges changeNrShown |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
17 |
changeNrProcessed skipSignal compareChanges compareCheckBox |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
18 |
changeFileSize changeFileTimestamp checkBlock changeTimeStamps |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
19 |
tabSpec autoUpdate editingClassSource' |
275
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
20 |
classVariableNames:'CompressSnapshotInfo' |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
21 |
poolDictionaries:'' |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
22 |
category:'Interface-Browsers' |
0 | 23 |
! |
24 |
||
761 | 25 |
!ChangesBrowser class methodsFor:'documentation'! |
29 | 26 |
|
27 |
copyright |
|
28 |
" |
|
29 |
COPYRIGHT (c) 1990 by Claus Gittinger |
|
45 | 30 |
All Rights Reserved |
0 | 31 |
|
29 | 32 |
This software is furnished under a license and may be used |
33 |
only in accordance with the terms of that license and with the |
|
34 |
inclusion of the above copyright notice. This software may not |
|
35 |
be provided or otherwise made available to, or used by, any |
|
36 |
other person. No title to or ownership of the software is |
|
37 |
hereby transferred. |
|
38 |
" |
|
39 |
! |
|
40 |
||
41 |
documentation |
|
42 |
" |
|
43 |
this implements a browser for the changes-file. |
|
44 |
See the extra document 'doc/misc/cbrowser.doc' for how to use this browser. |
|
45 |
||
46 |
written jan 90 by claus |
|
51 | 47 |
|
508 | 48 |
[Class variables:] |
49 |
CompressSnapshotInfo if true (the default), snapshot entries |
|
50 |
are also compressed in the compress function. |
|
51 |
Some users prefer them to be not compressed. |
|
52 |
Set it to false for this. |
|
58 | 53 |
|
51 | 54 |
Notice: |
508 | 55 |
this needs a total rewrite, to build up a changeSet from the file |
56 |
(which did not exist when the ChangesBrowser was originally written) |
|
57 |
and manipulate that changeSet. |
|
123 | 58 |
|
508 | 59 |
This way, we get a browser for any upcoming incore changeSets for |
60 |
free. Also, this will put the chunk analyzation code into Change and |
|
61 |
subclasses (where it belongs) and give a better encapsulation and |
|
62 |
overall structure. Do not take this as an example for good style ;-) |
|
63 |
||
64 |
[author:] |
|
65 |
Claus Gittinger |
|
66 |
||
67 |
[start with:] |
|
68 |
ChangesBrowser open |
|
29 | 69 |
" |
70 |
! ! |
|
0 | 71 |
|
761 | 72 |
!ChangesBrowser class methodsFor:'instance creation'! |
45 | 73 |
|
74 |
new |
|
75 |
"create a new changes browser" |
|
76 |
||
77 |
^ super label:'Changes Browser' |
|
489 | 78 |
icon:(self defaultIcon) |
79 |
||
80 |
"Modified: 19.4.1996 / 16:30:45 / cg" |
|
45 | 81 |
! |
82 |
||
83 |
openOn:aFileName |
|
84 |
"create c changes browser on a change file" |
|
85 |
||
489 | 86 |
^ ((self new label:'Changes Browser: ', aFileName) |
87 |
changeFileName:aFileName) open |
|
88 |
||
89 |
"Modified: 19.4.1996 / 16:31:16 / cg" |
|
45 | 90 |
! ! |
91 |
||
761 | 92 |
!ChangesBrowser class methodsFor:'behavior'! |
0 | 93 |
|
94 |
autoSelectNext |
|
95 |
"returning true here, makes a Delete operation automatically |
|
96 |
select the next change" |
|
97 |
||
98 |
^ true |
|
99 |
! ! |
|
100 |
||
761 | 101 |
!ChangesBrowser class methodsFor:'defaults'! |
0 | 102 |
|
489 | 103 |
defaultIcon |
1153 | 104 |
"return the browsers default window icon" |
105 |
||
106 |
<resource: #style (#ICON #ICON_FILE)> |
|
107 |
||
108 |
|nm i| |
|
109 |
||
110 |
(i := DefaultIcon) isNil ifTrue:[ |
|
111 |
i := self classResources at:'ICON' default:nil. |
|
112 |
i isNil ifTrue:[ |
|
113 |
nm := ClassResources at:'ICON_FILE' default:'CBrowser.xbm'. |
|
114 |
i := Image fromFile:nm resolution:100. |
|
115 |
i isNil ifTrue:[ |
|
116 |
i := Image fromFile:('bitmaps/' , nm) resolution:100. |
|
117 |
i isNil ifTrue:[ |
|
118 |
i := StandardSystemView defaultIcon |
|
119 |
] |
|
120 |
] |
|
121 |
]. |
|
122 |
i notNil ifTrue:[ |
|
123 |
DefaultIcon := i := i on:Display |
|
124 |
] |
|
1084 | 125 |
]. |
126 |
^ i |
|
127 |
||
1153 | 128 |
"Modified: 19.3.1997 / 20:48:34 / ca" |
129 |
"Modified: 18.4.1997 / 15:16:24 / cg" |
|
489 | 130 |
! |
131 |
||
73 | 132 |
defaultLabel |
133 |
^ 'Changes Browser' |
|
28 | 134 |
! ! |
135 |
||
202 | 136 |
!ChangesBrowser methodsFor:'compiler interface'! |
137 |
||
138 |
wantChangeLog |
|
139 |
"sent by the compiler to ask if a changeLog entry should |
|
140 |
be written. Return false here." |
|
141 |
||
142 |
^ false |
|
143 |
! ! |
|
144 |
||
145 |
!ChangesBrowser methodsFor:'error handling'! |
|
146 |
||
147 |
correctableError:aString position:relPos to:relEndPos from:aCompiler |
|
148 |
"compiler notifys us of an error - this should really not happen since |
|
149 |
changes ought to be correct (did someone edit the changes file ??). |
|
150 |
Show the bad change in the codeView and let codeView hilight the error; |
|
151 |
no corrections allowed here therefore return false" |
|
152 |
||
153 |
self error:aString position:relPos to:relEndPos from:aCompiler. |
|
154 |
^ false |
|
155 |
! |
|
156 |
||
157 |
error:aString position:relPos to:relEndPos from:aCompiler |
|
158 |
"compiler notifys us of an error - this should really not happen since |
|
159 |
changes ought to be correct (did someone edit the changes file ??). |
|
160 |
Show the bad change in the codeView and let codeView hilight the error" |
|
161 |
||
162 |
|action| |
|
163 |
||
164 |
(changeNrProcessed ~~ changeNrShown) ifTrue:[ |
|
373 | 165 |
self changeSelection:changeNrProcessed |
202 | 166 |
]. |
167 |
(skipSignal notNil) ifTrue:[ |
|
168 |
||
373 | 169 |
codeView highlightingErrorPosition:relPos to:relEndPos do:[ |
170 |
|box| |
|
0 | 171 |
|
373 | 172 |
" |
173 |
start dialog - make certain cleanup is done |
|
174 |
" |
|
175 |
action := OptionBox |
|
176 |
request:aString |
|
177 |
label:'Error' |
|
178 |
form:(WarningBox iconBitmap) |
|
179 |
buttonLabels:#('cancel' 'skip' 'continue') |
|
180 |
values:#(#abort #skip #continue) |
|
181 |
default:#continue. |
|
182 |
]. |
|
0 | 183 |
|
373 | 184 |
action == #abort ifTrue:[ |
185 |
Object abortSignal raise. |
|
186 |
^ false |
|
187 |
]. |
|
188 |
action == #skip ifTrue:[ |
|
189 |
skipSignal raise. |
|
190 |
^ false |
|
191 |
]. |
|
192 |
^ false |
|
202 | 193 |
]. |
194 |
^ codeView error:aString position:relPos to:relEndPos from:aCompiler |
|
373 | 195 |
|
196 |
"Modified: 20.2.1996 / 20:47:59 / cg" |
|
202 | 197 |
! |
198 |
||
199 |
warning:aString position:relPos to:relEndPos from:aCompiler |
|
200 |
"compiler notifys us of a warning - ignore it" |
|
201 |
||
202 |
^ self |
|
203 |
! ! |
|
204 |
||
205 |
!ChangesBrowser methodsFor:'event handling '! |
|
206 |
||
207 |
handlesKeyPress:key inView:view |
|
208 |
"this method is reached via delegation: are we prepared to handle |
|
209 |
a keyPress in some other view ?" |
|
210 |
||
1127 | 211 |
<resource: #keyboard (#Delete #BackSpace #Accept #Find #FindPrev #FindNext)> |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
212 |
|
202 | 213 |
view == changeListView ifTrue:[ |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
214 |
(key == #Delete |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
215 |
or:[key == #BackSpace |
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
216 |
or:[key == #Accept |
1127 | 217 |
or:[key == #Find |
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
218 |
or:[key == #FindPrev |
1127 | 219 |
or:[key == #FindNext]]]]]) ifTrue:[^ true]. |
202 | 220 |
]. |
221 |
^ false |
|
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
222 |
|
1127 | 223 |
"Modified: 8.4.1997 / 11:01:42 / cg" |
0 | 224 |
! |
225 |
||
202 | 226 |
keyPress:key x:x y:y view:view |
227 |
"this method is reached via delegation from the changeListView" |
|
228 |
||
1127 | 229 |
<resource: #keyboard (#Delete #BackSpace #Accept #Find #FindPrev #FindNext)> |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
230 |
|
202 | 231 |
(key == #Delete or:[key == #BackSpace]) ifTrue:[ |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
232 |
self doDelete. |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
233 |
^ self |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
234 |
]. |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
235 |
(key == #Accept) ifTrue:[ |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
236 |
self doApply. |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
237 |
^ self |
202 | 238 |
]. |
1127 | 239 |
(key == #Find) ifTrue:[ |
240 |
self findClass. |
|
241 |
^ self |
|
242 |
]. |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
243 |
(key == #FindPrev) ifTrue:[ |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
244 |
self findPreviousForClass. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
245 |
^ self |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
246 |
]. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
247 |
(key == #FindNext) ifTrue:[ |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
248 |
self findNextForClass. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
249 |
^ self |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
250 |
]. |
202 | 251 |
changeListView keyPress:key x:x y:y |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
252 |
|
1127 | 253 |
"Modified: 8.4.1997 / 11:01:38 / cg" |
202 | 254 |
! ! |
255 |
||
256 |
!ChangesBrowser methodsFor:'help '! |
|
257 |
||
258 |
helpTextFor:aComponent |
|
259 |
|s| |
|
260 |
||
261 |
aComponent == codeView ifTrue:[ |
|
262 |
s := 'HELP_CODEVIEW' |
|
263 |
]. |
|
264 |
aComponent == changeListView ifTrue:[ |
|
265 |
s := 'HELP_CHANGELIST' |
|
266 |
]. |
|
267 |
((aComponent == compareCheckBox) |
|
268 |
or:[aComponent superView == compareCheckBox]) ifTrue:[ |
|
269 |
s := 'HELP_CHECK_COMPARE' |
|
270 |
]. |
|
271 |
s notNil ifTrue:[ |
|
272 |
^ resources string:s |
|
273 |
]. |
|
274 |
^ nil |
|
394 | 275 |
! |
276 |
||
277 |
showActivity:someMessage |
|
502 | 278 |
"some activityNotification to be forwarded to the user; |
279 |
show it in the windows title area here." |
|
280 |
||
394 | 281 |
self label:someMessage |
282 |
||
283 |
"Created: 24.2.1996 / 19:35:42 / cg" |
|
502 | 284 |
"Modified: 23.4.1996 / 21:39:36 / cg" |
202 | 285 |
! ! |
286 |
||
287 |
!ChangesBrowser methodsFor:'initialize / release'! |
|
288 |
||
289 |
changeListMenu |
|
586 | 290 |
<resource: #keyboard ( #Accept #Delete ) > |
291 |
||
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
292 |
|labels selectors shorties m| |
202 | 293 |
|
255 | 294 |
labels := #( |
295 |
'apply change' |
|
296 |
'apply changes to end' |
|
418
a6cf6fdbcec6
shortified strings in popup menu
Claus Gittinger <cg@exept.de>
parents:
417
diff
changeset
|
297 |
'apply changes for class to end' |
255 | 298 |
'apply all changes' |
299 |
'-' |
|
300 |
'delete' |
|
301 |
'delete to end' |
|
418
a6cf6fdbcec6
shortified strings in popup menu
Claus Gittinger <cg@exept.de>
parents:
417
diff
changeset
|
302 |
'delete changes for class to end' |
a6cf6fdbcec6
shortified strings in popup menu
Claus Gittinger <cg@exept.de>
parents:
417
diff
changeset
|
303 |
'delete changes for class from begin' |
a6cf6fdbcec6
shortified strings in popup menu
Claus Gittinger <cg@exept.de>
parents:
417
diff
changeset
|
304 |
'delete all changes for class' |
255 | 305 |
'-' |
419 | 306 |
'update view' |
255 | 307 |
'compress' |
308 |
'compare with current version' |
|
309 |
'browse' |
|
310 |
'-' |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
311 |
'make change a patch'). |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
312 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
313 |
editingClassSource ifFalse:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
314 |
labels := labels , #('fileout & delete changes for class') |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
315 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
316 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
317 |
labels := labels , #( |
255 | 318 |
'-' |
418
a6cf6fdbcec6
shortified strings in popup menu
Claus Gittinger <cg@exept.de>
parents:
417
diff
changeset
|
319 |
'save change in ...' |
a6cf6fdbcec6
shortified strings in popup menu
Claus Gittinger <cg@exept.de>
parents:
417
diff
changeset
|
320 |
'save changes to end in ...' |
a6cf6fdbcec6
shortified strings in popup menu
Claus Gittinger <cg@exept.de>
parents:
417
diff
changeset
|
321 |
'save changes for class to end in ...' |
a6cf6fdbcec6
shortified strings in popup menu
Claus Gittinger <cg@exept.de>
parents:
417
diff
changeset
|
322 |
'save all changes for class in ...' |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
323 |
'-'). |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
324 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
325 |
editingClassSource ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
326 |
labels := labels , #('writeback classFile') |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
327 |
] ifFalse:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
328 |
labels := labels , #('writeback changeFile') |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
329 |
]. |
221 | 330 |
|
255 | 331 |
selectors := #( |
332 |
doApply |
|
333 |
doApplyRest |
|
334 |
doApplyClassRest |
|
335 |
doApplyAll |
|
336 |
nil |
|
337 |
doDelete |
|
338 |
doDeleteRest |
|
339 |
doDeleteClassRest |
|
286
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
340 |
doDeleteClassFromBeginning |
255 | 341 |
doDeleteClassAll |
342 |
nil |
|
343 |
doUpdate |
|
344 |
doCompress |
|
345 |
doCompare |
|
346 |
doBrowse |
|
347 |
nil |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
348 |
doMakePatch). |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
349 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
350 |
editingClassSource ifFalse:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
351 |
selectors := selectors , #(doFileoutAndDeleteClassAll) |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
352 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
353 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
354 |
selectors := selectors , #( |
255 | 355 |
nil |
356 |
doSave |
|
357 |
doSaveRest |
|
358 |
doSaveClassRest |
|
359 |
doSaveClassAll |
|
360 |
nil |
|
361 |
doWriteBack |
|
362 |
). |
|
202 | 363 |
|
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
364 |
shorties := #( |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
365 |
Accept |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
366 |
nil |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
367 |
nil |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
368 |
nil |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
369 |
nil |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
370 |
Delete |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
371 |
nil |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
372 |
nil |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
373 |
nil |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
374 |
nil |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
375 |
nil |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
376 |
nil |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
377 |
nil |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
378 |
nil |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
379 |
nil |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
380 |
nil |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
381 |
nil |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
382 |
nil |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
383 |
nil |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
384 |
nil |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
385 |
nil |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
386 |
nil |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
387 |
nil |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
388 |
nil |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
389 |
nil |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
390 |
). |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
391 |
|
202 | 392 |
m := PopUpMenu |
255 | 393 |
labels:(resources array:labels) |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
394 |
selectors:selectors |
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
395 |
accelerators:shorties. |
202 | 396 |
|
255 | 397 |
"/ |
398 |
"/ disable those that require a selected entry |
|
399 |
"/ |
|
202 | 400 |
changeListView hasSelection ifFalse:[ |
255 | 401 |
m disableAll:#(doApply doApplyClassRest doApplyRest doDelete doDeleteRest doDeleteClassRest |
293
988f61e34757
disable delete-from-beginning if there is no selection
Claus Gittinger <cg@exept.de>
parents:
286
diff
changeset
|
402 |
doDeleteClassFromBeginning |
255 | 403 |
doDeleteClassAll doCompare doMakePatch doSaveChangeInFile doMakePermanent |
404 |
doSave doSaveRest doSaveClassAll doSaveClassRest doBrowse doFileoutAndDeleteClassAll) |
|
405 |
]. |
|
406 |
||
407 |
"/ |
|
408 |
"/ disable those that do not make sense with autoUpdate |
|
409 |
"/ ('cause this would be overwritten by next update operation) |
|
410 |
"/ |
|
411 |
||
412 |
autoUpdate ifTrue:[ |
|
413 |
m disableAll:#(doDelete doDeleteRest doDeleteClassRest doDeleteClassAll doCompress |
|
414 |
doFileoutAndDeleteClassAll doWriteBack) |
|
202 | 415 |
]. |
416 |
^ m |
|
417 |
||
418 |
"Modified: 6.9.1995 / 17:14:22 / claus" |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
419 |
"Modified: 5.9.1996 / 17:24:17 / cg" |
202 | 420 |
! |
421 |
||
422 |
compare:aBoolean |
|
423 |
"sent from the compare-toggle" |
|
73 | 424 |
|
202 | 425 |
aBoolean ~~ compareChanges ifTrue:[ |
584
3f49ec1318ef
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
577
diff
changeset
|
426 |
compareChanges := aBoolean. |
3f49ec1318ef
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
577
diff
changeset
|
427 |
compareChanges ifTrue:[ |
3f49ec1318ef
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
577
diff
changeset
|
428 |
tabSpec positions:#(0 0.15 5 8.5 ). |
3f49ec1318ef
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
577
diff
changeset
|
429 |
self doUpdate |
3f49ec1318ef
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
577
diff
changeset
|
430 |
] ifFalse:[ |
3f49ec1318ef
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
577
diff
changeset
|
431 |
"/ |
3f49ec1318ef
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
577
diff
changeset
|
432 |
"/ set tabs to hide compare-column |
3f49ec1318ef
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
577
diff
changeset
|
433 |
"/ |
3f49ec1318ef
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
577
diff
changeset
|
434 |
tabSpec positions:#(-1 0 5 8.5 ). |
3f49ec1318ef
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
577
diff
changeset
|
435 |
changeListView invalidate. "/ clear; redraw. |
3f49ec1318ef
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
577
diff
changeset
|
436 |
] |
202 | 437 |
] |
438 |
||
584
3f49ec1318ef
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
577
diff
changeset
|
439 |
"Modified: 29.5.1996 / 16:12:19 / cg" |
202 | 440 |
! |
441 |
||
442 |
focusSequence |
|
443 |
^ Array with:changeListView with:codeView |
|
444 |
! |
|
445 |
||
446 |
initialize |
|
221 | 447 |
|panel v upperFrame buttonPanel autoUpdateCheckBox| |
202 | 448 |
|
449 |
super initialize. |
|
450 |
||
451 |
changeFileName := ObjectMemory nameForChanges. "/ 'changes'. |
|
452 |
compareChanges := false. |
|
221 | 453 |
autoUpdate := false. |
454 |
||
1099
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
455 |
" |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
456 |
checkBlock is executed by the Processor. |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
457 |
We use #pushEvent: to perform the update |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
458 |
in our windowgroups process. |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
459 |
" |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
460 |
checkBlock := [self pushEvent:#checkIfFileHasChanged]. |
202 | 461 |
|
462 |
panel := VariableVerticalPanel origin:(0.0 @ 0.0) |
|
392
0e29d8ead726
double-click on a change opens a browser on it
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
463 |
corner:(1.0 @ 1.0) |
0e29d8ead726
double-click on a change opens a browser on it
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
464 |
borderWidth:0 |
0e29d8ead726
double-click on a change opens a browser on it
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
465 |
in:self. |
202 | 466 |
|
467 |
upperFrame := View origin:(0.0 @ 0.0) corner:(1.0 @ 0.3) in:panel. |
|
468 |
||
469 |
v := HVScrollableView for:SelectionInListView miniScrollerH:true in:upperFrame. |
|
470 |
v origin:(0.0 @ 0.0) corner:(0.8 @ 1.0). |
|
471 |
changeListView := v scrolledView. |
|
472 |
changeListView delegate:self. |
|
473 |
changeListView menuHolder:self; menuPerformer:self; menuMessage:#changeListMenu. |
|
392
0e29d8ead726
double-click on a change opens a browser on it
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
474 |
changeListView doubleClickAction:[:line | self doBrowse]. |
202 | 475 |
|
476 |
buttonPanel := VerticalPanelView in:upperFrame. |
|
477 |
buttonPanel origin:(0.8 @ 0.0) corner:(1.0 @ 1.0). |
|
221 | 478 |
buttonPanel verticalLayout:#topSpace; horizontalLayout:#leftSpace. |
202 | 479 |
|
480 |
compareCheckBox := CheckBox new. |
|
481 |
compareCheckBox label:(resources string:'compare'). |
|
482 |
compareCheckBox action:[:val | self compare:val]. |
|
483 |
buttonPanel addSubView:compareCheckBox. |
|
484 |
||
221 | 485 |
autoUpdateCheckBox := CheckBox new. |
486 |
autoUpdateCheckBox label:(resources string:'auto update'). |
|
487 |
autoUpdateCheckBox action:[:val | self autoUpdate:val]. |
|
488 |
buttonPanel addSubView:autoUpdateCheckBox. |
|
489 |
||
202 | 490 |
v := HVScrollableView for:CodeView miniScrollerH:true miniScrollerV:false in:panel. |
491 |
v origin:(0.0 @ 0.3) corner:(1.0 @ 1.0). |
|
492 |
codeView := v scrolledView. |
|
493 |
codeView readOnly. |
|
494 |
||
495 |
anyChanges := false. |
|
496 |
ObjectMemory addDependent:self. "to get shutdown-update" |
|
497 |
||
498 |
tabSpec := TabulatorSpecification new. |
|
499 |
tabSpec unit:#inch. |
|
500 |
tabSpec positions:#(-1 0 5 8.5 ). |
|
501 |
" +/- cls>>sel type info" |
|
502 |
tabSpec align: #(#left #left #left #left). |
|
503 |
||
392
0e29d8ead726
double-click on a change opens a browser on it
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
504 |
"Modified: 24.2.1996 / 16:07:51 / cg" |
1099
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
505 |
"Modified: 27.3.1997 / 11:07:07 / stefan" |
202 | 506 |
! |
507 |
||
1246
9ed3722bd2f2
setup in #postRealize instead of #realize
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
508 |
postRealize |
202 | 509 |
self readChangesFileInBackground:true. |
510 |
self setChangeList. |
|
511 |
changeListView action:[:lineNr | self changeSelection:lineNr]. |
|
512 |
Processor addTimedBlock:checkBlock afterSeconds:5. |
|
1246
9ed3722bd2f2
setup in #postRealize instead of #realize
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
513 |
|
9ed3722bd2f2
setup in #postRealize instead of #realize
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
514 |
"Created: 24.7.1997 / 18:06:12 / cg" |
202 | 515 |
! |
516 |
||
627 | 517 |
update:what with:aParameter from:changedObject |
202 | 518 |
|box| |
519 |
||
520 |
(what == #aboutToExit) ifTrue:[ |
|
627 | 521 |
" |
522 |
smalltalk is about to shut down - |
|
523 |
- if change list was modified, ask user and save if requested. |
|
524 |
" |
|
525 |
anyChanges ifTrue:[ |
|
526 |
self raiseDeiconified. |
|
202 | 527 |
|
627 | 528 |
box := YesNoBox new. |
529 |
box title:(resources at:'changefile has not been updated from the modified changelist.\\Update before exiting ?') withCRs. |
|
530 |
box noText:(resources at:'don''t update'). |
|
531 |
box okText:(resources at:'update'). |
|
532 |
box yesAction:[self writeBackChanges] |
|
533 |
noAction:[]. |
|
917 | 534 |
box showAtPointer. |
535 |
box destroy |
|
627 | 536 |
]. |
537 |
^ self |
|
202 | 538 |
]. |
539 |
super update:what |
|
627 | 540 |
|
541 |
"Created: 15.6.1996 / 15:26:30 / cg" |
|
917 | 542 |
"Modified: 7.1.1997 / 23:03:47 / cg" |
202 | 543 |
! ! |
544 |
||
545 |
!ChangesBrowser methodsFor:'private'! |
|
546 |
||
547 |
appendChange:changeNr toFile:fileName |
|
548 |
"append change to a file. return true if ok." |
|
549 |
||
550 |
|aStream outStream chunk sawExcla separator| |
|
551 |
||
552 |
outStream := FileStream oldFileNamed:fileName. |
|
553 |
outStream isNil ifTrue:[ |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
554 |
outStream isNil ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
555 |
outStream := FileStream newFileNamed:fileName. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
556 |
outStream isNil ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
557 |
self warn:'cannot update file ''%1''' with:fileName. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
558 |
^ false |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
559 |
] |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
560 |
] |
73 | 561 |
]. |
202 | 562 |
|
563 |
outStream setToEnd. |
|
564 |
||
565 |
aStream := self streamForChange:changeNr. |
|
566 |
aStream isNil ifTrue:[ |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
567 |
self warn:'oops cannot read change'. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
568 |
^ false |
202 | 569 |
]. |
73 | 570 |
|
202 | 571 |
separator := aStream class chunkSeparator. |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
572 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
573 |
(changeIsFollowupMethodChange at:changeNr) ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
574 |
sawExcla := true. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
575 |
chunk := changeChunks at:changeNr |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
576 |
] ifFalse:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
577 |
sawExcla := aStream peekFor:separator. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
578 |
chunk := aStream nextChunk. |
202 | 579 |
]. |
580 |
sawExcla ifTrue:[ |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
581 |
outStream nextPut:separator |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
582 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
583 |
outStream nextChunkPut:chunk; cr. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
584 |
sawExcla ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
585 |
chunk := aStream nextChunk. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
586 |
outStream nextChunkPut:chunk; space |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
587 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
588 |
sawExcla ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
589 |
outStream nextPut:separator |
202 | 590 |
]. |
591 |
outStream cr. |
|
592 |
aStream close. |
|
593 |
outStream close. |
|
594 |
^ true |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
595 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
596 |
"Modified: 5.9.1996 / 17:28:22 / cg" |
73 | 597 |
! |
598 |
||
51 | 599 |
applyChange:changeNr |
600 |
"fileIn a change" |
|
601 |
||
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
602 |
|aStream nm applyAction| |
45 | 603 |
|
51 | 604 |
aStream := self streamForChange:changeNr. |
605 |
aStream isNil ifTrue:[^ self]. |
|
606 |
||
607 |
nm := self classNameOfChange:changeNr. |
|
608 |
nm notNil ifTrue:[ |
|
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
609 |
|cls| |
45 | 610 |
|
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
611 |
cls := Smalltalk at:(nm asSymbol) ifAbsent:[]. |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
612 |
cls notNil ifTrue:[ |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
613 |
cls isLoaded ifFalse:[ |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
614 |
cls autoload |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
615 |
] |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
616 |
] |
51 | 617 |
]. |
45 | 618 |
|
51 | 619 |
changeNrProcessed := changeNr. |
45 | 620 |
|
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
621 |
applyAction := [ |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
622 |
|sig| |
45 | 623 |
|
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
624 |
(skipSignal notNil) ifTrue:[ |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
625 |
sig := skipSignal |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
626 |
] ifFalse:[ |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
627 |
sig := Object abortSignal |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
628 |
]. |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
629 |
sig catch:[ |
705 | 630 |
|reader doItChunk methodsForChunk| |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
631 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
632 |
"/ a followup methodsFor: chunk ... |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
633 |
(changeIsFollowupMethodChange at:changeNr) ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
634 |
methodsForChunk := (changeChunks at:changeNr). |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
635 |
] ifFalse:[ |
705 | 636 |
doItChunk := aStream nextChunk. "/ an empty chunk sometimes ... |
637 |
doItChunk notEmpty ifTrue:[ |
|
724 | 638 |
Compiler evaluate:doItChunk notifying:self. |
705 | 639 |
] ifFalse:[ |
640 |
methodsForChunk := aStream nextChunk. "/ the real one |
|
641 |
] |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
642 |
]. |
705 | 643 |
methodsForChunk notNil ifTrue:[ |
644 |
reader := Compiler evaluate:methodsForChunk notifying:self. |
|
645 |
reader fileInFrom:aStream notifying:self passChunk:false single:true. |
|
646 |
] |
|
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
647 |
]. |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
648 |
changeNrProcessed := nil. |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
649 |
]. |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
650 |
|
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
651 |
"/ |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
652 |
"/ if I am showing the changes file, dont update it |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
653 |
"/ |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
654 |
changeFileName = ObjectMemory nameForChanges ifTrue:[ |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
655 |
Class withoutUpdatingChangesDo:applyAction |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
656 |
] ifFalse:[ |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
657 |
applyAction value |
45 | 658 |
]. |
132 | 659 |
aStream close |
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
660 |
|
724 | 661 |
"Modified: 10.9.1996 / 20:18:46 / cg" |
45 | 662 |
! |
663 |
||
202 | 664 |
autoSelect:changeNr |
665 |
"select a change" |
|
73 | 666 |
|
202 | 667 |
self class autoSelectNext ifTrue:[ |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
668 |
(changeNr <= self numberOfChanges) ifTrue:[ |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
669 |
changeListView setSelection:changeNr. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
670 |
self changeSelection:changeNr. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
671 |
^ self |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
672 |
] |
202 | 673 |
]. |
674 |
self clearCodeView. |
|
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
675 |
changeListView setSelection:nil. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
676 |
|
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
677 |
"Modified: 25.5.1996 / 12:28:21 / cg" |
73 | 678 |
! |
679 |
||
202 | 680 |
autoSelectLast |
681 |
"select the last change" |
|
0 | 682 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
683 |
self autoSelect:(self numberOfChanges) |
202 | 684 |
! |
107 | 685 |
|
202 | 686 |
autoSelectOrEnd:changeNr |
687 |
"select the next change or the last" |
|
688 |
||
689 |
|last| |
|
50 | 690 |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
691 |
last := self numberOfChanges. |
202 | 692 |
changeNr < last ifTrue:[ |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
693 |
self autoSelect:changeNr |
133 | 694 |
] ifFalse:[ |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
695 |
changeListView setSelection:last . |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
696 |
self changeSelection:last. |
202 | 697 |
] |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
698 |
|
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
699 |
"Modified: 25.5.1996 / 12:26:17 / cg" |
202 | 700 |
! |
133 | 701 |
|
202 | 702 |
changeFileName:aFileName |
703 |
changeFileName := aFileName |
|
133 | 704 |
! |
705 |
||
275
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
706 |
checkClassIsLoaded:aClass |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
707 |
|cls| |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
708 |
|
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
709 |
aClass isMeta ifTrue:[ |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
710 |
cls := aClass soleInstance |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
711 |
] ifFalse:[ |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
712 |
cls := aClass |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
713 |
]. |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
714 |
cls isLoaded ifFalse:[ |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
715 |
(self confirm:(cls name , ' is an autoloaded class.\I can only compare the methods texts if its loaded first.\\Load the class first ?') withCRs) |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
716 |
ifTrue:[ |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
717 |
cls autoload |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
718 |
] |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
719 |
]. |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
720 |
^ cls isLoaded |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
721 |
|
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
722 |
"Created: 12.12.1995 / 14:04:39 / cg" |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
723 |
"Modified: 12.12.1995 / 14:11:05 / cg" |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
724 |
! |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
725 |
|
133 | 726 |
checkIfFileHasChanged |
727 |
|f info | |
|
728 |
||
729 |
Processor removeTimedBlock:checkBlock. |
|
730 |
f := changeFileName asFilename. |
|
731 |
(info := f info) isNil ifTrue:[ |
|
829
b6b0be2e14af
changes for new return from OS>>infoOf:
Claus Gittinger <cg@exept.de>
parents:
761
diff
changeset
|
732 |
self newLabel:'(unaccessable)' |
133 | 733 |
] ifFalse:[ |
829
b6b0be2e14af
changes for new return from OS>>infoOf:
Claus Gittinger <cg@exept.de>
parents:
761
diff
changeset
|
734 |
(info modified) > changeFileTimestamp ifTrue:[ |
b6b0be2e14af
changes for new return from OS>>infoOf:
Claus Gittinger <cg@exept.de>
parents:
761
diff
changeset
|
735 |
self newLabel:'(outdated)'. |
b6b0be2e14af
changes for new return from OS>>infoOf:
Claus Gittinger <cg@exept.de>
parents:
761
diff
changeset
|
736 |
autoUpdate ifTrue:[ |
b6b0be2e14af
changes for new return from OS>>infoOf:
Claus Gittinger <cg@exept.de>
parents:
761
diff
changeset
|
737 |
self doUpdate |
b6b0be2e14af
changes for new return from OS>>infoOf:
Claus Gittinger <cg@exept.de>
parents:
761
diff
changeset
|
738 |
] |
b6b0be2e14af
changes for new return from OS>>infoOf:
Claus Gittinger <cg@exept.de>
parents:
761
diff
changeset
|
739 |
] ifFalse:[ |
b6b0be2e14af
changes for new return from OS>>infoOf:
Claus Gittinger <cg@exept.de>
parents:
761
diff
changeset
|
740 |
self newLabel:'' |
b6b0be2e14af
changes for new return from OS>>infoOf:
Claus Gittinger <cg@exept.de>
parents:
761
diff
changeset
|
741 |
] |
133 | 742 |
]. |
743 |
Processor addTimedBlock:checkBlock afterSeconds:5. |
|
744 |
||
745 |
"Created: 8.9.1995 / 19:30:19 / claus" |
|
746 |
"Modified: 8.9.1995 / 19:38:18 / claus" |
|
829
b6b0be2e14af
changes for new return from OS>>infoOf:
Claus Gittinger <cg@exept.de>
parents:
761
diff
changeset
|
747 |
"Modified: 1.11.1996 / 20:22:56 / cg" |
133 | 748 |
! |
749 |
||
255 | 750 |
classNameOfChange:changeNr |
751 |
"return the classname of a change |
|
752 |
(for classChanges (i.e. xxx class), the non-metaClassName (i.e. xxx) is returned)" |
|
753 |
||
754 |
|name| |
|
755 |
||
756 |
name := self fullClassNameOfChange:changeNr. |
|
757 |
name isNil ifTrue:[^ nil]. |
|
758 |
(name endsWith:' class') ifTrue:[ |
|
759 |
^ name copyWithoutLast:6 |
|
760 |
]. |
|
761 |
^ name |
|
762 |
||
763 |
"Modified: 6.12.1995 / 17:06:31 / cg" |
|
764 |
! |
|
765 |
||
766 |
clearCodeView |
|
767 |
self unselect "changeListView deselect". |
|
768 |
codeView contents:nil. |
|
769 |
changeNrShown := nil |
|
770 |
! |
|
771 |
||
772 |
compareChange:changeNr |
|
773 |
"compare a change with current version" |
|
774 |
||
775 |
|aStream chunk sawExcla parseTree thisClass cat oldSource newSource |
|
742
2ef5e22d8983
code cleanup (unused vars eliminated)
Claus Gittinger <cg@exept.de>
parents:
724
diff
changeset
|
776 |
parser sel oldMethod outcome showDiff d t1 t2 selector isLoaded |
761 | 777 |
method beep| |
255 | 778 |
|
779 |
aStream := self streamForChange:changeNr. |
|
780 |
aStream isNil ifTrue:[^ self]. |
|
781 |
||
275
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
782 |
showDiff := false. |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
783 |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
784 |
(changeIsFollowupMethodChange at:changeNr) ifFalse:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
785 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
786 |
chunk := aStream nextChunk. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
787 |
] ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
788 |
chunk := (changeChunks at:changeNr). |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
789 |
sawExcla := true. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
790 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
791 |
|
761 | 792 |
beep := false. |
793 |
||
255 | 794 |
sawExcla ifFalse:[ |
275
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
795 |
outcome := 'cannot compare this change\\(i.e. this is not a method change).'. |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
796 |
|
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
797 |
parseTree := Parser parseExpression:chunk. |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
798 |
(parseTree notNil and:[parseTree isMessage]) ifTrue:[ |
518
e265101d47f6
compare for category changes added
Claus Gittinger <cg@exept.de>
parents:
508
diff
changeset
|
799 |
((selector := parseTree selector) == #removeSelector:) ifTrue:[ |
275
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
800 |
thisClass := (parseTree receiver evaluate). |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
801 |
thisClass isBehavior ifTrue:[ |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
802 |
(self checkClassIsLoaded:thisClass) ifTrue:[ |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
803 |
selector := (parseTree arg1 evaluate). |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
804 |
(thisClass includesSelector:selector) ifTrue:[ |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
805 |
outcome := 'change removes the #' , selector , ' method from ' , thisClass name. |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
806 |
] ifFalse:[ |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
807 |
outcome := 'change has no effect\\(there is no method for #' , selector , ' in ' , thisClass name , ')' |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
808 |
] |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
809 |
] ifFalse:[ |
761 | 810 |
beep := true. |
275
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
811 |
outcome := 'cannot compare this change (compare requires class to be loaded).'. |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
812 |
] |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
813 |
] |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
814 |
]. |
518
e265101d47f6
compare for category changes added
Claus Gittinger <cg@exept.de>
parents:
508
diff
changeset
|
815 |
selector == #category: ifTrue:[ |
e265101d47f6
compare for category changes added
Claus Gittinger <cg@exept.de>
parents:
508
diff
changeset
|
816 |
parseTree receiver isMessage ifTrue:[ |
e265101d47f6
compare for category changes added
Claus Gittinger <cg@exept.de>
parents:
508
diff
changeset
|
817 |
parseTree receiver selector == #compiledMethodAt: ifTrue:[ |
e265101d47f6
compare for category changes added
Claus Gittinger <cg@exept.de>
parents:
508
diff
changeset
|
818 |
(method := parseTree receiver evaluate) isMethod ifTrue:[ |
e265101d47f6
compare for category changes added
Claus Gittinger <cg@exept.de>
parents:
508
diff
changeset
|
819 |
method category = parseTree arg1 evaluate ifTrue:[ |
e265101d47f6
compare for category changes added
Claus Gittinger <cg@exept.de>
parents:
508
diff
changeset
|
820 |
outcome := 'change has no effect\\(same category)'. |
e265101d47f6
compare for category changes added
Claus Gittinger <cg@exept.de>
parents:
508
diff
changeset
|
821 |
] ifFalse:[ |
520 | 822 |
outcome := 'category is different (''' , method category , ''' vs. ''' , parseTree arg1 evaluate , ''')' |
518
e265101d47f6
compare for category changes added
Claus Gittinger <cg@exept.de>
parents:
508
diff
changeset
|
823 |
] |
e265101d47f6
compare for category changes added
Claus Gittinger <cg@exept.de>
parents:
508
diff
changeset
|
824 |
] ifFalse:[ |
761 | 825 |
beep := true. |
518
e265101d47f6
compare for category changes added
Claus Gittinger <cg@exept.de>
parents:
508
diff
changeset
|
826 |
outcome := 'there is no such method' |
e265101d47f6
compare for category changes added
Claus Gittinger <cg@exept.de>
parents:
508
diff
changeset
|
827 |
] |
e265101d47f6
compare for category changes added
Claus Gittinger <cg@exept.de>
parents:
508
diff
changeset
|
828 |
] |
e265101d47f6
compare for category changes added
Claus Gittinger <cg@exept.de>
parents:
508
diff
changeset
|
829 |
] |
e265101d47f6
compare for category changes added
Claus Gittinger <cg@exept.de>
parents:
508
diff
changeset
|
830 |
] |
275
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
831 |
] |
255 | 832 |
] ifTrue:[ |
275
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
833 |
parseTree := Parser parseExpression:chunk. |
761 | 834 |
(parseTree notNil |
835 |
and:[parseTree ~~ #Error |
|
836 |
and:[parseTree isMessage]]) ifTrue:[ |
|
275
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
837 |
(parseTree selector == #methodsFor:) ifTrue:[ |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
838 |
thisClass := (parseTree receiver evaluate). |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
839 |
thisClass isBehavior ifTrue:[ |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
840 |
(isLoaded := self checkClassIsLoaded:thisClass) ifFalse:[ |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
841 |
outcome := 'cannot compare this change\\(compare requires class to be loaded).'. |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
842 |
]. |
255 | 843 |
|
275
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
844 |
cat := parseTree arg1 evaluate. |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
845 |
newSource := aStream nextChunk. |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
846 |
|
275
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
847 |
parser := Parser parseMethod:newSource in:thisClass. |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
848 |
(parser notNil and:[parser ~~ #Error]) ifTrue:[ |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
849 |
sel := parser selector. |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
850 |
oldMethod := thisClass compiledMethodAt:sel. |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
851 |
oldMethod notNil ifTrue:[ |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
852 |
(oldMethod category = cat) ifFalse:[ |
548 | 853 |
Transcript showCR:'category changed.'. |
275
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
854 |
]. |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
855 |
oldSource := oldMethod source. |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
856 |
(oldSource = newSource) ifTrue:[ |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
857 |
outcome := 'same source' |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
858 |
] ifFalse:[ |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
859 |
oldSource isNil ifTrue:[ |
761 | 860 |
beep := true. |
275
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
861 |
outcome := 'no source for compare.' |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
862 |
] ifFalse:[ |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
863 |
"/ |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
864 |
"/ compare for tabulator <-> space changes |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
865 |
"/ before showing diff ... |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
866 |
"/ |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
867 |
t1 := oldSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
868 |
t2 := newSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
869 |
t1 = t2 ifTrue:[ |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
870 |
outcome := 'same source' |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
871 |
] ifFalse:[ |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
872 |
outcome := 'source changed.'. |
522
c67c64200411
ignore history lines when comparing
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
873 |
showDiff := true. |
c67c64200411
ignore history lines when comparing
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
874 |
|
c67c64200411
ignore history lines when comparing
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
875 |
"/ |
c67c64200411
ignore history lines when comparing
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
876 |
"/ check if only historyLine diffs |
c67c64200411
ignore history lines when comparing
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
877 |
"/ |
c67c64200411
ignore history lines when comparing
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
878 |
(HistoryManager notNil |
c67c64200411
ignore history lines when comparing
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
879 |
and:[HistoryManager isActive]) ifTrue:[ |
c67c64200411
ignore history lines when comparing
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
880 |
(HistoryManager withoutHistoryLines:newSource) |
c67c64200411
ignore history lines when comparing
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
881 |
= |
c67c64200411
ignore history lines when comparing
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
882 |
(HistoryManager withoutHistoryLines:oldSource) |
c67c64200411
ignore history lines when comparing
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
883 |
ifTrue:[ |
c67c64200411
ignore history lines when comparing
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
884 |
outcome := 'same source (history only)'. |
c67c64200411
ignore history lines when comparing
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
885 |
showDiff := false. |
c67c64200411
ignore history lines when comparing
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
886 |
] |
c67c64200411
ignore history lines when comparing
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
887 |
]. |
275
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
888 |
] |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
889 |
] |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
890 |
] |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
891 |
] ifFalse:[ |
761 | 892 |
isLoaded ifTrue:[ |
893 |
beep := true. |
|
894 |
outcome := 'method does not exist.' |
|
895 |
] |
|
275
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
896 |
] |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
897 |
] ifFalse:[ |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
898 |
outcome := 'change unparsable.' |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
899 |
]. |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
900 |
(showDiff and:[oldSource notNil and:[newSource notNil]]) ifTrue:[ |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
901 |
d := DiffTextView |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
902 |
openOn:oldSource label:'current version' |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
903 |
and:newSource label:'changeFile version'. |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
904 |
d label:'method differences'. |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
905 |
] |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
906 |
] ifFalse:[ |
761 | 907 |
beep := true. |
275
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
908 |
outcome := 'class does not exist.' |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
909 |
] |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
910 |
] ifFalse:[ |
761 | 911 |
beep := true. |
275
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
912 |
outcome := 'not comparable.' |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
913 |
] |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
914 |
] ifFalse:[ |
761 | 915 |
beep := true. |
275
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
916 |
outcome := 'not comparable.' |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
917 |
] |
255 | 918 |
]. |
919 |
aStream close. |
|
920 |
showDiff ifFalse:[ |
|
761 | 921 |
beep ifTrue:[ |
922 |
self warn:outcome withCRs. |
|
923 |
] ifFalse:[ |
|
924 |
self information:outcome withCRs. |
|
925 |
] |
|
553 | 926 |
"/ Transcript showCR:outcome. |
255 | 927 |
]. |
928 |
||
929 |
"Created: 24.11.1995 / 14:30:46 / cg" |
|
761 | 930 |
"Modified: 14.10.1996 / 20:08:16 / cg" |
255 | 931 |
! |
932 |
||
933 |
contractClass:className selector:selector to:maxLen |
|
934 |
|s l| |
|
935 |
||
936 |
s := className , ' ', selector. |
|
937 |
s size > maxLen ifTrue:[ |
|
938 |
l := maxLen - 1 - selector size max:20. |
|
939 |
s := (className contractTo:l) , ' ' , selector. |
|
940 |
||
941 |
s size > maxLen ifTrue:[ |
|
942 |
l := maxLen - 1 - className size max:20. |
|
943 |
s := className , ' ', (selector contractTo:l). |
|
944 |
||
945 |
s size > maxLen ifTrue:[ |
|
946 |
s := (className contractTo:(maxLen // 2 - 1)) , ' ' , (selector contractTo:maxLen // 2) |
|
947 |
] |
|
948 |
] |
|
949 |
]. |
|
950 |
^ s |
|
951 |
! |
|
952 |
||
953 |
deleteChange:changeNr |
|
954 |
"delete a change" |
|
955 |
||
956 |
self deleteChangesFrom:changeNr to:changeNr |
|
957 |
! |
|
958 |
||
959 |
deleteChangesFrom:start to:stop |
|
960 |
"delete a range of changes" |
|
961 |
||
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
962 |
changeListView setSelection:nil. |
255 | 963 |
stop to:start by:-1 do:[:changeNr | |
1070
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
964 |
self silentDeleteInternalChange:changeNr. |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
965 |
changeListView removeIndex:changeNr. |
255 | 966 |
]. |
744
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
967 |
|
1070
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
968 |
"/ changeListView contentsChanged. |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
969 |
"/ changeListView redrawFromLine:start. |
255 | 970 |
|
744
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
971 |
"/ self setChangeList |
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
972 |
|
1070
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
973 |
"Modified: 7.3.1997 / 16:31:20 / cg" |
255 | 974 |
! |
975 |
||
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
976 |
fullClassNameOfChange:changeNr |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
977 |
"return the full classname of a change |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
978 |
(for classChanges (i.e. xxx class), a string ending in ' class' is returned. |
202 | 979 |
- since parsing ascii methods is slow, keep result cached in |
980 |
changeClassNames for the next query" |
|
981 |
||
958
942fbe2a9806
can now extract className from a checkin-chunk
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
982 |
|chunk aParseTree recTree sel name arg1Tree isMeta prevMethodDefNr |
1293
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
983 |
words changeStream fullParseTree ownerTree ownerName | |
202 | 984 |
|
985 |
changeNr isNil ifTrue:[^ nil]. |
|
986 |
||
987 |
" |
|
988 |
first look, if not already known |
|
989 |
" |
|
990 |
name := changeClassNames at:changeNr. |
|
991 |
name notNil ifTrue:[^ name]. |
|
992 |
||
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
993 |
prevMethodDefNr := changeNr. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
994 |
[changeIsFollowupMethodChange at:prevMethodDefNr] whileTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
995 |
prevMethodDefNr := prevMethodDefNr - 1. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
996 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
997 |
|
202 | 998 |
" |
999 |
get the chunk |
|
1000 |
" |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1001 |
chunk := changeChunks at:prevMethodDefNr. |
202 | 1002 |
chunk isNil ifTrue:[^ nil]. "mhmh - empty" |
1003 |
||
958
942fbe2a9806
can now extract className from a checkin-chunk
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1004 |
(chunk startsWith:'''---') ifTrue:[ |
942fbe2a9806
can now extract className from a checkin-chunk
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1005 |
words := chunk asCollectionOfWords. |
942fbe2a9806
can now extract className from a checkin-chunk
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1006 |
words size > 2 ifTrue:[ |
942fbe2a9806
can now extract className from a checkin-chunk
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1007 |
(words at:2) = 'checkin' ifTrue:[ |
942fbe2a9806
can now extract className from a checkin-chunk
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1008 |
name := words at:3. |
942fbe2a9806
can now extract className from a checkin-chunk
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1009 |
changeClassNames at:changeNr put:name. |
942fbe2a9806
can now extract className from a checkin-chunk
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1010 |
^ name |
942fbe2a9806
can now extract className from a checkin-chunk
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1011 |
] |
942fbe2a9806
can now extract className from a checkin-chunk
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1012 |
]. |
942fbe2a9806
can now extract className from a checkin-chunk
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1013 |
]. |
942fbe2a9806
can now extract className from a checkin-chunk
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1014 |
|
942fbe2a9806
can now extract className from a checkin-chunk
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1015 |
"/ fix it - otherwise, it cannot be parsed |
226 | 1016 |
(chunk endsWith:'primitiveDefinitions:') ifTrue:[ |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1017 |
chunk := chunk , '''''' |
226 | 1018 |
]. |
1019 |
(chunk endsWith:'primitiveFunctions:') ifTrue:[ |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1020 |
chunk := chunk , '''''' |
226 | 1021 |
]. |
1022 |
(chunk endsWith:'primitiveVariables:') ifTrue:[ |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1023 |
chunk := chunk , '''''' |
226 | 1024 |
]. |
1025 |
||
202 | 1026 |
" |
1027 |
use parser to construct a parseTree |
|
1028 |
" |
|
1029 |
aParseTree := Parser parseExpression:chunk. |
|
1030 |
(aParseTree isNil or:[aParseTree == #Error]) ifTrue:[ |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1031 |
^ nil "seems strange ... (could be a comment)" |
202 | 1032 |
]. |
1033 |
aParseTree isMessage ifFalse:[ |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1034 |
^ nil "very strange ... (whats that ?)" |
202 | 1035 |
]. |
1036 |
||
1037 |
" |
|
1038 |
ask parser for selector |
|
1039 |
" |
|
1040 |
sel := aParseTree selector. |
|
1041 |
recTree := aParseTree receiver. |
|
1042 |
||
1043 |
" |
|
1044 |
is it a method-change, methodRemove or comment-change ? |
|
1045 |
" |
|
1046 |
(#(#'methodsFor:' |
|
1047 |
#'privateMethodsFor:' |
|
1048 |
#'protectedMethodsFor:' |
|
1049 |
#'publicMethodsFor:' |
|
1050 |
#'removeSelector:' |
|
1051 |
#'comment:' |
|
1052 |
#'primitiveDefinitions:' |
|
1053 |
#'primitiveFunctions:' |
|
1054 |
#'primitiveVariables:' |
|
1055 |
#'renameCategory:to:' |
|
1056 |
#'instanceVariableNames:' |
|
1057 |
) includes:sel) ifTrue:[ |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1058 |
" |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1059 |
yes, the className is the receiver |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1060 |
" |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1061 |
(recTree notNil and:[recTree ~~ #Error]) ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1062 |
isMeta := false. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1063 |
recTree isUnaryMessage ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1064 |
(recTree selector ~~ #class) ifTrue:[^ nil]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1065 |
"id class methodsFor:..." |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1066 |
recTree := recTree receiver. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1067 |
isMeta := true. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1068 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1069 |
recTree isPrimary ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1070 |
name := recTree name. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1071 |
isMeta ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1072 |
name := name , ' class'. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1073 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1074 |
changeClassNames at:changeNr put:name. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1075 |
^ name |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1076 |
] |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1077 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1078 |
"more strange things" |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1079 |
^ nil |
202 | 1080 |
]. |
1081 |
||
1082 |
" |
|
1083 |
is it a change in a class-description ? |
|
1084 |
" |
|
1085 |
(('subclass:*' match:sel) |
|
1086 |
or:[('variable*subclass:*' match:sel)]) ifTrue:[ |
|
1293
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1087 |
"/ must parse the full changes text, to get |
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1088 |
"/ privacy information. |
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1089 |
|
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1090 |
changeStream := self streamForChange:changeNr. |
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1091 |
changeStream notNil ifTrue:[ |
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1092 |
chunk := changeStream nextChunk. |
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1093 |
changeStream close. |
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1094 |
fullParseTree := Parser parseExpression:chunk. |
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1095 |
(fullParseTree isNil or:[fullParseTree == #Error]) ifTrue:[ |
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1096 |
fullParseTree := nil |
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1097 |
]. |
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1098 |
fullParseTree isMessage ifFalse:[ |
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1099 |
fullParseTree := nil |
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1100 |
]. |
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1101 |
"/ actually, the nil case cannot happen |
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1102 |
fullParseTree notNil ifTrue:[ |
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1103 |
aParseTree := fullParseTree. |
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1104 |
sel := aParseTree selector. |
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1105 |
]. |
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1106 |
]. |
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1107 |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1108 |
arg1Tree := aParseTree arg1. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1109 |
(arg1Tree notNil and:[arg1Tree isConstant]) ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1110 |
name := arg1Tree value asString. |
1293
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1111 |
|
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1112 |
"/ is it a private-class ? |
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1113 |
('*privateIn:' match:sel) ifTrue:[ |
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1114 |
ownerTree := aParseTree args last. |
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1115 |
ownerName := ownerTree name asString. |
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1116 |
name := ownerName , '::' , name |
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1117 |
]. |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1118 |
changeClassNames at:changeNr put:name. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1119 |
^ name |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1120 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1121 |
"very strange" |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1122 |
^ nil |
202 | 1123 |
]. |
1124 |
||
1125 |
" |
|
1126 |
is it a class remove ? |
|
1127 |
" |
|
1128 |
(sel == #removeClass:) ifTrue:[ |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1129 |
(recTree notNil |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1130 |
and:[recTree ~~ #Error |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1131 |
and:[recTree isPrimary |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1132 |
and:[recTree name = 'Smalltalk']]]) ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1133 |
arg1Tree := aParseTree arg1. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1134 |
(arg1Tree notNil and:[arg1Tree isPrimary]) ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1135 |
name := arg1Tree name. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1136 |
changeClassNames at:changeNr put:name. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1137 |
^ name |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1138 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1139 |
] |
202 | 1140 |
]. |
1141 |
||
1142 |
" |
|
1143 |
is it a method category change ? |
|
1144 |
" |
|
928 | 1145 |
((sel == #category:) |
1146 |
or:[sel == #privacy:]) ifTrue:[ |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1147 |
(recTree notNil |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1148 |
and:[recTree ~~ #Error |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1149 |
and:[recTree isMessage |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1150 |
and:[recTree selector == #compiledMethodAt:]]]) ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1151 |
isMeta := false. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1152 |
recTree := recTree receiver. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1153 |
recTree isUnaryMessage ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1154 |
(recTree selector ~~ #class) ifTrue:[^ nil]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1155 |
"id class " |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1156 |
recTree := recTree receiver |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1157 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1158 |
recTree isPrimary ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1159 |
isMeta ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1160 |
name := name , ' class'. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1161 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1162 |
name := recTree name. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1163 |
changeClassNames at:changeNr put:name. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1164 |
^ name |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1165 |
] |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1166 |
] |
202 | 1167 |
]. |
1168 |
^ nil |
|
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1169 |
|
1293
0ce8e42c09ea
care for private classes when extracting a className
Claus Gittinger <cg@exept.de>
parents:
1275
diff
changeset
|
1170 |
"Modified: 18.8.1997 / 16:43:14 / cg" |
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1171 |
! |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1172 |
|
202 | 1173 |
makeChangeAPatch:changeNr |
1174 |
"append change to patchfile" |
|
1175 |
||
1176 |
self appendChange:changeNr toFile:'patches' |
|
1177 |
! |
|
1178 |
||
1179 |
makeChangePermanent:changeNr |
|
1180 |
"rewrite the source file where change changeNr lies" |
|
1181 |
||
1182 |
self notify:'this is not yet implemented' |
|
1183 |
! |
|
1184 |
||
1185 |
newLabel:how |
|
1186 |
|l| |
|
1187 |
||
1188 |
(changeFileName ~= 'changes') ifTrue:[ |
|
1189 |
l := 'Changes Browser: ', changeFileName |
|
1190 |
] ifFalse:[ |
|
1191 |
l := 'Changes Browser' |
|
1192 |
]. |
|
1193 |
l := l , ' ' , how. |
|
1194 |
self label:l |
|
1195 |
||
1196 |
"Created: 8.9.1995 / 19:32:04 / claus" |
|
1197 |
"Modified: 8.9.1995 / 19:39:29 / claus" |
|
1198 |
! |
|
1199 |
||
255 | 1200 |
numberOfChanges |
1201 |
^ changePositions size |
|
1202 |
||
1203 |
"Created: 3.12.1995 / 18:15:39 / cg" |
|
1204 |
! |
|
1205 |
||
202 | 1206 |
queryCloseText |
1207 |
"made this a method for easy redefinition in subclasses" |
|
1208 |
||
1209 |
^ 'Quit without updating changeFile ?' |
|
1210 |
! |
|
1211 |
||
1212 |
readChangesFile |
|
1213 |
"read the changes file, create a list of header-lines (changeChunks) |
|
1214 |
and a list of chunk-positions (changePositions)" |
|
1215 |
||
1216 |
^ self readChangesFileInBackground:false |
|
1217 |
! |
|
1218 |
||
37 | 1219 |
readChangesFileInBackground:inBackground |
1220 |
"read the changes file, create a list of header-lines (changeChunks) |
|
51 | 1221 |
and a list of chunk-positions (changePositions). |
1222 |
Starting with 2.10.3, the entries are multi-col entries; |
|
1223 |
the cols are: |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1224 |
1 delta (only if comparing) |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1225 |
'+' -> new method (w.r.t. current state) |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1226 |
'-' -> removed method (w.r.t. current state) |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1227 |
'?' -> class does not exist currently |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1228 |
'=' -> change is same as current methods source |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1229 |
2 class/selector |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1230 |
3 type of change |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1231 |
doit |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1232 |
method |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1233 |
category change |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1234 |
4 timestamp |
89 | 1235 |
|
1236 |
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
|
1237 |
default and can be enabled via a toggle." |
37 | 1238 |
|
829
b6b0be2e14af
changes for new return from OS>>infoOf:
Claus Gittinger <cg@exept.de>
parents:
761
diff
changeset
|
1239 |
|aStream maxLen i f| |
50 | 1240 |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1241 |
editingClassSource := false. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1242 |
|
50 | 1243 |
maxLen := 60. |
0 | 1244 |
|
133 | 1245 |
f := changeFileName asFilename. |
1246 |
aStream := f readStream. |
|
0 | 1247 |
aStream isNil ifTrue:[^ nil]. |
1248 |
||
326 | 1249 |
self newLabel:'updating ...'. |
1250 |
||
829
b6b0be2e14af
changes for new return from OS>>infoOf:
Claus Gittinger <cg@exept.de>
parents:
761
diff
changeset
|
1251 |
i := f info. |
b6b0be2e14af
changes for new return from OS>>infoOf:
Claus Gittinger <cg@exept.de>
parents:
761
diff
changeset
|
1252 |
changeFileSize := i size. |
b6b0be2e14af
changes for new return from OS>>infoOf:
Claus Gittinger <cg@exept.de>
parents:
761
diff
changeset
|
1253 |
changeFileTimestamp := i modified. |
133 | 1254 |
|
294 | 1255 |
self withReadCursorDo:[ |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1256 |
|myProcess myPriority| |
49 | 1257 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1258 |
" |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1259 |
this is a time consuming operation (especially, if reading an |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1260 |
NFS-mounted directory; therefore lower my priority ... |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1261 |
" |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1262 |
inBackground ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1263 |
myProcess := Processor activeProcess. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1264 |
myPriority := myProcess priority. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1265 |
myProcess priority:(Processor userBackgroundPriority). |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1266 |
]. |
51 | 1267 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1268 |
[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1269 |
|excla timeStampInfo| |
50 | 1270 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1271 |
changeChunks := OrderedCollection new. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1272 |
changeHeaderLines := OrderedCollection new. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1273 |
changePositions := OrderedCollection new. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1274 |
changeTimeStamps := OrderedCollection new. |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1275 |
changeIsFollowupMethodChange := OrderedCollection new. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1276 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1277 |
excla := aStream class chunkSeparator. |
0 | 1278 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1279 |
[aStream atEnd] whileFalse:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1280 |
|entry changeDelta changeString changeType |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1281 |
line s l changeClass sawExcla category |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1282 |
chunkText chunkPos sel| |
51 | 1283 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1284 |
" |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1285 |
get a chunk (separated by excla) |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1286 |
" |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1287 |
aStream skipSeparators. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1288 |
chunkPos := aStream position. |
73 | 1289 |
|
1290 |
||
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1291 |
sawExcla := aStream peekFor:excla. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1292 |
chunkText := aStream nextChunk. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1293 |
chunkText notNil ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1294 |
|index headerLine cls| |
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1295 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1296 |
(chunkText startsWith:'''---- timestamp ') ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1297 |
timeStampInfo := (chunkText copyFrom:16 to:(chunkText size - 6)) withoutSpaces. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1298 |
] ifFalse:[ |
51 | 1299 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1300 |
" |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1301 |
only first line is saved in changeChunks ... |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1302 |
" |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1303 |
index := chunkText indexOf:(Character cr). |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1304 |
(index ~~ 0) ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1305 |
chunkText := chunkText copyTo:(index - 1). |
45 | 1306 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1307 |
"take care for comment changes - must still be a |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1308 |
valid expression for classNameOfChange: to work" |
50 | 1309 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1310 |
(chunkText endsWith:'comment:''') ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1311 |
chunkText := chunkText , '...''' |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1312 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1313 |
(chunkText endsWith:'primitiveDefinitions:''') ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1314 |
sel := 'primitiveDefinitions:'. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1315 |
chunkText := chunkText copyWithoutLast:1 |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1316 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1317 |
(chunkText endsWith:'primitiveVariables:''') ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1318 |
sel := 'primitiveVariables:'. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1319 |
chunkText := chunkText copyWithoutLast:1 |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1320 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1321 |
(chunkText endsWith:'primitiveFunctions:''') ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1322 |
sel := 'primitiveFunctions:'. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1323 |
chunkText := chunkText copyWithoutLast:1 |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1324 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1325 |
]. |
51 | 1326 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1327 |
changeChunks add:chunkText. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1328 |
changePositions add:chunkPos. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1329 |
changeTimeStamps add:timeStampInfo. |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1330 |
changeIsFollowupMethodChange add:false. |
37 | 1331 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1332 |
headerLine := nil. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1333 |
changeDelta := ' '. |
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1334 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1335 |
sawExcla ifFalse:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1336 |
(chunkText startsWith:'''---- snap') ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1337 |
changeType := ''. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1338 |
headerLine := chunkText. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1339 |
changeString := (chunkText contractTo:maxLen). |
286
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
1340 |
timeStampInfo := nil. |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1341 |
] ifFalse:[ |
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1342 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1343 |
|p cls| |
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1344 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1345 |
headerLine := chunkText , ' (doIt)'. |
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1346 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1347 |
" |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1348 |
first, assume doIt - then lets have a more detailed look ... |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1349 |
" |
286
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
1350 |
((chunkText startsWith:'''---- file') |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
1351 |
or:[(chunkText startsWith:'''---- check')]) ifTrue:[ |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1352 |
changeType := ''. |
286
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
1353 |
timeStampInfo := nil. |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1354 |
] ifFalse:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1355 |
changeType := '(doIt)'. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1356 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1357 |
changeString := (chunkText contractTo:maxLen). |
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1358 |
|
1200
71de763d5847
always parse expressions in the Smalltalk nameSpace
Claus Gittinger <cg@exept.de>
parents:
1153
diff
changeset
|
1359 |
p := Parser parseExpression:chunkText inNameSpace:Smalltalk. |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1360 |
(p notNil |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1361 |
and:[p ~~ #Error |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1362 |
and:[p isMessage]]) ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1363 |
sel := p selector. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1364 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1365 |
(sel == #removeSelector:) ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1366 |
p receiver isUnaryMessage ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1367 |
cls := p receiver receiver name. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1368 |
changeClass := (Smalltalk classNamed:cls) class. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1369 |
cls := cls , ' class'. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1370 |
] ifFalse:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1371 |
cls := p receiver name. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1372 |
changeClass := (Smalltalk classNamed:cls) |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1373 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1374 |
sel := (p args at:1) evaluate. |
50 | 1375 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1376 |
compareChanges ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1377 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1378 |
changeDelta := '?' |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1379 |
] ifFalse:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1380 |
(changeClass implements:sel asSymbol) ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1381 |
changeDelta := '-'. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1382 |
] |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1383 |
] |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1384 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1385 |
changeType := '(remove)'. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1386 |
changeString := self contractClass:cls selector:sel to:maxLen. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1387 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1388 |
(p ~~ #Error |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1389 |
and:[p isMessage |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1390 |
and:[p receiver isMessage |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1391 |
and:[p receiver selector == #compiledMethodAt:]]]) ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1392 |
p receiver receiver isUnaryMessage ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1393 |
cls := p receiver receiver receiver name. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1394 |
changeClass := (Smalltalk classNamed:cls) class. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1395 |
cls := cls , ' class'. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1396 |
] ifFalse:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1397 |
cls := p receiver receiver name. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1398 |
changeClass := (Smalltalk classNamed:cls) |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1399 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1400 |
(sel == #category:) ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1401 |
sel := (p receiver args at:1) evaluate. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1402 |
changeType := '(category change)'. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1403 |
changeString := self contractClass:cls selector:sel to:maxLen. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1404 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1405 |
(sel == #privacy:) ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1406 |
sel := (p receiver args at:1) evaluate. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1407 |
changeType := '(privacy change)'. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1408 |
changeString := self contractClass:cls selector:sel to:maxLen. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1409 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1410 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1411 |
(#(#'subclass:' |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1412 |
#'variableSubclass:' |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1413 |
#'variableByteSubclass:' |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1414 |
#'variableWordSubclass:' |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1415 |
#'variableLongSubclass:' |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1416 |
#'variableFloatSubclass:' |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1417 |
#'variableDoubleSubclass:' |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1418 |
#'primitiveDefinitions:' |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1419 |
#'primitiveFunctions:' |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1420 |
#'primitiveVariables:' |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1421 |
) includes:sel) ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1422 |
changeType := '(class definition)'. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1423 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1424 |
] |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1425 |
] ifTrue:[ "sawExcla" |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1426 |
|done first p className cls text methodPos| |
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1427 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1428 |
" |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1429 |
method definitions actually consist of |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1430 |
two (or more) chunks; skip next chunk(s) |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1431 |
up to an empty one. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1432 |
The system only writes one chunk, |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1433 |
and we cannot handle more in this ChangesBrowser .... |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1434 |
" |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1435 |
className := nil. |
1200
71de763d5847
always parse expressions in the Smalltalk nameSpace
Claus Gittinger <cg@exept.de>
parents:
1153
diff
changeset
|
1436 |
p := Parser parseExpression:chunkText inNameSpace:Smalltalk. |
89 | 1437 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1438 |
(p notNil and:[p ~~ #Error]) ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1439 |
sel := p selector. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1440 |
(sel == #methodsFor:) ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1441 |
p receiver isUnaryMessage ifTrue:[ |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1442 |
className := p receiver receiver name. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1443 |
changeClass := (Smalltalk classNamed:className) class. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1444 |
className := className , ' class'. |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1445 |
] ifFalse:[ |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1446 |
className := p receiver name. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1447 |
changeClass := Smalltalk classNamed:className |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1448 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1449 |
category := (p args at:1) evaluate. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1450 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1451 |
]. |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1452 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1453 |
done := false. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1454 |
first := true. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1455 |
[done] whileFalse:[ |
704 | 1456 |
changeDelta := ' '. |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1457 |
methodPos := aStream position. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1458 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1459 |
text := aStream nextChunk. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1460 |
text isNil ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1461 |
done := true |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1462 |
] ifFalse:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1463 |
done := text isEmpty |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1464 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1465 |
done ifFalse:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1466 |
first ifFalse:[ |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1467 |
changeChunks add:chunkText. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1468 |
changePositions add:methodPos. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1469 |
changeTimeStamps add:timeStampInfo. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1470 |
changeIsFollowupMethodChange add:true. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1471 |
editingClassSource := true. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1472 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1473 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1474 |
first := false. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1475 |
" |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1476 |
try to find the selector |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1477 |
" |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1478 |
sel := nil. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1479 |
className notNil ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1480 |
p := Parser |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1481 |
parseMethodSpecification:text |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1482 |
in:nil |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1483 |
ignoreErrors:true |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1484 |
ignoreWarnings:true. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1485 |
(p notNil and:[p ~~ #Error]) ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1486 |
sel := p selector. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1487 |
] |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1488 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1489 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1490 |
sel isNil ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1491 |
changeString := (chunkText contractTo:maxLen). |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1492 |
changeType := '(change)'. |
704 | 1493 |
headerLine := chunkText , ' (change)'. |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1494 |
] ifFalse:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1495 |
changeString := self contractClass:className selector:sel to:maxLen. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1496 |
changeType := '(method in: ''' , category , ''')'. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1497 |
headerLine := className , ' ' , sel , ' ' , '(change category: ''' , category , ''')'. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1498 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1499 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1500 |
compareChanges ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1501 |
changeClass isNil ifFalse:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1502 |
changeClass isMeta ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1503 |
cls := changeClass soleInstance |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1504 |
] ifFalse:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1505 |
cls := changeClass |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1506 |
]. |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1507 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1508 |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1509 |
(changeClass isNil or:[cls isLoaded not]) ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1510 |
changeDelta := '?' |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1511 |
] ifFalse:[ |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1512 |
(changeClass implements:sel asSymbol) ifFalse:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1513 |
changeDelta := '+'. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1514 |
] ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1515 |
|m currentText t1 t2| |
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1516 |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1517 |
m := changeClass compiledMethodAt:sel asSymbol. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1518 |
currentText := m source. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1519 |
currentText notNil ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1520 |
text asString = currentText asString ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1521 |
changeDelta := '=' |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1522 |
] ifFalse:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1523 |
t1 := currentText asCollectionOfLines collect:[:s | s withTabsExpanded]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1524 |
t2 := text asCollectionOfLines collect:[:s | s withTabsExpanded]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1525 |
t1 = t2 ifTrue:[ |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1526 |
changeDelta := '=' |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1527 |
] |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1528 |
] |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1529 |
] |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1530 |
] |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1531 |
] |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1532 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1533 |
entry := MultiColListEntry new. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1534 |
entry tabulatorSpecification:tabSpec. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1535 |
entry colAt:1 put:changeDelta. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1536 |
entry colAt:2 put:changeString. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1537 |
entry colAt:3 put:changeType. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1538 |
timeStampInfo notNil ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1539 |
entry colAt:4 put:timeStampInfo. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1540 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1541 |
changeHeaderLines add:entry |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1542 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1543 |
changeString := nil. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1544 |
headerLine := nil. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1545 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1546 |
] |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1547 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1548 |
changeString notNil ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1549 |
entry := MultiColListEntry new. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1550 |
entry tabulatorSpecification:tabSpec. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1551 |
entry colAt:1 put:changeDelta. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1552 |
entry colAt:2 put:changeString. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1553 |
entry colAt:3 put:changeType. |
286
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
1554 |
timeStampInfo notNil ifTrue:[ |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
1555 |
entry colAt:4 put:timeStampInfo. |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
1556 |
]. |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1557 |
changeHeaderLines add:entry |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1558 |
] ifFalse:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1559 |
headerLine notNil ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1560 |
changeHeaderLines add:headerLine |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1561 |
] |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1562 |
] |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1563 |
] |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1564 |
] |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1565 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1566 |
changeClassNames := OrderedCollection new grow:(changeChunks size). |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1567 |
anyChanges := false |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1568 |
] valueNowOrOnUnwindDo:[ |
911
f7a7082c20dc
close the changes stream (in case of an abort)
Claus Gittinger <cg@exept.de>
parents:
876
diff
changeset
|
1569 |
aStream close. |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1570 |
inBackground ifTrue:[myProcess priority:myPriority]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1571 |
]. |
133 | 1572 |
]. |
1573 |
||
1574 |
self checkIfFileHasChanged |
|
123 | 1575 |
|
1576 |
"Modified: 27.8.1995 / 23:06:55 / claus" |
|
1200
71de763d5847
always parse expressions in the Smalltalk nameSpace
Claus Gittinger <cg@exept.de>
parents:
1153
diff
changeset
|
1577 |
"Modified: 24.6.1997 / 16:44:57 / cg" |
45 | 1578 |
! |
37 | 1579 |
|
209
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1580 |
selectorOfMethodChange:changeNr |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1581 |
"return a method-changes selector, or nil if its not a methodChange" |
209
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1582 |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1583 |
|source parser sel| |
209
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1584 |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1585 |
source := self sourceOfMethodChange:changeNr. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1586 |
source isNil ifTrue:[^ nil]. |
209
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1587 |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1588 |
parser := Parser |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1589 |
parseMethod:source |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1590 |
in:nil |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1591 |
ignoreErrors:true |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1592 |
ignoreWarnings:true. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1593 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1594 |
(parser notNil and:[parser ~~ #Error]) ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1595 |
sel := parser selector. |
209
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1596 |
]. |
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1597 |
^ sel |
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1598 |
|
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1599 |
"Created: 24.11.1995 / 14:30:46 / cg" |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1600 |
"Modified: 5.9.1996 / 17:12:50 / cg" |
209
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1601 |
! |
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1602 |
|
202 | 1603 |
setChangeList |
1604 |
"extract type-information from changes and stuff into top selection |
|
1605 |
view" |
|
51 | 1606 |
|
202 | 1607 |
changeListView setList:changeHeaderLines expandTabs:false. |
1608 |
"/ changeListView deselect. |
|
51 | 1609 |
! |
1610 |
||
73 | 1611 |
silentDeleteChange:changeNr |
1612 |
"delete a change do not update changeListView" |
|
57 | 1613 |
|
73 | 1614 |
anyChanges := true. |
1615 |
changeChunks removeIndex:changeNr. |
|
1616 |
changePositions removeIndex:changeNr. |
|
1617 |
changeClassNames removeIndex:changeNr. |
|
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1618 |
changeHeaderLines removeIndex:changeNr. |
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1619 |
changeTimeStamps removeIndex:changeNr |
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1620 |
|
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1621 |
"Modified: 18.11.1995 / 17:08:44 / cg" |
45 | 1622 |
! |
1623 |
||
202 | 1624 |
silentDeleteChangesFor:aClassName from:start to:stop |
1625 |
"delete changes for a given class in a range" |
|
45 | 1626 |
|
202 | 1627 |
|thisClassName index| |
45 | 1628 |
|
202 | 1629 |
index := stop. |
1630 |
[index >= start] whileTrue:[ |
|
1631 |
thisClassName := self classNameOfChange:index. |
|
1632 |
thisClassName = aClassName ifTrue:[ |
|
1633 |
self silentDeleteChange:index |
|
51 | 1634 |
]. |
202 | 1635 |
index := index - 1 |
1636 |
] |
|
51 | 1637 |
|
45 | 1638 |
! |
1639 |
||
1070
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
1640 |
silentDeleteInternalChange:changeNr |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
1641 |
"delete a change do not update changeListView" |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
1642 |
|
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
1643 |
anyChanges := true. |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
1644 |
changeChunks removeIndex:changeNr. |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
1645 |
changePositions removeIndex:changeNr. |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
1646 |
changeClassNames removeIndex:changeNr. |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
1647 |
changeTimeStamps removeIndex:changeNr |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
1648 |
|
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
1649 |
"Modified: 18.11.1995 / 17:08:44 / cg" |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
1650 |
"Created: 7.3.1997 / 16:28:32 / cg" |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
1651 |
! |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
1652 |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1653 |
sourceOfMethodChange:changeNr |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1654 |
"return a method-changes source code, or nil if its not a methodChange." |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1655 |
|
742
2ef5e22d8983
code cleanup (unused vars eliminated)
Claus Gittinger <cg@exept.de>
parents:
724
diff
changeset
|
1656 |
|aStream chunk sawExcla parseTree sourceChunk| |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1657 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1658 |
aStream := self streamForChange:changeNr. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1659 |
aStream isNil ifTrue:[^ nil]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1660 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1661 |
(changeIsFollowupMethodChange at:changeNr) ifFalse:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1662 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1663 |
chunk := aStream nextChunk. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1664 |
] ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1665 |
chunk := (changeChunks at:changeNr). |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1666 |
sawExcla := true. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1667 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1668 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1669 |
sawExcla ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1670 |
parseTree := Parser parseExpression:chunk. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1671 |
(parseTree notNil and:[parseTree isMessage]) ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1672 |
(parseTree selector == #methodsFor:) ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1673 |
sourceChunk := aStream nextChunk. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1674 |
] |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1675 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1676 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1677 |
aStream close. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1678 |
^ sourceChunk |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1679 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1680 |
"Modified: 5.9.1996 / 17:08:33 / cg" |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1681 |
"Created: 5.9.1996 / 17:11:32 / cg" |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1682 |
! |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1683 |
|
202 | 1684 |
streamForChange:changeNr |
1685 |
"answer a stream for change" |
|
1686 |
||
1687 |
|aStream| |
|
73 | 1688 |
|
202 | 1689 |
(changeNr between:1 and:changePositions size) ifFalse:[^ nil]. |
1690 |
aStream := FileStream readonlyFileNamed:changeFileName. |
|
1691 |
aStream isNil ifTrue:[^ nil]. |
|
1692 |
aStream position:(changePositions at:changeNr). |
|
1693 |
^ aStream |
|
1694 |
! |
|
1695 |
||
1696 |
unselect |
|
1697 |
"common unselect" |
|
1698 |
||
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1699 |
changeListView setSelection:nil. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1700 |
|
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1701 |
"Modified: 25.5.1996 / 13:02:49 / cg" |
73 | 1702 |
! |
1703 |
||
1704 |
withSelectedChangeDo:aBlock |
|
1705 |
"just a helper, check for a selected change and evaluate aBlock |
|
1706 |
with busy cursor" |
|
1707 |
||
1708 |
|changeNr| |
|
1709 |
||
1710 |
changeNr := changeListView selection. |
|
1711 |
changeNr notNil ifTrue:[ |
|
294 | 1712 |
self withExecuteCursorDo:[ |
1713 |
aBlock value:changeNr |
|
1714 |
] |
|
73 | 1715 |
] |
294 | 1716 |
|
1717 |
"Modified: 14.12.1995 / 20:58:45 / cg" |
|
73 | 1718 |
! |
1719 |
||
45 | 1720 |
writeBackChanges |
163
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1721 |
"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
|
1722 |
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
|
1723 |
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
|
1724 |
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
|
1725 |
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
|
1726 |
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
|
1727 |
or we have at least a backup of the previous change file." |
45 | 1728 |
|
1316 | 1729 |
|inStream outStream tempfile stamp f| |
163
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1730 |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1731 |
editingClassSource ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1732 |
(self confirm:'You are editing a classes sourceFile (not a changeFile) !!\\Are you certain, you want to overwrite it ?' withCRs) |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1733 |
ifFalse:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1734 |
^ false |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1735 |
] |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1736 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1737 |
|
163
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1738 |
tempfile := Filename newTemporaryIn:nil. |
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1739 |
tempfile exists ifTrue:[tempfile remove]. |
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1740 |
|
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1741 |
outStream := tempfile writeStream. |
45 | 1742 |
outStream isNil ifTrue:[ |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1743 |
self warn:'cannot create temporary file in current directory.'. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1744 |
^ false |
45 | 1745 |
]. |
1746 |
||
1747 |
inStream := FileStream readonlyFileNamed:changeFileName. |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1748 |
inStream isNil ifTrue:[^ false]. |
45 | 1749 |
|
1750 |
self withCursor:(Cursor write) do:[ |
|
1014
2197dfb7c573
Use Filename instead of FileDirectory.
Stefan Vogel <sv@exept.de>
parents:
975
diff
changeset
|
1751 |
|excla sawExcla done chunk |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1752 |
nChanges "{Class:SmallInteger}" | |
51 | 1753 |
|
1264
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1754 |
Stream writeErrorSignal handle:[:ex | |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1755 |
self warn:('could not update the changes file.\\' , ex errorString) withCRs. |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1756 |
^ false |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1757 |
] do:[ |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1758 |
|
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1759 |
excla := inStream class chunkSeparator. |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1760 |
nChanges := self numberOfChanges. |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1761 |
|
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1762 |
1 to:nChanges do:[:index | |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1763 |
inStream position:(changePositions at:index). |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1764 |
sawExcla := inStream peekFor:excla. |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1765 |
chunk := inStream nextChunk. |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1766 |
(stamp := changeTimeStamps at:index) notNil ifTrue:[ |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1767 |
outStream nextPutAll:'''---- timestamp ' , stamp , ' ----'''. |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1768 |
outStream nextPut:excla; cr. |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1769 |
]. |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1770 |
|
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1771 |
sawExcla ifTrue:[ |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1772 |
outStream nextPut:excla. |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1773 |
outStream nextChunkPut:chunk. |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1774 |
outStream cr. |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1775 |
" |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1776 |
a method-definition chunk - skip followups |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1777 |
" |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1778 |
done := false. |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1779 |
[done] whileFalse:[ |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1780 |
chunk := inStream nextChunk. |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1781 |
chunk isNil ifTrue:[ |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1782 |
done := true |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1783 |
] ifFalse:[ |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1784 |
outStream nextChunkPut:chunk. |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1785 |
outStream cr. |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1786 |
done := chunk isEmpty |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1787 |
] |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1788 |
]. |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1789 |
] ifFalse:[ |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1790 |
outStream nextChunkPut:chunk. |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1791 |
outStream cr |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1792 |
] |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1793 |
]. |
1264
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1794 |
outStream close. |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1795 |
inStream close. |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1796 |
]. |
1264
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1797 |
|
1316 | 1798 |
f := changeFileName asFilename. |
1321 | 1799 |
f renameTo:(f withSuffix:'bak'). |
1014
2197dfb7c573
Use Filename instead of FileDirectory.
Stefan Vogel <sv@exept.de>
parents:
975
diff
changeset
|
1800 |
tempfile renameTo:changeFileName. |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1801 |
anyChanges := false |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1802 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1803 |
^ true |
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1804 |
|
1014
2197dfb7c573
Use Filename instead of FileDirectory.
Stefan Vogel <sv@exept.de>
parents:
975
diff
changeset
|
1805 |
"Modified: 2.12.1996 / 22:29:15 / stefan" |
1264
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1806 |
"Modified: 31.7.1997 / 18:27:14 / cg" |
202 | 1807 |
! ! |
0 | 1808 |
|
202 | 1809 |
!ChangesBrowser methodsFor:'termination'! |
51 | 1810 |
|
202 | 1811 |
destroy |
1812 |
"destroy the receiver; make certain, that boxes are destroyed too" |
|
73 | 1813 |
|
202 | 1814 |
Processor removeTimedBlock:checkBlock. |
1815 |
ObjectMemory removeDependent:self. |
|
1816 |
super destroy |
|
51 | 1817 |
! |
1818 |
||
202 | 1819 |
saveAndTerminate |
1820 |
"update the changes file and quit. |
|
1821 |
Dont depend on this being sent, not all window managers |
|
1822 |
send it; instead, they simply destroy the view." |
|
28 | 1823 |
|
202 | 1824 |
anyChanges ifTrue:[ |
1825 |
self writeBackChanges. |
|
0 | 1826 |
]. |
202 | 1827 |
self destroy |
0 | 1828 |
! |
1829 |
||
202 | 1830 |
terminate |
1831 |
"window manager wants us to go away" |
|
28 | 1832 |
|
1264
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1833 |
|action again| |
0 | 1834 |
|
202 | 1835 |
anyChanges ifTrue:[ |
1264
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1836 |
again := true. |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1837 |
[again] whileTrue:[ |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1838 |
action := OptionBox |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1839 |
request:(resources at:'changefile has not been updated from the modified changelist.\\Update before closing ?') withCRs |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1840 |
label:'ChangesBrowser' |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1841 |
form:(WarningBox iconBitmap) |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1842 |
buttonLabels:(resources array:#('cancel' 'don''t update' 'update')) |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1843 |
values:#(#abort #ignore #save) |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1844 |
default:#save. |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1845 |
|
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1846 |
again := false. |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1847 |
action == #abort ifTrue:[^ self]. |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1848 |
action == #save ifTrue:[ |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1849 |
again := self writeBackChanges not |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1850 |
]. |
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1851 |
] |
202 | 1852 |
]. |
1853 |
self destroy |
|
373 | 1854 |
|
1264
6d8f690883f1
care for write-errors while saving the changeFile
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1855 |
"Modified: 31.7.1997 / 18:29:06 / cg" |
0 | 1856 |
! ! |
1857 |
||
73 | 1858 |
!ChangesBrowser methodsFor:'user interaction'! |
51 | 1859 |
|
221 | 1860 |
autoUpdate:aBoolean |
1861 |
autoUpdate := aBoolean |
|
1862 |
||
1863 |
"Created: 3.12.1995 / 14:14:24 / cg" |
|
1864 |
"Modified: 3.12.1995 / 14:20:45 / cg" |
|
1865 |
! |
|
1866 |
||
0 | 1867 |
changeSelection:lineNr |
1868 |
"show a change in the codeView" |
|
1869 |
||
1870 |
|aStream sawExcla chunk| |
|
1871 |
||
1872 |
aStream := self streamForChange:lineNr. |
|
1873 |
aStream isNil ifTrue:[^ self]. |
|
1874 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
|
1875 |
chunk := aStream nextChunk. |
|
1876 |
sawExcla ifTrue:[ |
|
45 | 1877 |
chunk := aStream nextChunk |
0 | 1878 |
]. |
1879 |
aStream close. |
|
1880 |
codeView contents:chunk. |
|
13 | 1881 |
codeView acceptAction:[:theCode | self doApply "noChangesAllowed"]. |
15 | 1882 |
changeNrShown := lineNr. |
0 | 1883 |
|
51 | 1884 |
! |
1885 |
||
202 | 1886 |
doApply |
1887 |
"user wants a change to be applied" |
|
45 | 1888 |
|
202 | 1889 |
self withSelectedChangeDo:[:changeNr | |
1890 |
skipSignal := nil. |
|
1891 |
self applyChange:changeNr. |
|
1892 |
self autoSelect:(changeNr + 1) |
|
1893 |
] |
|
45 | 1894 |
! |
1895 |
||
202 | 1896 |
doApplyAll |
1897 |
"user wants all changes to be applied" |
|
37 | 1898 |
|
294 | 1899 |
self withExecuteCursorDo:[ |
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1900 |
|lastNr "{ Class: SmallInteger }" | |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1901 |
|
294 | 1902 |
self clearCodeView. |
1903 |
skipSignal isNil ifTrue:[skipSignal := Signal new]. |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1904 |
lastNr := self numberOfChanges. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1905 |
1 to:lastNr do:[:changeNr | |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1906 |
changeListView setSelection:changeNr. |
294 | 1907 |
self applyChange:changeNr |
1908 |
]. |
|
1909 |
self autoSelectLast |
|
202 | 1910 |
] |
294 | 1911 |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1912 |
"Modified: 21.1.1997 / 22:26:30 / cg" |
37 | 1913 |
! |
1914 |
||
202 | 1915 |
doApplyClassRest |
1916 |
"user wants all changes for this class from changeNr to be applied" |
|
1917 |
||
1918 |
self withSelectedChangeDo:[:changeNr | |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1919 |
|thisClassName classNameToApply lastChange |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1920 |
lastNr "{ Class: SmallInteger }" | |
37 | 1921 |
|
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1922 |
classNameToApply := self classNameOfChange:changeNr. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1923 |
classNameToApply notNil ifTrue:[ |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1924 |
self clearCodeView. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1925 |
skipSignal isNil ifTrue:[skipSignal := Signal new]. |
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1926 |
|
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1927 |
lastNr := self numberOfChanges. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1928 |
changeNr to:lastNr do:[:changeNr | |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1929 |
thisClassName := self classNameOfChange:changeNr. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1930 |
thisClassName = classNameToApply ifTrue:[ |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1931 |
changeListView setSelection:changeNr. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1932 |
self applyChange:changeNr. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1933 |
lastChange := changeNr |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1934 |
]. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1935 |
]. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1936 |
self autoSelect:lastChange. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1937 |
] |
202 | 1938 |
] |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1939 |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1940 |
"Modified: 21.1.1997 / 22:26:04 / cg" |
37 | 1941 |
! |
1942 |
||
202 | 1943 |
doApplyRest |
1944 |
"user wants all changes from changeNr to be applied" |
|
28 | 1945 |
|
202 | 1946 |
self withSelectedChangeDo:[:changeNr | |
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1947 |
|lastNr "{ Class: SmallInteger }" | |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1948 |
|
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1949 |
self clearCodeView. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1950 |
skipSignal isNil ifTrue:[skipSignal := Signal new]. |
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1951 |
|
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1952 |
lastNr := self numberOfChanges. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1953 |
changeNr to:lastNr do:[:changeNr | |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1954 |
changeListView setSelection:changeNr. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1955 |
self applyChange:changeNr |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1956 |
]. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1957 |
self autoSelect:self numberOfChanges. |
37 | 1958 |
] |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1959 |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1960 |
"Modified: 21.1.1997 / 22:25:29 / cg" |
37 | 1961 |
! |
1962 |
||
45 | 1963 |
doBrowse |
1964 |
"user wants a browser on the class of a change" |
|
1965 |
||
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1966 |
|changeNr className cls isMeta| |
45 | 1967 |
|
1968 |
changeNr := changeListView selection. |
|
1969 |
changeNr notNil ifTrue:[ |
|
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1970 |
className := self fullClassNameOfChange:changeNr. |
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1971 |
className notNil ifTrue:[ |
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1972 |
isMeta := false. |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1973 |
(className endsWith:' class') ifTrue:[ |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1974 |
className := className copyWithoutLast:6. |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1975 |
isMeta := true. |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1976 |
]. |
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1977 |
(cls := Smalltalk classNamed:className) notNil ifTrue:[ |
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1978 |
isMeta ifTrue:[ |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1979 |
cls := cls class |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1980 |
]. |
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1981 |
SystemBrowser |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1982 |
openInClass:cls |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1983 |
selector:(self selectorOfMethodChange:changeNr) |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1984 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1985 |
] |
37 | 1986 |
] |
209
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1987 |
|
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1988 |
"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
|
1989 |
"Modified: 6.12.1995 / 17:09:26 / cg" |
37 | 1990 |
! |
1991 |
||
73 | 1992 |
doCompare |
1993 |
"compare change with current system version |
|
1994 |
- give a note in transcript" |
|
1995 |
||
1996 |
|changeNr| |
|
1997 |
||
1998 |
changeNr := changeListView selection. |
|
1999 |
changeNr notNil ifTrue:[ |
|
294 | 2000 |
self withExecuteCursorDo:[ |
2001 |
self compareChange:changeNr |
|
2002 |
] |
|
394 | 2003 |
]. |
2004 |
self newLabel:'' |
|
294 | 2005 |
|
394 | 2006 |
"Modified: 24.2.1996 / 19:37:19 / cg" |
73 | 2007 |
! |
2008 |
||
45 | 2009 |
doCompress |
2010 |
"compress the change-set; this replaces multiple method-changes by the last |
|
2011 |
(i.e. the most recent) change" |
|
2012 |
||
51 | 2013 |
|aStream searchIndex anyMore deleteSet index |
2014 |
str snapshotProto snapshotPrefix snapshotNameIndex fileName| |
|
45 | 2015 |
|
2016 |
aStream := FileStream readonlyFileNamed:changeFileName. |
|
2017 |
aStream isNil ifTrue:[^ self]. |
|
2018 |
||
221 | 2019 |
self newLabel:'compressing ...'. |
2020 |
||
58 | 2021 |
CompressSnapshotInfo == true ifTrue:[ |
294 | 2022 |
" |
2023 |
get a prototype snapshot record (to be independent of |
|
2024 |
the actual format .. |
|
2025 |
" |
|
2026 |
str := WriteStream on:String new. |
|
2027 |
Class addChangeRecordForSnapshot:'foo' to:str. |
|
2028 |
snapshotProto := str contents. |
|
2029 |
snapshotPrefix := snapshotProto copyTo:10. |
|
2030 |
snapshotNameIndex := snapshotProto findString:'foo'. |
|
58 | 2031 |
]. |
45 | 2032 |
|
294 | 2033 |
self withExecuteCursorDo:[ |
2034 |
|numChanges classes selectors types excla sawExcla |
|
2035 |
changeNr chunk aParseTree parseTreeChunk |
|
2036 |
thisClass thisSelector codeChunk codeParser| |
|
51 | 2037 |
|
294 | 2038 |
numChanges := self numberOfChanges. |
2039 |
classes := Array new:numChanges. |
|
2040 |
selectors := Array new:numChanges. |
|
2041 |
types := Array new:numChanges. |
|
45 | 2042 |
|
294 | 2043 |
"starting at the end, get the change class and change selector; |
2044 |
collect all in classes / selectors" |
|
45 | 2045 |
|
294 | 2046 |
changeNr := numChanges. |
2047 |
excla := aStream class chunkSeparator. |
|
45 | 2048 |
|
294 | 2049 |
[changeNr >= 1] whileTrue:[ |
2050 |
aStream position:(changePositions at:changeNr). |
|
2051 |
sawExcla := aStream peekFor:excla. |
|
2052 |
chunk := aStream nextChunk. |
|
2053 |
sawExcla ifTrue:[ |
|
2054 |
"optimize a bit if multiple methods for same category arrive" |
|
2055 |
(chunk = parseTreeChunk) ifFalse:[ |
|
2056 |
aParseTree := Parser parseExpression:chunk. |
|
2057 |
parseTreeChunk := chunk |
|
2058 |
]. |
|
2059 |
(aParseTree notNil |
|
2060 |
and:[(aParseTree ~~ #Error) |
|
2061 |
and:[aParseTree isMessage]]) ifTrue:[ |
|
2062 |
(aParseTree selector == #methodsFor:) ifTrue:[ |
|
2063 |
thisClass := (aParseTree receiver evaluate). |
|
2064 |
codeChunk := aStream nextChunk. |
|
2065 |
codeParser := Parser |
|
2066 |
parseMethodSpecification:codeChunk |
|
2067 |
in:thisClass |
|
2068 |
ignoreErrors:true |
|
2069 |
ignoreWarnings:true. |
|
2070 |
(codeParser notNil and:[codeParser ~~ #Error]) ifTrue:[ |
|
2071 |
selectors at:changeNr put:(codeParser selector). |
|
2072 |
classes at:changeNr put:thisClass. |
|
2073 |
types at:changeNr put:#methodsFor |
|
2074 |
] |
|
2075 |
] |
|
2076 |
] |
|
2077 |
] ifFalse:[ |
|
2078 |
aParseTree := Parser parseExpression:chunk. |
|
2079 |
parseTreeChunk := chunk. |
|
2080 |
(aParseTree notNil |
|
2081 |
and:[(aParseTree ~~ #Error) |
|
2082 |
and:[aParseTree isMessage]]) ifTrue:[ |
|
2083 |
(aParseTree selector == #removeSelector:) ifTrue:[ |
|
2084 |
selectors at:changeNr put:(aParseTree arg1 value ). |
|
2085 |
classes at:changeNr put:(aParseTree receiver evaluate). |
|
2086 |
types at:changeNr put:#removeSelector |
|
2087 |
] |
|
2088 |
] ifFalse:[ |
|
2089 |
CompressSnapshotInfo == true ifTrue:[ |
|
2090 |
(chunk startsWith:snapshotPrefix) ifTrue:[ |
|
2091 |
str := chunk readStream position:snapshotNameIndex. |
|
2092 |
fileName := str upTo:(Character space). |
|
2093 |
" |
|
2094 |
kludge to allow use of match-check below |
|
2095 |
" |
|
2096 |
selectors at:changeNr put:snapshotPrefix. |
|
2097 |
classes at:changeNr put:fileName. |
|
2098 |
] |
|
2099 |
] |
|
2100 |
] |
|
2101 |
]. |
|
2102 |
changeNr := changeNr - 1 |
|
2103 |
]. |
|
2104 |
aStream close. |
|
45 | 2105 |
|
294 | 2106 |
"for all changes, look for another class/selector occurence later |
2107 |
in the list and, if there is one, add change number to the delete set" |
|
45 | 2108 |
|
294 | 2109 |
deleteSet := OrderedCollection new. |
2110 |
changeNr := 1. |
|
2111 |
[changeNr < self numberOfChanges] whileTrue:[ |
|
2112 |
thisClass := classes at:changeNr. |
|
2113 |
thisSelector := selectors at:changeNr. |
|
2114 |
searchIndex := changeNr. |
|
2115 |
anyMore := true. |
|
2116 |
[anyMore] whileTrue:[ |
|
2117 |
searchIndex := classes indexOf:thisClass |
|
2118 |
startingAt:(searchIndex + 1). |
|
2119 |
(searchIndex ~~ 0) ifTrue:[ |
|
2120 |
((selectors at:searchIndex) == thisSelector) ifTrue:[ |
|
2121 |
thisClass notNil ifTrue:[ |
|
2122 |
deleteSet add:changeNr. |
|
2123 |
anyMore := false |
|
2124 |
] |
|
2125 |
] |
|
2126 |
] ifFalse:[ |
|
2127 |
anyMore := false |
|
2128 |
] |
|
2129 |
]. |
|
2130 |
changeNr := changeNr + 1 |
|
2131 |
]. |
|
45 | 2132 |
|
294 | 2133 |
"finally delete what has been found" |
45 | 2134 |
|
294 | 2135 |
(deleteSet size > 0) ifTrue:[ |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2136 |
changeListView setSelection:nil. |
294 | 2137 |
index := deleteSet size. |
2138 |
[index > 0] whileTrue:[ |
|
2139 |
self silentDeleteChange:(deleteSet at:index). |
|
2140 |
index := index - 1 |
|
2141 |
]. |
|
2142 |
self setChangeList. |
|
2143 |
" |
|
2144 |
scroll back a bit, if we are left way behind the list |
|
2145 |
" |
|
2146 |
changeListView firstLineShown > self numberOfChanges ifTrue:[ |
|
2147 |
changeListView makeLineVisible:self numberOfChanges |
|
2148 |
]. |
|
2149 |
self clearCodeView |
|
2150 |
] |
|
221 | 2151 |
]. |
2152 |
self newLabel:''. |
|
2153 |
||
2154 |
"Created: 3.12.1995 / 14:29:54 / cg" |
|
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2155 |
"Modified: 25.5.1996 / 13:02:47 / cg" |
45 | 2156 |
! |
2157 |
||
202 | 2158 |
doDelete |
2159 |
"delete currently selected change" |
|
2160 |
||
2161 |
|changeNr| |
|
73 | 2162 |
|
202 | 2163 |
changeNr := changeListView selection. |
2164 |
changeNr notNil ifTrue:[ |
|
2165 |
self deleteChange:changeNr. |
|
2166 |
self autoSelectOrEnd:changeNr |
|
73 | 2167 |
] |
2168 |
! |
|
2169 |
||
202 | 2170 |
doDeleteClassAll |
2171 |
"delete all changes with same class as currently selected change" |
|
2172 |
||
2173 |
self withSelectedChangeDo:[:changeNr | |
|
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2174 |
| classNameToDelete | |
45 | 2175 |
|
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2176 |
classNameToDelete := self classNameOfChange:changeNr. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2177 |
classNameToDelete notNil ifTrue:[ |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2178 |
changeListView setSelection:nil. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2179 |
self silentDeleteChangesFor:classNameToDelete |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2180 |
from:1 |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2181 |
to:(self numberOfChanges). |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2182 |
self setChangeList. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2183 |
self autoSelectOrEnd:changeNr |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2184 |
] |
51 | 2185 |
] |
286
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2186 |
|
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2187 |
"Created: 13.12.1995 / 16:07:14 / cg" |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2188 |
"Modified: 25.5.1996 / 12:26:31 / cg" |
286
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2189 |
! |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2190 |
|
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2191 |
doDeleteClassFromBeginning |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2192 |
"delete changes with same class as currently selected change from the beginning |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2193 |
up to the selected change. |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2194 |
Useful to get rid of obsolete changes before a fileout or checkin entry." |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2195 |
|
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2196 |
self withSelectedChangeDo:[:changeNr | |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2197 |
| classNameToDelete | |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2198 |
|
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2199 |
classNameToDelete := self classNameOfChange:changeNr. |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2200 |
classNameToDelete notNil ifTrue:[ |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2201 |
changeListView setSelection:nil. |
286
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2202 |
self silentDeleteChangesFor:classNameToDelete |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2203 |
from:1 |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2204 |
to:changeNr. |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2205 |
self setChangeList. |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2206 |
self autoSelectOrEnd:changeNr |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2207 |
] |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2208 |
] |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2209 |
|
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2210 |
"Created: 13.12.1995 / 15:41:58 / cg" |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2211 |
"Modified: 25.5.1996 / 12:26:34 / cg" |
51 | 2212 |
! |
2213 |
||
73 | 2214 |
doDeleteClassRest |
2215 |
"delete rest of changes with same class as currently selected change" |
|
2216 |
||
2217 |
self withSelectedChangeDo:[:changeNr | |
|
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2218 |
| classNameToDelete | |
73 | 2219 |
|
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2220 |
classNameToDelete := self classNameOfChange:changeNr. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2221 |
classNameToDelete notNil ifTrue:[ |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2222 |
changeListView setSelection:nil. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2223 |
self silentDeleteChangesFor:classNameToDelete |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2224 |
from:changeNr |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2225 |
to:(self numberOfChanges). |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2226 |
self setChangeList. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2227 |
self autoSelectOrEnd:changeNr |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2228 |
] |
73 | 2229 |
] |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2230 |
|
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2231 |
"Modified: 25.5.1996 / 12:26:39 / cg" |
73 | 2232 |
! |
2233 |
||
202 | 2234 |
doDeleteRest |
2235 |
"delete all changes from current to the end" |
|
51 | 2236 |
|
202 | 2237 |
|changeNr| |
51 | 2238 |
|
202 | 2239 |
changeNr := changeListView selection. |
2240 |
changeNr notNil ifTrue:[ |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
2241 |
self deleteChangesFrom:changeNr to:(self numberOfChanges). |
202 | 2242 |
self clearCodeView. |
2243 |
self autoSelectOrEnd:changeNr-1 |
|
51 | 2244 |
] |
132 | 2245 |
! |
2246 |
||
2247 |
doFileoutAndDeleteClassAll |
|
2248 |
"first fileOut the selected changes class then delete all changes |
|
2249 |
for it." |
|
2250 |
||
2251 |
self withSelectedChangeDo:[:changeNr | |
|
2252 |
| className class | |
|
2253 |
||
2254 |
className := self classNameOfChange:changeNr. |
|
2255 |
className notNil ifTrue:[ |
|
2256 |
class := Smalltalk classNamed:className. |
|
2257 |
class notNil ifTrue:[ |
|
2258 |
Class fileOutErrorSignal handle:[:ex | |
|
2259 |
self warn:('fileout failed: ' , ex errorString). |
|
2260 |
] do:[ |
|
2261 |
class fileOut. |
|
2262 |
self doDeleteClassAll |
|
2263 |
]. |
|
2264 |
]. |
|
2265 |
||
2266 |
]. |
|
2267 |
] |
|
2268 |
||
2269 |
"Modified: 6.9.1995 / 17:11:16 / claus" |
|
202 | 2270 |
! |
73 | 2271 |
|
202 | 2272 |
doMakePatch |
2273 |
"user wants a change to be made a patch |
|
2274 |
- copy it over to the patches file" |
|
89 | 2275 |
|
202 | 2276 |
|changeNr| |
89 | 2277 |
|
202 | 2278 |
changeNr := changeListView selection. |
2279 |
changeNr notNil ifTrue:[ |
|
2280 |
self makeChangeAPatch:changeNr. |
|
2281 |
self autoSelect:(changeNr + 1) |
|
2282 |
] |
|
73 | 2283 |
! |
2284 |
||
202 | 2285 |
doMakePermanent |
2286 |
"user wants a change to be made permanent |
|
2287 |
- rewrite the source file where this change has to go" |
|
2288 |
||
2289 |
|yesNoBox| |
|
73 | 2290 |
|
202 | 2291 |
yesNoBox := YesNoBox new. |
2292 |
yesNoBox title:(resources at:'Warning: this operation cannot be undone'). |
|
2293 |
yesNoBox okText:(resources at:'continue'). |
|
2294 |
yesNoBox noText:(resources at:'abort'). |
|
2295 |
yesNoBox okAction:[ |changeNr| |
|
2296 |
||
917 | 2297 |
changeNr := changeListView selection. |
2298 |
changeNr notNil ifTrue:[ |
|
2299 |
self makeChangePermanent:changeNr. |
|
2300 |
self autoSelect:(changeNr + 1) |
|
2301 |
] |
|
2302 |
]. |
|
2303 |
yesNoBox showAtPointer. |
|
2304 |
yesNoBox destroy |
|
2305 |
||
2306 |
"Modified: 7.1.1997 / 23:03:33 / cg" |
|
73 | 2307 |
! |
2308 |
||
202 | 2309 |
doSave |
2310 |
"user wants a change to be appended to a file" |
|
73 | 2311 |
|
202 | 2312 |
|changeNr fileName| |
73 | 2313 |
|
202 | 2314 |
changeNr := changeListView selection. |
2315 |
changeNr notNil ifTrue:[ |
|
2316 |
fileName := Dialog |
|
2317 |
requestFileName:'append change to:' |
|
2318 |
default:'' |
|
2319 |
ok:'append' |
|
2320 |
abort:'abort' |
|
2321 |
pattern:'*.chg'. |
|
2322 |
||
2323 |
fileName notNil ifTrue:[ |
|
2324 |
self withCursor:(Cursor write) do:[ |
|
2325 |
self appendChange:changeNr toFile:fileName. |
|
2326 |
]. |
|
2327 |
self autoSelect:(changeNr + 1) |
|
73 | 2328 |
]. |
202 | 2329 |
] |
73 | 2330 |
! |
2331 |
||
202 | 2332 |
doSaveClass |
2333 |
"user wants changes for some class from current to end to be appended to a file" |
|
89 | 2334 |
|
202 | 2335 |
self doSaveClassFrom:1 |
89 | 2336 |
! |
2337 |
||
202 | 2338 |
doSaveClassAll |
2339 |
"user wants changes for some class from current to end to be appended to a file" |
|
73 | 2340 |
|
202 | 2341 |
self doSaveClassFrom:1 |
2342 |
! |
|
2343 |
||
2344 |
doSaveClassFrom:startNr |
|
2345 |
"user wants changes from current to end to be appended to a file" |
|
2346 |
||
2347 |
|changeNr classNameToSave| |
|
73 | 2348 |
|
202 | 2349 |
changeNr := changeListView selection. |
2350 |
changeNr notNil ifTrue:[ |
|
2351 |
classNameToSave := self classNameOfChange:changeNr. |
|
2352 |
classNameToSave notNil ifTrue:[ |
|
2353 |
self saveClass:classNameToSave from:startNr |
|
2354 |
] |
|
2355 |
] |
|
2356 |
! |
|
73 | 2357 |
|
202 | 2358 |
doSaveClassRest |
2359 |
"user wants changes for some class from current to end to be appended to a file" |
|
73 | 2360 |
|
202 | 2361 |
|changeNr| |
132 | 2362 |
|
202 | 2363 |
changeNr := changeListView selection. |
2364 |
changeNr notNil ifTrue:[ |
|
2365 |
self doSaveClassFrom:changeNr |
|
2366 |
] |
|
81 | 2367 |
! |
2368 |
||
202 | 2369 |
doSaveRest |
2370 |
"user wants changes from current to end to be appended to a file" |
|
73 | 2371 |
|
202 | 2372 |
|changeNr fileName| |
51 | 2373 |
|
202 | 2374 |
changeNr := changeListView selection. |
2375 |
changeNr notNil ifTrue:[ |
|
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2376 |
fileName := Dialog |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2377 |
requestFileName:'append changes to:' |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2378 |
default:'' |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2379 |
ok:'append' |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2380 |
abort:'abort' |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2381 |
pattern:'*.chg'. |
51 | 2382 |
|
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2383 |
fileName notNil ifTrue:[ |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2384 |
self withCursor:(Cursor write) do:[ |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2385 |
changeNr to:(self numberOfChanges) do:[:changeNr | |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2386 |
changeListView setSelection:changeNr. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2387 |
(self appendChange:changeNr toFile:fileName) ifFalse:[ |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2388 |
^ self |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2389 |
] |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2390 |
] |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2391 |
] |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2392 |
]. |
202 | 2393 |
] |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2394 |
|
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2395 |
"Modified: 25.5.1996 / 12:26:41 / cg" |
51 | 2396 |
! |
2397 |
||
202 | 2398 |
doUpdate |
2399 |
"reread the changes-file" |
|
51 | 2400 |
|
202 | 2401 |
self readChangesFileInBackground:true. |
2402 |
realized ifTrue:[ |
|
2403 |
self setChangeList. |
|
2404 |
] |
|
2405 |
||
51 | 2406 |
! |
2407 |
||
202 | 2408 |
doWriteBack |
2409 |
"write back the list onto the changes file" |
|
51 | 2410 |
|
2411 |
anyChanges ifTrue:[ |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2412 |
(self writeBackChanges) ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2413 |
realized ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2414 |
self readChangesFileInBackground:false. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2415 |
realized ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2416 |
self setChangeList |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2417 |
] |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2418 |
] |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2419 |
] |
202 | 2420 |
] |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2421 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2422 |
"Modified: 5.9.1996 / 17:19:46 / cg" |
202 | 2423 |
! |
126 | 2424 |
|
1127 | 2425 |
findClass |
2426 |
|nm current savedCursor search| |
|
2427 |
||
2428 |
changeNrShown notNil ifTrue:[ |
|
2429 |
current := self classNameOfChange:changeNrShown. |
|
2430 |
]. |
|
1275 | 2431 |
nm := Dialog |
2432 |
request:'class to search for:' |
|
2433 |
initialAnswer:current |
|
2434 |
onCancel:nil. |
|
2435 |
nm isNil ifTrue:[ |
|
2436 |
^ self |
|
2437 |
]. |
|
1127 | 2438 |
|
2439 |
changeNrShown isNil ifTrue:[ |
|
2440 |
search := 1. |
|
2441 |
] ifFalse:[ |
|
2442 |
search := changeNrShown + 1 |
|
2443 |
]. |
|
2444 |
||
2445 |
self withCursor:Cursor questionMark do:[ |
|
2446 |
|lastNr cls nr thisClass | |
|
2447 |
||
2448 |
lastNr := self numberOfChanges. |
|
2449 |
nr := search. |
|
2450 |
[nr <= lastNr] whileTrue:[ |
|
2451 |
thisClass := self classNameOfChange:nr. |
|
2452 |
thisClass = nm ifTrue:[ |
|
2453 |
changeListView setSelection:nr. |
|
2454 |
self changeSelection:nr. |
|
2455 |
^ self |
|
2456 |
]. |
|
2457 |
nr := nr + 1. |
|
2458 |
]. |
|
2459 |
]. |
|
2460 |
self beep. |
|
2461 |
||
2462 |
savedCursor := cursor. |
|
2463 |
self cursor:(Cursor cross). |
|
1150
fc05bbed9e43
Use 'Delay' instead of Process waitForMilliseconds:
Stefan Vogel <sv@exept.de>
parents:
1127
diff
changeset
|
2464 |
Delay waitForMilliseconds:300. |
1127 | 2465 |
self cursor:savedCursor |
2466 |
||
2467 |
"Created: 8.4.1997 / 11:00:16 / cg" |
|
1150
fc05bbed9e43
Use 'Delay' instead of Process waitForMilliseconds:
Stefan Vogel <sv@exept.de>
parents:
1127
diff
changeset
|
2468 |
"Modified: 18.4.1997 / 12:47:52 / stefan" |
1275 | 2469 |
"Modified: 5.8.1997 / 23:13:39 / cg" |
1127 | 2470 |
! |
2471 |
||
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2472 |
findNextForClass |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2473 |
|savedCursor| |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2474 |
|
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2475 |
changeNrShown isNil ifTrue:[^ self]. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2476 |
|
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2477 |
self withCursor:Cursor questionMark do:[ |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2478 |
|lastNr cls nr thisClass | |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2479 |
|
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2480 |
cls := self classNameOfChange:changeNrShown. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2481 |
cls isNil ifTrue:[^ self]. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2482 |
|
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2483 |
lastNr := self numberOfChanges. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2484 |
nr := changeNrShown + 1. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2485 |
[nr <= lastNr] whileTrue:[ |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2486 |
thisClass := self classNameOfChange:nr. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2487 |
thisClass = cls ifTrue:[ |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2488 |
changeListView setSelection:nr . |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2489 |
self changeSelection:nr. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2490 |
^ self |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2491 |
]. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2492 |
nr := nr + 1. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2493 |
]. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2494 |
]. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2495 |
self beep. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2496 |
|
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2497 |
savedCursor := cursor. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2498 |
self cursor:(Cursor cross). |
1150
fc05bbed9e43
Use 'Delay' instead of Process waitForMilliseconds:
Stefan Vogel <sv@exept.de>
parents:
1127
diff
changeset
|
2499 |
Delay waitForMilliseconds:300. |
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2500 |
self cursor:savedCursor |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2501 |
|
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2502 |
"Created: 21.1.1997 / 22:28:07 / cg" |
1150
fc05bbed9e43
Use 'Delay' instead of Process waitForMilliseconds:
Stefan Vogel <sv@exept.de>
parents:
1127
diff
changeset
|
2503 |
"Modified: 18.4.1997 / 12:48:18 / stefan" |
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2504 |
! |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2505 |
|
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2506 |
findPreviousForClass |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2507 |
|savedCursor| |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2508 |
|
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2509 |
changeNrShown isNil ifTrue:[^ self]. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2510 |
|
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2511 |
self withCursor:Cursor questionMark do:[ |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2512 |
|cls nr thisClass | |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2513 |
|
1109 | 2514 |
Object userInterruptSignal handle:[:ex | |
2515 |
self beep. |
|
2516 |
^ self |
|
2517 |
] do:[ |
|
2518 |
cls := self classNameOfChange:changeNrShown. |
|
2519 |
cls isNil ifTrue:[^ self]. |
|
2520 |
||
2521 |
nr := changeNrShown - 1. |
|
2522 |
[nr >= 1] whileTrue:[ |
|
2523 |
thisClass := self classNameOfChange:nr. |
|
2524 |
thisClass = cls ifTrue:[ |
|
2525 |
changeListView setSelection:nr . |
|
2526 |
self changeSelection:nr. |
|
2527 |
^ self |
|
2528 |
]. |
|
2529 |
nr := nr - 1. |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2530 |
]. |
1109 | 2531 |
] |
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2532 |
]. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2533 |
self beep. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2534 |
|
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2535 |
savedCursor := cursor. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2536 |
self cursor:(Cursor cross). |
1150
fc05bbed9e43
Use 'Delay' instead of Process waitForMilliseconds:
Stefan Vogel <sv@exept.de>
parents:
1127
diff
changeset
|
2537 |
Delay waitForMilliseconds:300. |
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2538 |
self cursor:savedCursor |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2539 |
|
1109 | 2540 |
"Modified: 2.4.1997 / 18:17:02 / cg" |
1150
fc05bbed9e43
Use 'Delay' instead of Process waitForMilliseconds:
Stefan Vogel <sv@exept.de>
parents:
1127
diff
changeset
|
2541 |
"Modified: 18.4.1997 / 12:48:41 / stefan" |
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2542 |
! |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
2543 |
|
202 | 2544 |
noChangesAllowed |
2545 |
"show a warning that changes cannot be changed" |
|
93 | 2546 |
|
202 | 2547 |
self warn:'changes are not allowed to be changed' |
0 | 2548 |
! |
2549 |
||
202 | 2550 |
saveClass:aClassName from:startNr |
2551 |
"user wants changes from current to end to be appended to a file" |
|
51 | 2552 |
|
202 | 2553 |
|changeNr fileName| |
51 | 2554 |
|
202 | 2555 |
changeNr := changeListView selection. |
2556 |
changeNr notNil ifTrue:[ |
|
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2557 |
fileName := Dialog |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2558 |
requestFileName:'append changes for class to:' |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2559 |
default:'' |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2560 |
ok:'append' |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2561 |
abort:'abort' |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2562 |
pattern:'*.chg'. |
0 | 2563 |
|
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2564 |
fileName notNil ifTrue:[ |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2565 |
self withCursor:(Cursor write) do:[ |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2566 |
startNr to:(self numberOfChanges) do:[:changeNr | |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2567 |
|thisClassName| |
0 | 2568 |
|
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2569 |
thisClassName := self classNameOfChange:changeNr. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2570 |
thisClassName = aClassName ifTrue:[ |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2571 |
changeListView setSelection:changeNr. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2572 |
(self appendChange:changeNr toFile:fileName) ifFalse:[ |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2573 |
^ self |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2574 |
] |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2575 |
] |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2576 |
] |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2577 |
] |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2578 |
]. |
202 | 2579 |
] |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2580 |
|
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2581 |
"Modified: 25.5.1996 / 12:26:44 / cg" |
202 | 2582 |
! ! |
0 | 2583 |
|
761 | 2584 |
!ChangesBrowser class methodsFor:'documentation'! |
202 | 2585 |
|
2586 |
version |
|
1321 | 2587 |
^ '$Header: /cvs/stx/stx/libtool/ChangesBrowser.st,v 1.118 1997-09-17 17:57:43 cg Exp $' |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
2588 |
! ! |