author | Claus Gittinger <cg@exept.de> |
Tue, 01 Oct 1996 16:46:51 +0200 | |
changeset 744 | cb962cb21e8c |
parent 742 | 2ef5e22d8983 |
child 761 | 5c2b46a38efa |
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 |
]. |
744
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
903 |
|
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
904 |
changeListView redrawFromLine:start. |
255 | 905 |
|
744
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
906 |
"/ self setChangeList |
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
907 |
|
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
908 |
"Modified: 1.10.1996 / 15:46:24 / cg" |
255 | 909 |
! |
910 |
||
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
911 |
fullClassNameOfChange:changeNr |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
912 |
"return the full classname of a change |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
913 |
(for classChanges (i.e. xxx class), a string ending in ' class' is returned. |
202 | 914 |
- since parsing ascii methods is slow, keep result cached in |
915 |
changeClassNames for the next query" |
|
916 |
||
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
917 |
|chunk aParseTree recTree sel name arg1Tree isMeta prevMethodDefNr| |
202 | 918 |
|
919 |
changeNr isNil ifTrue:[^ nil]. |
|
920 |
||
921 |
" |
|
922 |
first look, if not already known |
|
923 |
" |
|
924 |
name := changeClassNames at:changeNr. |
|
925 |
name notNil ifTrue:[^ name]. |
|
926 |
||
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
927 |
prevMethodDefNr := changeNr. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
928 |
[changeIsFollowupMethodChange at:prevMethodDefNr] whileTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
929 |
prevMethodDefNr := prevMethodDefNr - 1. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
930 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
931 |
|
202 | 932 |
" |
933 |
get the chunk |
|
934 |
" |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
935 |
chunk := changeChunks at:prevMethodDefNr. |
202 | 936 |
chunk isNil ifTrue:[^ nil]. "mhmh - empty" |
937 |
||
226 | 938 |
"/ fix it |
939 |
(chunk endsWith:'primitiveDefinitions:') 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:'primitiveFunctions:') 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 |
(chunk endsWith:'primitiveVariables:') ifTrue:[ |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
946 |
chunk := chunk , '''''' |
226 | 947 |
]. |
948 |
||
202 | 949 |
" |
950 |
use parser to construct a parseTree |
|
951 |
" |
|
952 |
aParseTree := Parser parseExpression:chunk. |
|
953 |
(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
|
954 |
^ nil "seems strange ... (could be a comment)" |
202 | 955 |
]. |
956 |
aParseTree isMessage ifFalse:[ |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
957 |
^ nil "very strange ... (whats that ?)" |
202 | 958 |
]. |
959 |
||
960 |
" |
|
961 |
ask parser for selector |
|
962 |
" |
|
963 |
sel := aParseTree selector. |
|
964 |
recTree := aParseTree receiver. |
|
965 |
||
966 |
" |
|
967 |
is it a method-change, methodRemove or comment-change ? |
|
968 |
" |
|
969 |
(#(#'methodsFor:' |
|
970 |
#'privateMethodsFor:' |
|
971 |
#'protectedMethodsFor:' |
|
972 |
#'publicMethodsFor:' |
|
973 |
#'removeSelector:' |
|
974 |
#'comment:' |
|
975 |
#'primitiveDefinitions:' |
|
976 |
#'primitiveFunctions:' |
|
977 |
#'primitiveVariables:' |
|
978 |
#'renameCategory:to:' |
|
979 |
#'instanceVariableNames:' |
|
980 |
) includes:sel) ifTrue:[ |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
981 |
" |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
982 |
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
|
983 |
" |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
984 |
(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
|
985 |
isMeta := false. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
986 |
recTree isUnaryMessage ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
987 |
(recTree selector ~~ #class) ifTrue:[^ nil]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
988 |
"id class methodsFor:..." |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
989 |
recTree := recTree receiver. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
990 |
isMeta := true. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
991 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
992 |
recTree isPrimary ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
993 |
name := recTree name. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
994 |
isMeta ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
995 |
name := name , ' class'. |
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 |
changeClassNames at:changeNr put:name. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
998 |
^ name |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
999 |
] |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1000 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1001 |
"more strange things" |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1002 |
^ nil |
202 | 1003 |
]. |
1004 |
||
1005 |
" |
|
1006 |
is it a change in a class-description ? |
|
1007 |
" |
|
1008 |
(('subclass:*' match:sel) |
|
1009 |
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
|
1010 |
arg1Tree := aParseTree arg1. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1011 |
(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
|
1012 |
name := arg1Tree value asString. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1013 |
changeClassNames at:changeNr put:name. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1014 |
^ name |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1015 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1016 |
"very strange" |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1017 |
^ nil |
202 | 1018 |
]. |
1019 |
||
1020 |
" |
|
1021 |
is it a class remove ? |
|
1022 |
" |
|
1023 |
(sel == #removeClass:) ifTrue:[ |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1024 |
(recTree notNil |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1025 |
and:[recTree ~~ #Error |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1026 |
and:[recTree isPrimary |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1027 |
and:[recTree name = 'Smalltalk']]]) ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1028 |
arg1Tree := aParseTree arg1. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1029 |
(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
|
1030 |
name := arg1Tree name. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1031 |
changeClassNames at:changeNr put:name. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1032 |
^ name |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1033 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1034 |
] |
202 | 1035 |
]. |
1036 |
||
1037 |
" |
|
1038 |
is it a method category change ? |
|
1039 |
" |
|
1040 |
(sel == #category:) ifTrue:[ |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1041 |
(recTree notNil |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1042 |
and:[recTree ~~ #Error |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1043 |
and:[recTree isMessage |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1044 |
and:[recTree selector == #compiledMethodAt:]]]) ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1045 |
isMeta := false. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1046 |
recTree := recTree receiver. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1047 |
recTree isUnaryMessage ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1048 |
(recTree selector ~~ #class) ifTrue:[^ nil]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1049 |
"id class " |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1050 |
recTree := recTree receiver |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1051 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1052 |
recTree isPrimary ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1053 |
isMeta ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1054 |
name := name , ' class'. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1055 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1056 |
name := recTree name. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1057 |
changeClassNames at:changeNr put:name. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1058 |
^ name |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1059 |
] |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1060 |
] |
202 | 1061 |
]. |
1062 |
^ nil |
|
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1063 |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1064 |
"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
|
1065 |
! |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1066 |
|
202 | 1067 |
makeChangeAPatch:changeNr |
1068 |
"append change to patchfile" |
|
1069 |
||
1070 |
self appendChange:changeNr toFile:'patches' |
|
1071 |
! |
|
1072 |
||
1073 |
makeChangePermanent:changeNr |
|
1074 |
"rewrite the source file where change changeNr lies" |
|
1075 |
||
1076 |
self notify:'this is not yet implemented' |
|
1077 |
! |
|
1078 |
||
1079 |
newLabel:how |
|
1080 |
|l| |
|
1081 |
||
1082 |
(changeFileName ~= 'changes') ifTrue:[ |
|
1083 |
l := 'Changes Browser: ', changeFileName |
|
1084 |
] ifFalse:[ |
|
1085 |
l := 'Changes Browser' |
|
1086 |
]. |
|
1087 |
l := l , ' ' , how. |
|
1088 |
self label:l |
|
1089 |
||
1090 |
"Created: 8.9.1995 / 19:32:04 / claus" |
|
1091 |
"Modified: 8.9.1995 / 19:39:29 / claus" |
|
1092 |
! |
|
1093 |
||
255 | 1094 |
numberOfChanges |
1095 |
^ changePositions size |
|
1096 |
||
1097 |
"Created: 3.12.1995 / 18:15:39 / cg" |
|
1098 |
! |
|
1099 |
||
202 | 1100 |
queryCloseText |
1101 |
"made this a method for easy redefinition in subclasses" |
|
1102 |
||
1103 |
^ 'Quit without updating changeFile ?' |
|
1104 |
! |
|
1105 |
||
1106 |
readChangesFile |
|
1107 |
"read the changes file, create a list of header-lines (changeChunks) |
|
1108 |
and a list of chunk-positions (changePositions)" |
|
1109 |
||
1110 |
^ self readChangesFileInBackground:false |
|
1111 |
! |
|
1112 |
||
37 | 1113 |
readChangesFileInBackground:inBackground |
1114 |
"read the changes file, create a list of header-lines (changeChunks) |
|
51 | 1115 |
and a list of chunk-positions (changePositions). |
1116 |
Starting with 2.10.3, the entries are multi-col entries; |
|
1117 |
the cols are: |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1118 |
1 delta (only if comparing) |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1119 |
'+' -> new method (w.r.t. current state) |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1120 |
'-' -> removed method (w.r.t. current state) |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1121 |
'?' -> class does not exist currently |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1122 |
'=' -> change is same as current methods source |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1123 |
2 class/selector |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1124 |
3 type of change |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1125 |
doit |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1126 |
method |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1127 |
category change |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1128 |
4 timestamp |
89 | 1129 |
|
1130 |
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
|
1131 |
default and can be enabled via a toggle." |
37 | 1132 |
|
133 | 1133 |
|aStream maxLen f| |
50 | 1134 |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1135 |
editingClassSource := false. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1136 |
|
50 | 1137 |
maxLen := 60. |
0 | 1138 |
|
133 | 1139 |
f := changeFileName asFilename. |
1140 |
aStream := f readStream. |
|
0 | 1141 |
aStream isNil ifTrue:[^ nil]. |
1142 |
||
326 | 1143 |
self newLabel:'updating ...'. |
1144 |
||
133 | 1145 |
changeFileSize := f info at:#size. |
1146 |
changeFileTimestamp := f info at:#modified. |
|
1147 |
||
294 | 1148 |
self withReadCursorDo:[ |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1149 |
|myProcess myPriority| |
49 | 1150 |
|
276
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 |
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
|
1153 |
NFS-mounted directory; therefore lower my priority ... |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1154 |
" |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1155 |
inBackground ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1156 |
myProcess := Processor activeProcess. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1157 |
myPriority := myProcess priority. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1158 |
myProcess priority:(Processor userBackgroundPriority). |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1159 |
]. |
51 | 1160 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1161 |
[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1162 |
|excla timeStampInfo| |
50 | 1163 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1164 |
changeChunks := OrderedCollection new. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1165 |
changeHeaderLines := OrderedCollection new. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1166 |
changePositions := OrderedCollection new. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1167 |
changeTimeStamps := OrderedCollection new. |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1168 |
changeIsFollowupMethodChange := OrderedCollection new. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1169 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1170 |
excla := aStream class chunkSeparator. |
0 | 1171 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1172 |
[aStream atEnd] whileFalse:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1173 |
|entry changeDelta changeString changeType |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1174 |
line s l changeClass sawExcla category |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1175 |
chunkText chunkPos sel| |
51 | 1176 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1177 |
" |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1178 |
get a chunk (separated by excla) |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1179 |
" |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1180 |
aStream skipSeparators. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1181 |
chunkPos := aStream position. |
73 | 1182 |
|
1183 |
||
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1184 |
sawExcla := aStream peekFor:excla. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1185 |
chunkText := aStream nextChunk. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1186 |
chunkText notNil ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1187 |
|index headerLine cls| |
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1188 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1189 |
(chunkText startsWith:'''---- timestamp ') ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1190 |
timeStampInfo := (chunkText copyFrom:16 to:(chunkText size - 6)) withoutSpaces. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1191 |
] ifFalse:[ |
51 | 1192 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1193 |
" |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1194 |
only first line is saved in changeChunks ... |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1195 |
" |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1196 |
index := chunkText indexOf:(Character cr). |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1197 |
(index ~~ 0) ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1198 |
chunkText := chunkText copyTo:(index - 1). |
45 | 1199 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1200 |
"take care for comment changes - must still be a |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1201 |
valid expression for classNameOfChange: to work" |
50 | 1202 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1203 |
(chunkText endsWith:'comment:''') ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1204 |
chunkText := chunkText , '...''' |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1205 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1206 |
(chunkText endsWith:'primitiveDefinitions:''') ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1207 |
sel := 'primitiveDefinitions:'. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1208 |
chunkText := chunkText copyWithoutLast:1 |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1209 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1210 |
(chunkText endsWith:'primitiveVariables:''') ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1211 |
sel := 'primitiveVariables:'. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1212 |
chunkText := chunkText copyWithoutLast:1 |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1213 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1214 |
(chunkText endsWith:'primitiveFunctions:''') ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1215 |
sel := 'primitiveFunctions:'. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1216 |
chunkText := chunkText copyWithoutLast:1 |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1217 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1218 |
]. |
51 | 1219 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1220 |
changeChunks add:chunkText. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1221 |
changePositions add:chunkPos. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1222 |
changeTimeStamps add:timeStampInfo. |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1223 |
changeIsFollowupMethodChange add:false. |
37 | 1224 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1225 |
headerLine := nil. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1226 |
changeDelta := ' '. |
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1227 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1228 |
sawExcla ifFalse:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1229 |
(chunkText startsWith:'''---- snap') ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1230 |
changeType := ''. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1231 |
headerLine := chunkText. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1232 |
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
|
1233 |
timeStampInfo := nil. |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1234 |
] ifFalse:[ |
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1235 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1236 |
|p cls| |
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1237 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1238 |
headerLine := chunkText , ' (doIt)'. |
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1239 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1240 |
" |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1241 |
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
|
1242 |
" |
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 |
((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
|
1244 |
or:[(chunkText startsWith:'''---- check')]) ifTrue:[ |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1245 |
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
|
1246 |
timeStampInfo := nil. |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1247 |
] ifFalse:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1248 |
changeType := '(doIt)'. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1249 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1250 |
changeString := (chunkText contractTo:maxLen). |
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1251 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1252 |
p := Parser parseExpression:chunkText. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1253 |
(p notNil |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1254 |
and:[p ~~ #Error |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1255 |
and:[p isMessage]]) ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1256 |
sel := p selector. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1257 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1258 |
(sel == #removeSelector:) ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1259 |
p receiver isUnaryMessage ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1260 |
cls := p receiver receiver name. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1261 |
changeClass := (Smalltalk classNamed:cls) class. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1262 |
cls := cls , ' class'. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1263 |
] ifFalse:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1264 |
cls := p receiver name. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1265 |
changeClass := (Smalltalk classNamed:cls) |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1266 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1267 |
sel := (p args at:1) evaluate. |
50 | 1268 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1269 |
compareChanges ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1270 |
(changeClass isNil or:[changeClass isLoaded not]) 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 |
] ifFalse:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1273 |
(changeClass implements:sel asSymbol) ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1274 |
changeDelta := '-'. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1275 |
] |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1276 |
] |
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 |
changeType := '(remove)'. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1279 |
changeString := self contractClass:cls selector:sel to:maxLen. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1280 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1281 |
(p ~~ #Error |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1282 |
and:[p isMessage |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1283 |
and:[p receiver isMessage |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1284 |
and:[p receiver selector == #compiledMethodAt:]]]) ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1285 |
p receiver receiver isUnaryMessage ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1286 |
cls := p receiver receiver receiver name. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1287 |
changeClass := (Smalltalk classNamed:cls) class. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1288 |
cls := cls , ' class'. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1289 |
] ifFalse:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1290 |
cls := p receiver receiver name. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1291 |
changeClass := (Smalltalk classNamed:cls) |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1292 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1293 |
(sel == #category:) ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1294 |
sel := (p receiver args at:1) evaluate. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1295 |
changeType := '(category change)'. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1296 |
changeString := self contractClass:cls selector:sel to:maxLen. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1297 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1298 |
(sel == #privacy:) ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1299 |
sel := (p receiver args at:1) evaluate. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1300 |
changeType := '(privacy change)'. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1301 |
changeString := self contractClass:cls selector:sel to:maxLen. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1302 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1303 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1304 |
(#(#'subclass:' |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1305 |
#'variableSubclass:' |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1306 |
#'variableByteSubclass:' |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1307 |
#'variableWordSubclass:' |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1308 |
#'variableLongSubclass:' |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1309 |
#'variableFloatSubclass:' |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1310 |
#'variableDoubleSubclass:' |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1311 |
#'primitiveDefinitions:' |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1312 |
#'primitiveFunctions:' |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1313 |
#'primitiveVariables:' |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1314 |
) includes:sel) ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1315 |
changeType := '(class definition)'. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1316 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1317 |
] |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1318 |
] ifTrue:[ "sawExcla" |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1319 |
|done first p className cls text methodPos| |
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1320 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1321 |
" |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1322 |
method definitions actually consist of |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1323 |
two (or more) chunks; skip next chunk(s) |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1324 |
up to an empty one. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1325 |
The system only writes one chunk, |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1326 |
and we cannot handle more in this ChangesBrowser .... |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1327 |
" |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1328 |
className := nil. |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1329 |
p := Parser parseExpression:chunkText. |
89 | 1330 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1331 |
(p notNil and:[p ~~ #Error]) ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1332 |
sel := p selector. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1333 |
(sel == #methodsFor:) ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1334 |
p receiver isUnaryMessage ifTrue:[ |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1335 |
className := p receiver receiver name. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1336 |
changeClass := (Smalltalk classNamed:className) class. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1337 |
className := className , ' class'. |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1338 |
] ifFalse:[ |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1339 |
className := p receiver name. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1340 |
changeClass := Smalltalk classNamed:className |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1341 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1342 |
category := (p args at:1) evaluate. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1343 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1344 |
]. |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1345 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1346 |
done := false. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1347 |
first := true. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1348 |
[done] whileFalse:[ |
704 | 1349 |
changeDelta := ' '. |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1350 |
methodPos := aStream position. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1351 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1352 |
text := aStream nextChunk. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1353 |
text isNil ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1354 |
done := true |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1355 |
] ifFalse:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1356 |
done := text isEmpty |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1357 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1358 |
done ifFalse:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1359 |
first ifFalse:[ |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1360 |
changeChunks add:chunkText. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1361 |
changePositions add:methodPos. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1362 |
changeTimeStamps add:timeStampInfo. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1363 |
changeIsFollowupMethodChange add:true. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1364 |
editingClassSource := true. |
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 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1367 |
first := false. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1368 |
" |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1369 |
try to find the selector |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1370 |
" |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1371 |
sel := nil. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1372 |
className notNil ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1373 |
p := Parser |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1374 |
parseMethodSpecification:text |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1375 |
in:nil |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1376 |
ignoreErrors:true |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1377 |
ignoreWarnings:true. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1378 |
(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
|
1379 |
sel := p selector. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1380 |
] |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1381 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1382 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1383 |
sel isNil ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1384 |
changeString := (chunkText contractTo:maxLen). |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1385 |
changeType := '(change)'. |
704 | 1386 |
headerLine := chunkText , ' (change)'. |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1387 |
] ifFalse:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1388 |
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
|
1389 |
changeType := '(method in: ''' , category , ''')'. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1390 |
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
|
1391 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1392 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1393 |
compareChanges ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1394 |
changeClass isNil ifFalse:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1395 |
changeClass isMeta ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1396 |
cls := changeClass soleInstance |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1397 |
] ifFalse:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1398 |
cls := changeClass |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1399 |
]. |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1400 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1401 |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1402 |
(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
|
1403 |
changeDelta := '?' |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1404 |
] ifFalse:[ |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1405 |
(changeClass implements:sel asSymbol) ifFalse:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1406 |
changeDelta := '+'. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1407 |
] ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1408 |
|m currentText t1 t2| |
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1409 |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1410 |
m := changeClass compiledMethodAt:sel asSymbol. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1411 |
currentText := m source. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1412 |
currentText notNil ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1413 |
text asString = currentText asString ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1414 |
changeDelta := '=' |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1415 |
] ifFalse:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1416 |
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
|
1417 |
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
|
1418 |
t1 = t2 ifTrue:[ |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1419 |
changeDelta := '=' |
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 |
] |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1422 |
] |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1423 |
] |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1424 |
] |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1425 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1426 |
entry := MultiColListEntry new. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1427 |
entry tabulatorSpecification:tabSpec. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1428 |
entry colAt:1 put:changeDelta. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1429 |
entry colAt:2 put:changeString. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1430 |
entry colAt:3 put:changeType. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1431 |
timeStampInfo notNil ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1432 |
entry colAt:4 put:timeStampInfo. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1433 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1434 |
changeHeaderLines add:entry |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1435 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1436 |
changeString := nil. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1437 |
headerLine := nil. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1438 |
|
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1439 |
] |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1440 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1441 |
changeString notNil ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1442 |
entry := MultiColListEntry new. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1443 |
entry tabulatorSpecification:tabSpec. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1444 |
entry colAt:1 put:changeDelta. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1445 |
entry colAt:2 put:changeString. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1446 |
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
|
1447 |
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
|
1448 |
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
|
1449 |
]. |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1450 |
changeHeaderLines add:entry |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1451 |
] ifFalse:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1452 |
headerLine notNil ifTrue:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1453 |
changeHeaderLines add:headerLine |
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 |
] |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1457 |
] |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1458 |
]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1459 |
changeClassNames := OrderedCollection new grow:(changeChunks size). |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1460 |
aStream close. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1461 |
anyChanges := false |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1462 |
] valueNowOrOnUnwindDo:[ |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1463 |
inBackground ifTrue:[myProcess priority:myPriority]. |
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
1464 |
]. |
133 | 1465 |
]. |
1466 |
||
1467 |
self checkIfFileHasChanged |
|
123 | 1468 |
|
1469 |
"Modified: 27.8.1995 / 23:06:55 / claus" |
|
704 | 1470 |
"Modified: 5.9.1996 / 18:08:42 / cg" |
45 | 1471 |
! |
37 | 1472 |
|
209
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1473 |
selectorOfMethodChange:changeNr |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1474 |
"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
|
1475 |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1476 |
|source parser sel| |
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 |
source := self sourceOfMethodChange:changeNr. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1479 |
source isNil ifTrue:[^ nil]. |
209
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1480 |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1481 |
parser := Parser |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1482 |
parseMethod:source |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1483 |
in:nil |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1484 |
ignoreErrors:true |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1485 |
ignoreWarnings:true. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1486 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1487 |
(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
|
1488 |
sel := parser selector. |
209
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1489 |
]. |
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1490 |
^ sel |
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 |
"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
|
1493 |
"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
|
1494 |
! |
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1495 |
|
202 | 1496 |
setChangeList |
1497 |
"extract type-information from changes and stuff into top selection |
|
1498 |
view" |
|
51 | 1499 |
|
202 | 1500 |
changeListView setList:changeHeaderLines expandTabs:false. |
1501 |
"/ changeListView deselect. |
|
51 | 1502 |
! |
1503 |
||
73 | 1504 |
silentDeleteChange:changeNr |
1505 |
"delete a change do not update changeListView" |
|
57 | 1506 |
|
73 | 1507 |
anyChanges := true. |
1508 |
changeChunks removeIndex:changeNr. |
|
1509 |
changePositions removeIndex:changeNr. |
|
1510 |
changeClassNames removeIndex:changeNr. |
|
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1511 |
changeHeaderLines removeIndex:changeNr. |
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1512 |
changeTimeStamps removeIndex:changeNr |
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1513 |
|
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1514 |
"Modified: 18.11.1995 / 17:08:44 / cg" |
45 | 1515 |
! |
1516 |
||
202 | 1517 |
silentDeleteChangesFor:aClassName from:start to:stop |
1518 |
"delete changes for a given class in a range" |
|
45 | 1519 |
|
202 | 1520 |
|thisClassName index| |
45 | 1521 |
|
202 | 1522 |
index := stop. |
1523 |
[index >= start] whileTrue:[ |
|
1524 |
thisClassName := self classNameOfChange:index. |
|
1525 |
thisClassName = aClassName ifTrue:[ |
|
1526 |
self silentDeleteChange:index |
|
51 | 1527 |
]. |
202 | 1528 |
index := index - 1 |
1529 |
] |
|
51 | 1530 |
|
45 | 1531 |
! |
1532 |
||
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1533 |
sourceOfMethodChange:changeNr |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1534 |
"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
|
1535 |
|
742
2ef5e22d8983
code cleanup (unused vars eliminated)
Claus Gittinger <cg@exept.de>
parents:
724
diff
changeset
|
1536 |
|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
|
1537 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1538 |
aStream := self streamForChange:changeNr. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1539 |
aStream isNil ifTrue:[^ nil]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1540 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1541 |
(changeIsFollowupMethodChange at:changeNr) ifFalse:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1542 |
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
|
1543 |
chunk := aStream nextChunk. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1544 |
] ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1545 |
chunk := (changeChunks at:changeNr). |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1546 |
sawExcla := true. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1547 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1548 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1549 |
sawExcla ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1550 |
parseTree := Parser parseExpression:chunk. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1551 |
(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
|
1552 |
(parseTree selector == #methodsFor:) ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1553 |
sourceChunk := aStream nextChunk. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1554 |
] |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1555 |
]. |
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 |
aStream close. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1558 |
^ sourceChunk |
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 |
"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
|
1561 |
"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
|
1562 |
! |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1563 |
|
202 | 1564 |
streamForChange:changeNr |
1565 |
"answer a stream for change" |
|
1566 |
||
1567 |
|aStream| |
|
73 | 1568 |
|
202 | 1569 |
(changeNr between:1 and:changePositions size) ifFalse:[^ nil]. |
1570 |
aStream := FileStream readonlyFileNamed:changeFileName. |
|
1571 |
aStream isNil ifTrue:[^ nil]. |
|
1572 |
aStream position:(changePositions at:changeNr). |
|
1573 |
^ aStream |
|
1574 |
! |
|
1575 |
||
1576 |
unselect |
|
1577 |
"common unselect" |
|
1578 |
||
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1579 |
changeListView setSelection:nil. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1580 |
|
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1581 |
"Modified: 25.5.1996 / 13:02:49 / cg" |
73 | 1582 |
! |
1583 |
||
1584 |
withSelectedChangeDo:aBlock |
|
1585 |
"just a helper, check for a selected change and evaluate aBlock |
|
1586 |
with busy cursor" |
|
1587 |
||
1588 |
|changeNr| |
|
1589 |
||
1590 |
changeNr := changeListView selection. |
|
1591 |
changeNr notNil ifTrue:[ |
|
294 | 1592 |
self withExecuteCursorDo:[ |
1593 |
aBlock value:changeNr |
|
1594 |
] |
|
73 | 1595 |
] |
294 | 1596 |
|
1597 |
"Modified: 14.12.1995 / 20:58:45 / cg" |
|
73 | 1598 |
! |
1599 |
||
45 | 1600 |
writeBackChanges |
163
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1601 |
"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
|
1602 |
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
|
1603 |
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
|
1604 |
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
|
1605 |
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
|
1606 |
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
|
1607 |
or we have at least a backup of the previous change file." |
45 | 1608 |
|
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1609 |
|inStream outStream tempfile stamp| |
163
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1610 |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1611 |
editingClassSource ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1612 |
(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
|
1613 |
ifFalse:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1614 |
^ false |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1615 |
] |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1616 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1617 |
|
163
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1618 |
tempfile := Filename newTemporaryIn:nil. |
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1619 |
tempfile exists ifTrue:[tempfile remove]. |
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1620 |
|
3aa2b2e7db65
handle different change-file-name; use unique temporary filenames
Claus Gittinger <cg@exept.de>
parents:
133
diff
changeset
|
1621 |
outStream := tempfile writeStream. |
45 | 1622 |
outStream isNil ifTrue:[ |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1623 |
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
|
1624 |
^ false |
45 | 1625 |
]. |
1626 |
||
1627 |
inStream := FileStream readonlyFileNamed:changeFileName. |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1628 |
inStream isNil ifTrue:[^ false]. |
45 | 1629 |
|
1630 |
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
|
1631 |
|excla sawExcla done dir chunk |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1632 |
nChanges "{Class:SmallInteger}" | |
51 | 1633 |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1634 |
excla := inStream class chunkSeparator. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1635 |
nChanges := self numberOfChanges. |
51 | 1636 |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1637 |
1 to:nChanges do:[:index | |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1638 |
inStream position:(changePositions at:index). |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1639 |
sawExcla := inStream peekFor:excla. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1640 |
chunk := inStream nextChunk. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1641 |
(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
|
1642 |
outStream nextPutAll:'''---- timestamp ' , stamp , ' ----'''. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1643 |
outStream nextPut:excla; cr. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1644 |
]. |
45 | 1645 |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1646 |
sawExcla ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1647 |
outStream nextPut:excla. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1648 |
outStream nextChunkPut:chunk. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1649 |
outStream cr. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1650 |
" |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1651 |
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
|
1652 |
" |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1653 |
done := false. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1654 |
[done] whileFalse:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1655 |
chunk := inStream nextChunk. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1656 |
chunk isNil ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1657 |
done := true |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1658 |
] ifFalse:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1659 |
outStream nextChunkPut:chunk. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1660 |
outStream cr. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1661 |
done := chunk isEmpty |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1662 |
] |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1663 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1664 |
] ifFalse:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1665 |
outStream nextChunkPut:chunk. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1666 |
outStream cr |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1667 |
] |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1668 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1669 |
outStream close. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1670 |
inStream close. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1671 |
dir := FileDirectory currentDirectory. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1672 |
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
|
1673 |
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
|
1674 |
anyChanges := false |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1675 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1676 |
^ true |
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1677 |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1678 |
"Modified: 5.9.1996 / 17:20:26 / cg" |
202 | 1679 |
! ! |
0 | 1680 |
|
202 | 1681 |
!ChangesBrowser methodsFor:'termination'! |
51 | 1682 |
|
202 | 1683 |
destroy |
1684 |
"destroy the receiver; make certain, that boxes are destroyed too" |
|
73 | 1685 |
|
202 | 1686 |
Processor removeTimedBlock:checkBlock. |
1687 |
ObjectMemory removeDependent:self. |
|
1688 |
super destroy |
|
51 | 1689 |
! |
1690 |
||
202 | 1691 |
saveAndTerminate |
1692 |
"update the changes file and quit. |
|
1693 |
Dont depend on this being sent, not all window managers |
|
1694 |
send it; instead, they simply destroy the view." |
|
28 | 1695 |
|
202 | 1696 |
anyChanges ifTrue:[ |
1697 |
self writeBackChanges. |
|
0 | 1698 |
]. |
202 | 1699 |
self destroy |
0 | 1700 |
! |
1701 |
||
202 | 1702 |
terminate |
1703 |
"window manager wants us to go away" |
|
28 | 1704 |
|
202 | 1705 |
|action| |
0 | 1706 |
|
202 | 1707 |
anyChanges ifTrue:[ |
373 | 1708 |
action := OptionBox |
1709 |
request:(resources at:'changefile has not been updated from the modified changelist.\\Update before closing ?') withCRs |
|
1710 |
label:'ChangesBrowser' |
|
1711 |
form:(WarningBox iconBitmap) |
|
1712 |
buttonLabels:(resources array:#('cancel' 'don''t update' 'update')) |
|
1713 |
values:#(#abort #ignore #save) |
|
1714 |
default:#save. |
|
1715 |
action == #abort ifTrue:[^ self]. |
|
1716 |
action == #save ifTrue:[ |
|
1717 |
self writeBackChanges |
|
1718 |
]. |
|
202 | 1719 |
]. |
1720 |
self destroy |
|
373 | 1721 |
|
1722 |
"Modified: 20.2.1996 / 20:48:06 / cg" |
|
0 | 1723 |
! ! |
1724 |
||
73 | 1725 |
!ChangesBrowser methodsFor:'user interaction'! |
51 | 1726 |
|
221 | 1727 |
autoUpdate:aBoolean |
1728 |
autoUpdate := aBoolean |
|
1729 |
||
1730 |
"Created: 3.12.1995 / 14:14:24 / cg" |
|
1731 |
"Modified: 3.12.1995 / 14:20:45 / cg" |
|
1732 |
! |
|
1733 |
||
0 | 1734 |
changeSelection:lineNr |
1735 |
"show a change in the codeView" |
|
1736 |
||
1737 |
|aStream sawExcla chunk| |
|
1738 |
||
1739 |
aStream := self streamForChange:lineNr. |
|
1740 |
aStream isNil ifTrue:[^ self]. |
|
1741 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
|
1742 |
chunk := aStream nextChunk. |
|
1743 |
sawExcla ifTrue:[ |
|
45 | 1744 |
chunk := aStream nextChunk |
0 | 1745 |
]. |
1746 |
aStream close. |
|
1747 |
codeView contents:chunk. |
|
13 | 1748 |
codeView acceptAction:[:theCode | self doApply "noChangesAllowed"]. |
15 | 1749 |
changeNrShown := lineNr. |
0 | 1750 |
|
51 | 1751 |
! |
1752 |
||
202 | 1753 |
doApply |
1754 |
"user wants a change to be applied" |
|
45 | 1755 |
|
202 | 1756 |
self withSelectedChangeDo:[:changeNr | |
1757 |
skipSignal := nil. |
|
1758 |
self applyChange:changeNr. |
|
1759 |
self autoSelect:(changeNr + 1) |
|
1760 |
] |
|
45 | 1761 |
! |
1762 |
||
202 | 1763 |
doApplyAll |
1764 |
"user wants all changes to be applied" |
|
37 | 1765 |
|
294 | 1766 |
self withExecuteCursorDo:[ |
1767 |
self clearCodeView. |
|
1768 |
skipSignal isNil ifTrue:[skipSignal := Signal new]. |
|
1769 |
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
|
1770 |
changeListView setSelection:changeNr. |
294 | 1771 |
self applyChange:changeNr |
1772 |
]. |
|
1773 |
self autoSelectLast |
|
202 | 1774 |
] |
294 | 1775 |
|
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1776 |
"Modified: 25.5.1996 / 12:26:20 / cg" |
37 | 1777 |
! |
1778 |
||
202 | 1779 |
doApplyClassRest |
1780 |
"user wants all changes for this class from changeNr to be applied" |
|
1781 |
||
1782 |
self withSelectedChangeDo:[:changeNr | |
|
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1783 |
|thisClassName classNameToApply lastChange| |
37 | 1784 |
|
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1785 |
classNameToApply := self classNameOfChange:changeNr. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1786 |
classNameToApply notNil ifTrue:[ |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1787 |
self clearCodeView. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1788 |
skipSignal isNil ifTrue:[skipSignal := Signal new]. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1789 |
changeNr to:(self numberOfChanges) do:[:changeNr | |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1790 |
thisClassName := self classNameOfChange:changeNr. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1791 |
thisClassName = classNameToApply ifTrue:[ |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1792 |
changeListView setSelection:changeNr. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1793 |
self applyChange:changeNr. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1794 |
lastChange := changeNr |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1795 |
]. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1796 |
]. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1797 |
self autoSelect:lastChange. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1798 |
] |
202 | 1799 |
] |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1800 |
|
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1801 |
"Modified: 25.5.1996 / 12:26:25 / cg" |
37 | 1802 |
! |
1803 |
||
202 | 1804 |
doApplyRest |
1805 |
"user wants all changes from changeNr to be applied" |
|
28 | 1806 |
|
202 | 1807 |
self withSelectedChangeDo:[:changeNr | |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1808 |
self clearCodeView. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1809 |
skipSignal isNil ifTrue:[skipSignal := Signal new]. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1810 |
changeNr to:(self numberOfChanges) do:[:changeNr | |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1811 |
changeListView setSelection:changeNr. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1812 |
self applyChange:changeNr |
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 |
self autoSelect:self numberOfChanges. |
37 | 1815 |
] |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1816 |
|
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1817 |
"Modified: 25.5.1996 / 12:26:28 / cg" |
37 | 1818 |
! |
1819 |
||
45 | 1820 |
doBrowse |
1821 |
"user wants a browser on the class of a change" |
|
1822 |
||
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1823 |
|changeNr className cls isMeta| |
45 | 1824 |
|
1825 |
changeNr := changeListView selection. |
|
1826 |
changeNr notNil ifTrue:[ |
|
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1827 |
className := self fullClassNameOfChange:changeNr. |
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1828 |
className notNil ifTrue:[ |
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1829 |
isMeta := false. |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1830 |
(className endsWith:' class') ifTrue:[ |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1831 |
className := className copyWithoutLast:6. |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1832 |
isMeta := true. |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1833 |
]. |
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1834 |
(cls := Smalltalk classNamed:className) notNil ifTrue:[ |
241
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1835 |
isMeta ifTrue:[ |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1836 |
cls := cls class |
9366ced0db42
doBrowse was wrong for class-methods
Claus Gittinger <cg@exept.de>
parents:
226
diff
changeset
|
1837 |
]. |
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1838 |
SystemBrowser |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1839 |
openInClass:cls |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1840 |
selector:(self selectorOfMethodChange:changeNr) |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1841 |
] |
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
1842 |
] |
37 | 1843 |
] |
209
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1844 |
|
dc43fdd0aadf
browse-menu function opens browser in selected method
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1845 |
"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
|
1846 |
"Modified: 6.12.1995 / 17:09:26 / cg" |
37 | 1847 |
! |
1848 |
||
73 | 1849 |
doCompare |
1850 |
"compare change with current system version |
|
1851 |
- give a note in transcript" |
|
1852 |
||
1853 |
|changeNr| |
|
1854 |
||
1855 |
changeNr := changeListView selection. |
|
1856 |
changeNr notNil ifTrue:[ |
|
294 | 1857 |
self withExecuteCursorDo:[ |
1858 |
self compareChange:changeNr |
|
1859 |
] |
|
394 | 1860 |
]. |
1861 |
self newLabel:'' |
|
294 | 1862 |
|
394 | 1863 |
"Modified: 24.2.1996 / 19:37:19 / cg" |
73 | 1864 |
! |
1865 |
||
45 | 1866 |
doCompress |
1867 |
"compress the change-set; this replaces multiple method-changes by the last |
|
1868 |
(i.e. the most recent) change" |
|
1869 |
||
51 | 1870 |
|aStream searchIndex anyMore deleteSet index |
1871 |
str snapshotProto snapshotPrefix snapshotNameIndex fileName| |
|
45 | 1872 |
|
1873 |
aStream := FileStream readonlyFileNamed:changeFileName. |
|
1874 |
aStream isNil ifTrue:[^ self]. |
|
1875 |
||
221 | 1876 |
self newLabel:'compressing ...'. |
1877 |
||
58 | 1878 |
CompressSnapshotInfo == true ifTrue:[ |
294 | 1879 |
" |
1880 |
get a prototype snapshot record (to be independent of |
|
1881 |
the actual format .. |
|
1882 |
" |
|
1883 |
str := WriteStream on:String new. |
|
1884 |
Class addChangeRecordForSnapshot:'foo' to:str. |
|
1885 |
snapshotProto := str contents. |
|
1886 |
snapshotPrefix := snapshotProto copyTo:10. |
|
1887 |
snapshotNameIndex := snapshotProto findString:'foo'. |
|
58 | 1888 |
]. |
45 | 1889 |
|
294 | 1890 |
self withExecuteCursorDo:[ |
1891 |
|numChanges classes selectors types excla sawExcla |
|
1892 |
changeNr chunk aParseTree parseTreeChunk |
|
1893 |
thisClass thisSelector codeChunk codeParser| |
|
51 | 1894 |
|
294 | 1895 |
numChanges := self numberOfChanges. |
1896 |
classes := Array new:numChanges. |
|
1897 |
selectors := Array new:numChanges. |
|
1898 |
types := Array new:numChanges. |
|
45 | 1899 |
|
294 | 1900 |
"starting at the end, get the change class and change selector; |
1901 |
collect all in classes / selectors" |
|
45 | 1902 |
|
294 | 1903 |
changeNr := numChanges. |
1904 |
excla := aStream class chunkSeparator. |
|
45 | 1905 |
|
294 | 1906 |
[changeNr >= 1] whileTrue:[ |
1907 |
aStream position:(changePositions at:changeNr). |
|
1908 |
sawExcla := aStream peekFor:excla. |
|
1909 |
chunk := aStream nextChunk. |
|
1910 |
sawExcla ifTrue:[ |
|
1911 |
"optimize a bit if multiple methods for same category arrive" |
|
1912 |
(chunk = parseTreeChunk) ifFalse:[ |
|
1913 |
aParseTree := Parser parseExpression:chunk. |
|
1914 |
parseTreeChunk := chunk |
|
1915 |
]. |
|
1916 |
(aParseTree notNil |
|
1917 |
and:[(aParseTree ~~ #Error) |
|
1918 |
and:[aParseTree isMessage]]) ifTrue:[ |
|
1919 |
(aParseTree selector == #methodsFor:) ifTrue:[ |
|
1920 |
thisClass := (aParseTree receiver evaluate). |
|
1921 |
codeChunk := aStream nextChunk. |
|
1922 |
codeParser := Parser |
|
1923 |
parseMethodSpecification:codeChunk |
|
1924 |
in:thisClass |
|
1925 |
ignoreErrors:true |
|
1926 |
ignoreWarnings:true. |
|
1927 |
(codeParser notNil and:[codeParser ~~ #Error]) ifTrue:[ |
|
1928 |
selectors at:changeNr put:(codeParser selector). |
|
1929 |
classes at:changeNr put:thisClass. |
|
1930 |
types at:changeNr put:#methodsFor |
|
1931 |
] |
|
1932 |
] |
|
1933 |
] |
|
1934 |
] ifFalse:[ |
|
1935 |
aParseTree := Parser parseExpression:chunk. |
|
1936 |
parseTreeChunk := chunk. |
|
1937 |
(aParseTree notNil |
|
1938 |
and:[(aParseTree ~~ #Error) |
|
1939 |
and:[aParseTree isMessage]]) ifTrue:[ |
|
1940 |
(aParseTree selector == #removeSelector:) ifTrue:[ |
|
1941 |
selectors at:changeNr put:(aParseTree arg1 value ). |
|
1942 |
classes at:changeNr put:(aParseTree receiver evaluate). |
|
1943 |
types at:changeNr put:#removeSelector |
|
1944 |
] |
|
1945 |
] ifFalse:[ |
|
1946 |
CompressSnapshotInfo == true ifTrue:[ |
|
1947 |
(chunk startsWith:snapshotPrefix) ifTrue:[ |
|
1948 |
str := chunk readStream position:snapshotNameIndex. |
|
1949 |
fileName := str upTo:(Character space). |
|
1950 |
" |
|
1951 |
kludge to allow use of match-check below |
|
1952 |
" |
|
1953 |
selectors at:changeNr put:snapshotPrefix. |
|
1954 |
classes at:changeNr put:fileName. |
|
1955 |
] |
|
1956 |
] |
|
1957 |
] |
|
1958 |
]. |
|
1959 |
changeNr := changeNr - 1 |
|
1960 |
]. |
|
1961 |
aStream close. |
|
45 | 1962 |
|
294 | 1963 |
"for all changes, look for another class/selector occurence later |
1964 |
in the list and, if there is one, add change number to the delete set" |
|
45 | 1965 |
|
294 | 1966 |
deleteSet := OrderedCollection new. |
1967 |
changeNr := 1. |
|
1968 |
[changeNr < self numberOfChanges] whileTrue:[ |
|
1969 |
thisClass := classes at:changeNr. |
|
1970 |
thisSelector := selectors at:changeNr. |
|
1971 |
searchIndex := changeNr. |
|
1972 |
anyMore := true. |
|
1973 |
[anyMore] whileTrue:[ |
|
1974 |
searchIndex := classes indexOf:thisClass |
|
1975 |
startingAt:(searchIndex + 1). |
|
1976 |
(searchIndex ~~ 0) ifTrue:[ |
|
1977 |
((selectors at:searchIndex) == thisSelector) ifTrue:[ |
|
1978 |
thisClass notNil ifTrue:[ |
|
1979 |
deleteSet add:changeNr. |
|
1980 |
anyMore := false |
|
1981 |
] |
|
1982 |
] |
|
1983 |
] ifFalse:[ |
|
1984 |
anyMore := false |
|
1985 |
] |
|
1986 |
]. |
|
1987 |
changeNr := changeNr + 1 |
|
1988 |
]. |
|
45 | 1989 |
|
294 | 1990 |
"finally delete what has been found" |
45 | 1991 |
|
294 | 1992 |
(deleteSet size > 0) ifTrue:[ |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
1993 |
changeListView setSelection:nil. |
294 | 1994 |
index := deleteSet size. |
1995 |
[index > 0] whileTrue:[ |
|
1996 |
self silentDeleteChange:(deleteSet at:index). |
|
1997 |
index := index - 1 |
|
1998 |
]. |
|
1999 |
self setChangeList. |
|
2000 |
" |
|
2001 |
scroll back a bit, if we are left way behind the list |
|
2002 |
" |
|
2003 |
changeListView firstLineShown > self numberOfChanges ifTrue:[ |
|
2004 |
changeListView makeLineVisible:self numberOfChanges |
|
2005 |
]. |
|
2006 |
self clearCodeView |
|
2007 |
] |
|
221 | 2008 |
]. |
2009 |
self newLabel:''. |
|
2010 |
||
2011 |
"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
|
2012 |
"Modified: 25.5.1996 / 13:02:47 / cg" |
45 | 2013 |
! |
2014 |
||
202 | 2015 |
doDelete |
2016 |
"delete currently selected change" |
|
2017 |
||
2018 |
|changeNr| |
|
73 | 2019 |
|
202 | 2020 |
changeNr := changeListView selection. |
2021 |
changeNr notNil ifTrue:[ |
|
2022 |
self deleteChange:changeNr. |
|
2023 |
self autoSelectOrEnd:changeNr |
|
73 | 2024 |
] |
2025 |
! |
|
2026 |
||
202 | 2027 |
doDeleteClassAll |
2028 |
"delete all changes with same class as currently selected change" |
|
2029 |
||
2030 |
self withSelectedChangeDo:[:changeNr | |
|
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2031 |
| classNameToDelete | |
45 | 2032 |
|
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2033 |
classNameToDelete := self classNameOfChange:changeNr. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2034 |
classNameToDelete notNil ifTrue:[ |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2035 |
changeListView setSelection:nil. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2036 |
self silentDeleteChangesFor:classNameToDelete |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2037 |
from:1 |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2038 |
to:(self numberOfChanges). |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2039 |
self setChangeList. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2040 |
self autoSelectOrEnd:changeNr |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2041 |
] |
51 | 2042 |
] |
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 |
"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
|
2045 |
"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
|
2046 |
! |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2047 |
|
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2048 |
doDeleteClassFromBeginning |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2049 |
"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
|
2050 |
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
|
2051 |
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
|
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 |
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
|
2054 |
| classNameToDelete | |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2055 |
|
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2056 |
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
|
2057 |
classNameToDelete notNil ifTrue:[ |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2058 |
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
|
2059 |
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
|
2060 |
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
|
2061 |
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
|
2062 |
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
|
2063 |
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
|
2064 |
] |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2065 |
] |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2066 |
|
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2067 |
"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
|
2068 |
"Modified: 25.5.1996 / 12:26:34 / cg" |
51 | 2069 |
! |
2070 |
||
73 | 2071 |
doDeleteClassRest |
2072 |
"delete rest of changes with same class as currently selected change" |
|
2073 |
||
2074 |
self withSelectedChangeDo:[:changeNr | |
|
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2075 |
| classNameToDelete | |
73 | 2076 |
|
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2077 |
classNameToDelete := self classNameOfChange:changeNr. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2078 |
classNameToDelete notNil ifTrue:[ |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2079 |
changeListView setSelection:nil. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2080 |
self silentDeleteChangesFor:classNameToDelete |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2081 |
from:changeNr |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2082 |
to:(self numberOfChanges). |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2083 |
self setChangeList. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2084 |
self autoSelectOrEnd:changeNr |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2085 |
] |
73 | 2086 |
] |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2087 |
|
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2088 |
"Modified: 25.5.1996 / 12:26:39 / cg" |
73 | 2089 |
! |
2090 |
||
202 | 2091 |
doDeleteRest |
2092 |
"delete all changes from current to the end" |
|
51 | 2093 |
|
202 | 2094 |
|changeNr| |
51 | 2095 |
|
202 | 2096 |
changeNr := changeListView selection. |
2097 |
changeNr notNil ifTrue:[ |
|
223
d451e2badbd1
fixed handling of primitive def/var/function changes
Claus Gittinger <cg@exept.de>
parents:
221
diff
changeset
|
2098 |
self deleteChangesFrom:changeNr to:(self numberOfChanges). |
202 | 2099 |
self clearCodeView. |
2100 |
self autoSelectOrEnd:changeNr-1 |
|
51 | 2101 |
] |
132 | 2102 |
! |
2103 |
||
2104 |
doFileoutAndDeleteClassAll |
|
2105 |
"first fileOut the selected changes class then delete all changes |
|
2106 |
for it." |
|
2107 |
||
2108 |
self withSelectedChangeDo:[:changeNr | |
|
2109 |
| className class | |
|
2110 |
||
2111 |
className := self classNameOfChange:changeNr. |
|
2112 |
className notNil ifTrue:[ |
|
2113 |
class := Smalltalk classNamed:className. |
|
2114 |
class notNil ifTrue:[ |
|
2115 |
Class fileOutErrorSignal handle:[:ex | |
|
2116 |
self warn:('fileout failed: ' , ex errorString). |
|
2117 |
] do:[ |
|
2118 |
class fileOut. |
|
2119 |
self doDeleteClassAll |
|
2120 |
]. |
|
2121 |
]. |
|
2122 |
||
2123 |
]. |
|
2124 |
] |
|
2125 |
||
2126 |
"Modified: 6.9.1995 / 17:11:16 / claus" |
|
202 | 2127 |
! |
73 | 2128 |
|
202 | 2129 |
doMakePatch |
2130 |
"user wants a change to be made a patch |
|
2131 |
- copy it over to the patches file" |
|
89 | 2132 |
|
202 | 2133 |
|changeNr| |
89 | 2134 |
|
202 | 2135 |
changeNr := changeListView selection. |
2136 |
changeNr notNil ifTrue:[ |
|
2137 |
self makeChangeAPatch:changeNr. |
|
2138 |
self autoSelect:(changeNr + 1) |
|
2139 |
] |
|
73 | 2140 |
! |
2141 |
||
202 | 2142 |
doMakePermanent |
2143 |
"user wants a change to be made permanent |
|
2144 |
- rewrite the source file where this change has to go" |
|
2145 |
||
2146 |
|yesNoBox| |
|
73 | 2147 |
|
202 | 2148 |
yesNoBox := YesNoBox new. |
2149 |
yesNoBox title:(resources at:'Warning: this operation cannot be undone'). |
|
2150 |
yesNoBox okText:(resources at:'continue'). |
|
2151 |
yesNoBox noText:(resources at:'abort'). |
|
2152 |
yesNoBox okAction:[ |changeNr| |
|
2153 |
||
2154 |
changeNr := changeListView selection. |
|
2155 |
changeNr notNil ifTrue:[ |
|
2156 |
self makeChangePermanent:changeNr. |
|
2157 |
self autoSelect:(changeNr + 1) |
|
2158 |
] |
|
2159 |
]. |
|
2160 |
yesNoBox showAtPointer |
|
73 | 2161 |
! |
2162 |
||
202 | 2163 |
doSave |
2164 |
"user wants a change to be appended to a file" |
|
73 | 2165 |
|
202 | 2166 |
|changeNr fileName| |
73 | 2167 |
|
202 | 2168 |
changeNr := changeListView selection. |
2169 |
changeNr notNil ifTrue:[ |
|
2170 |
fileName := Dialog |
|
2171 |
requestFileName:'append change to:' |
|
2172 |
default:'' |
|
2173 |
ok:'append' |
|
2174 |
abort:'abort' |
|
2175 |
pattern:'*.chg'. |
|
2176 |
||
2177 |
fileName notNil ifTrue:[ |
|
2178 |
self withCursor:(Cursor write) do:[ |
|
2179 |
self appendChange:changeNr toFile:fileName. |
|
2180 |
]. |
|
2181 |
self autoSelect:(changeNr + 1) |
|
73 | 2182 |
]. |
202 | 2183 |
] |
73 | 2184 |
! |
2185 |
||
202 | 2186 |
doSaveClass |
2187 |
"user wants changes for some class from current to end to be appended to a file" |
|
89 | 2188 |
|
202 | 2189 |
self doSaveClassFrom:1 |
89 | 2190 |
! |
2191 |
||
202 | 2192 |
doSaveClassAll |
2193 |
"user wants changes for some class from current to end to be appended to a file" |
|
73 | 2194 |
|
202 | 2195 |
self doSaveClassFrom:1 |
2196 |
! |
|
2197 |
||
2198 |
doSaveClassFrom:startNr |
|
2199 |
"user wants changes from current to end to be appended to a file" |
|
2200 |
||
2201 |
|changeNr classNameToSave| |
|
73 | 2202 |
|
202 | 2203 |
changeNr := changeListView selection. |
2204 |
changeNr notNil ifTrue:[ |
|
2205 |
classNameToSave := self classNameOfChange:changeNr. |
|
2206 |
classNameToSave notNil ifTrue:[ |
|
2207 |
self saveClass:classNameToSave from:startNr |
|
2208 |
] |
|
2209 |
] |
|
2210 |
! |
|
73 | 2211 |
|
202 | 2212 |
doSaveClassRest |
2213 |
"user wants changes for some class from current to end to be appended to a file" |
|
73 | 2214 |
|
202 | 2215 |
|changeNr| |
132 | 2216 |
|
202 | 2217 |
changeNr := changeListView selection. |
2218 |
changeNr notNil ifTrue:[ |
|
2219 |
self doSaveClassFrom:changeNr |
|
2220 |
] |
|
81 | 2221 |
! |
2222 |
||
202 | 2223 |
doSaveRest |
2224 |
"user wants changes from current to end to be appended to a file" |
|
73 | 2225 |
|
202 | 2226 |
|changeNr fileName| |
51 | 2227 |
|
202 | 2228 |
changeNr := changeListView selection. |
2229 |
changeNr notNil ifTrue:[ |
|
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2230 |
fileName := Dialog |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2231 |
requestFileName:'append changes to:' |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2232 |
default:'' |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2233 |
ok:'append' |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2234 |
abort:'abort' |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2235 |
pattern:'*.chg'. |
51 | 2236 |
|
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2237 |
fileName notNil ifTrue:[ |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2238 |
self withCursor:(Cursor write) do:[ |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2239 |
changeNr to:(self numberOfChanges) do:[:changeNr | |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2240 |
changeListView setSelection:changeNr. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2241 |
(self appendChange:changeNr toFile:fileName) ifFalse:[ |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2242 |
^ self |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2243 |
] |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2244 |
] |
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 |
]. |
202 | 2247 |
] |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2248 |
|
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2249 |
"Modified: 25.5.1996 / 12:26:41 / cg" |
51 | 2250 |
! |
2251 |
||
202 | 2252 |
doUpdate |
2253 |
"reread the changes-file" |
|
51 | 2254 |
|
202 | 2255 |
self readChangesFileInBackground:true. |
2256 |
realized ifTrue:[ |
|
2257 |
self setChangeList. |
|
2258 |
] |
|
2259 |
||
51 | 2260 |
! |
2261 |
||
202 | 2262 |
doWriteBack |
2263 |
"write back the list onto the changes file" |
|
51 | 2264 |
|
2265 |
anyChanges ifTrue:[ |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2266 |
(self writeBackChanges) ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2267 |
realized ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2268 |
self readChangesFileInBackground:false. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2269 |
realized ifTrue:[ |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2270 |
self setChangeList |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2271 |
] |
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 |
] |
202 | 2274 |
] |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2275 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2276 |
"Modified: 5.9.1996 / 17:19:46 / cg" |
202 | 2277 |
! |
126 | 2278 |
|
202 | 2279 |
noChangesAllowed |
2280 |
"show a warning that changes cannot be changed" |
|
93 | 2281 |
|
202 | 2282 |
self warn:'changes are not allowed to be changed' |
0 | 2283 |
! |
2284 |
||
202 | 2285 |
saveClass:aClassName from:startNr |
2286 |
"user wants changes from current to end to be appended to a file" |
|
51 | 2287 |
|
202 | 2288 |
|changeNr fileName| |
51 | 2289 |
|
202 | 2290 |
changeNr := changeListView selection. |
2291 |
changeNr notNil ifTrue:[ |
|
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2292 |
fileName := Dialog |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2293 |
requestFileName:'append changes for class to:' |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2294 |
default:'' |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2295 |
ok:'append' |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2296 |
abort:'abort' |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2297 |
pattern:'*.chg'. |
0 | 2298 |
|
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2299 |
fileName notNil ifTrue:[ |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2300 |
self withCursor:(Cursor write) do:[ |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2301 |
startNr to:(self numberOfChanges) do:[:changeNr | |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2302 |
|thisClassName| |
0 | 2303 |
|
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2304 |
thisClassName := self classNameOfChange:changeNr. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2305 |
thisClassName = aClassName ifTrue:[ |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2306 |
changeListView setSelection:changeNr. |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2307 |
(self appendChange:changeNr toFile:fileName) ifFalse:[ |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2308 |
^ self |
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 |
] |
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2311 |
] |
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 |
]. |
202 | 2314 |
] |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2315 |
|
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
2316 |
"Modified: 25.5.1996 / 12:26:44 / cg" |
202 | 2317 |
! ! |
0 | 2318 |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2319 |
!ChangesBrowser class methodsFor:'documentation'! |
202 | 2320 |
|
2321 |
version |
|
744
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
2322 |
^ '$Header: /cvs/stx/stx/libtool/ChangesBrowser.st,v 1.91 1996-10-01 14:46:51 cg Exp $' |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
2323 |
! ! |