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