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