author | Claus Gittinger <cg@exept.de> |
Mon, 13 Nov 2006 13:05:19 +0100 | |
changeset 7507 | c7dbb0c5d864 |
parent 7463 | e8e74bdbfbda |
child 7527 | 86c103d92216 |
permissions | -rw-r--r-- |
0 | 1 |
" |
4 | 2 |
COPYRIGHT (c) 1990 by Claus Gittinger |
6288 | 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 |
" |
|
2664
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
12 |
"{ Package: 'stx:libtool' }" |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
13 |
|
0 | 14 |
StandardSystemView subclass:#ChangesBrowser |
4489 | 15 |
instanceVariableNames:'changeListView codeView diffView changeFileName changeChunks |
16 |
changePositions changeClassNames changeSelectors |
|
17 |
changeHeaderLines changeIsFollowupMethodChange anyChanges |
|
18 |
changeNrShown changeNrProcessed skipSignal autoCompare |
|
19 |
changeFileSize changeFileTimestamp checkBlock changeTimeStamps |
|
20 |
tabSpec autoUpdate editingClassSource lastSearchType |
|
21 |
lastSearchString applyInOriginalNameSpace lastSaveFileName |
|
22 |
readOnly enforcedPackage enforcedNameSpace updateChangeSet |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
23 |
showingDiffs diffViewBox autoloadAsRequired encodingIfKnown' |
4489 | 24 |
classVariableNames:'CompressSnapshotInfo NoColoring ShowWarningDialogs DefaultIcon |
25 |
DefaultAutoCompare DefaultShowingDiffs' |
|
26 |
poolDictionaries:'' |
|
27 |
category:'Interface-Browsers' |
|
0 | 28 |
! |
29 |
||
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
30 |
Object subclass:#ChangeFileReader |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
31 |
instanceVariableNames:'browser enforcedNameSpace changeFileName changeFileSize |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
32 |
changeFileTimestamp changeChunks changeClassNames |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
33 |
changeHeaderLines changePositions changeTimeStamps |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
34 |
changeIsFollowupMethodChange autoCompare tabSpec anyChanges |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
35 |
inStream thisIsAClassSource chunkText chunkPosition sawExcla |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
36 |
fullChunkText noColoring timeStampInfo changeString changeType |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
37 |
changeDelta headerLine maxLen' |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
38 |
classVariableNames:'NoColoring' |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
39 |
poolDictionaries:'' |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
40 |
privateIn:ChangesBrowser |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
41 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
42 |
|
761 | 43 |
!ChangesBrowser class methodsFor:'documentation'! |
29 | 44 |
|
45 |
copyright |
|
46 |
" |
|
47 |
COPYRIGHT (c) 1990 by Claus Gittinger |
|
6288 | 48 |
All Rights Reserved |
0 | 49 |
|
29 | 50 |
This software is furnished under a license and may be used |
51 |
only in accordance with the terms of that license and with the |
|
52 |
inclusion of the above copyright notice. This software may not |
|
53 |
be provided or otherwise made available to, or used by, any |
|
54 |
other person. No title to or ownership of the software is |
|
55 |
hereby transferred. |
|
56 |
" |
|
57 |
! |
|
58 |
||
59 |
documentation |
|
60 |
" |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
61 |
this implements a browser for the changes-file (actually, it can display |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
62 |
any sourceFiles contents). |
29 | 63 |
See the extra document 'doc/misc/cbrowser.doc' for how to use this browser. |
64 |
||
65 |
written jan 90 by claus |
|
51 | 66 |
|
5703 | 67 |
This is a very old leftover class (The Merovingian has not yet detected this one ;-) |
68 |
It will be completely replaced by the ChangeSetBrowser class in the near future. |
|
69 |
||
70 |
||
508 | 71 |
[Class variables:] |
6288 | 72 |
CompressSnapshotInfo if true (the default), snapshot entries |
73 |
are also compressed in the compress function. |
|
74 |
Some users prefer them to be not compressed. |
|
75 |
Set it to false for this. |
|
58 | 76 |
|
51 | 77 |
Notice: |
6288 | 78 |
this needs a total rewrite, to build up a changeSet from the file |
79 |
(which did not exist when the ChangesBrowser was originally written) |
|
80 |
and manipulate that changeSet. |
|
81 |
||
82 |
This way, we get a browser for any upcoming incore changeSets for |
|
83 |
free. Also, this will put the chunk analyzation code into Change and |
|
84 |
subclasses (where it belongs) and give a better encapsulation and |
|
85 |
overall structure. Do not take this as an example for good style ;-) |
|
86 |
||
87 |
The Change hierarchy is currently been completed, and the changes browser |
|
88 |
will be adapted soon. |
|
508 | 89 |
|
90 |
[author:] |
|
6288 | 91 |
Claus Gittinger |
508 | 92 |
|
93 |
[start with:] |
|
6288 | 94 |
ChangesBrowser open |
1359 | 95 |
|
96 |
[see also:] |
|
6288 | 97 |
( Using the ChangesBrowser :html: tools/cbrowser/TOP.html ) |
98 |
||
29 | 99 |
" |
100 |
! ! |
|
0 | 101 |
|
761 | 102 |
!ChangesBrowser class methodsFor:'instance creation'! |
45 | 103 |
|
104 |
new |
|
105 |
"create a new changes browser" |
|
106 |
||
6288 | 107 |
^ super |
108 |
label:(self defaultLabel) |
|
109 |
icon:(self defaultIcon) |
|
1470 | 110 |
|
111 |
"Modified: / 6.2.1998 / 13:25:18 / cg" |
|
45 | 112 |
! |
113 |
||
114 |
openOn:aFileName |
|
5696 | 115 |
"create a changes browser on a change file" |
116 |
||
117 |
|browser| |
|
45 | 118 |
|
3674 | 119 |
(self isXMLFile:aFileName) ifTrue:[ |
6288 | 120 |
browser := ChangeSetBrowser new |
5696 | 121 |
] ifFalse:[ |
6288 | 122 |
browser := self new |
3674 | 123 |
]. |
5696 | 124 |
|
125 |
browser label:(self defaultLabel , ': ', aFileName). |
|
126 |
browser changeFileName:aFileName. |
|
127 |
browser open. |
|
128 |
^ browser |
|
45 | 129 |
! ! |
130 |
||
761 | 131 |
!ChangesBrowser class methodsFor:'behavior'! |
0 | 132 |
|
133 |
autoSelectNext |
|
134 |
"returning true here, makes a Delete operation automatically |
|
135 |
select the next change" |
|
136 |
||
137 |
^ true |
|
138 |
! ! |
|
139 |
||
761 | 140 |
!ChangesBrowser class methodsFor:'defaults'! |
0 | 141 |
|
489 | 142 |
defaultIcon |
1153 | 143 |
"return the browsers default window icon" |
144 |
||
145 |
<resource: #style (#ICON #ICON_FILE)> |
|
146 |
||
147 |
|nm i| |
|
148 |
||
149 |
(i := DefaultIcon) isNil ifTrue:[ |
|
6288 | 150 |
i := self classResources at:'ICON' default:nil. |
151 |
i isNil ifTrue:[ |
|
152 |
nm := ClassResources at:'ICON_FILE' default:'CBrowser.xbm'. |
|
153 |
i := Smalltalk imageFromFileNamed:nm inPackage:#'stx:libtool'. |
|
154 |
i isNil ifTrue:[ |
|
155 |
i := StandardSystemView defaultIcon |
|
156 |
] |
|
157 |
]. |
|
158 |
i notNil ifTrue:[ |
|
159 |
DefaultIcon := i := i onDevice:Display |
|
160 |
] |
|
1084 | 161 |
]. |
162 |
^ i |
|
163 |
||
1153 | 164 |
"Modified: 19.3.1997 / 20:48:34 / ca" |
165 |
"Modified: 18.4.1997 / 15:16:24 / cg" |
|
489 | 166 |
! |
167 |
||
73 | 168 |
defaultLabel |
5527 | 169 |
^ self classResources string:'Changes Browser' |
2417 | 170 |
! |
171 |
||
172 |
isVisualStartable |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
173 |
"return true, if this application can be started via #open. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
174 |
(to allow start of a change browser via double-click in the browser)" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
175 |
|
2417 | 176 |
^ true |
177 |
||
178 |
"Created: / 27.9.1999 / 12:28:27 / cg" |
|
28 | 179 |
! ! |
180 |
||
3202 | 181 |
!ChangesBrowser class methodsFor:'menu specs'! |
182 |
||
183 |
menuSpec |
|
184 |
"This resource specification was automatically generated |
|
185 |
by the MenuEditor of ST/X." |
|
186 |
||
187 |
"Do not manually edit this!! If it is corrupted, |
|
188 |
the MenuEditor may not be able to read the specification." |
|
189 |
||
190 |
" |
|
191 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#menuSpec |
|
192 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser menuSpec)) startUp |
|
193 |
" |
|
194 |
||
195 |
<resource: #menu> |
|
196 |
||
7360 | 197 |
^ |
6216 | 198 |
#(Menu |
7096 | 199 |
( |
200 |
(MenuItem |
|
201 |
label: 'File' |
|
202 |
translateLabel: true |
|
7360 | 203 |
submenu: |
7096 | 204 |
(Menu |
205 |
( |
|
206 |
(MenuItem |
|
207 |
label: 'Compress' |
|
208 |
itemValue: doCompress |
|
209 |
translateLabel: true |
|
210 |
isVisible: notEditingClassSource |
|
211 |
) |
|
212 |
(MenuItem |
|
213 |
enabled: hasSingleSelection |
|
214 |
label: 'Compress for Class' |
|
215 |
itemValue: doCompressClass |
|
216 |
translateLabel: true |
|
217 |
isVisible: notEditingClassSource |
|
218 |
) |
|
219 |
(MenuItem |
|
220 |
enabled: hasSingleSelection |
|
221 |
label: 'Compress for Class && Selector' |
|
222 |
itemValue: doCompressSelector |
|
223 |
translateLabel: true |
|
224 |
isVisible: notEditingClassSource |
|
225 |
) |
|
226 |
(MenuItem |
|
227 |
label: 'Compare and Compress' |
|
228 |
itemValue: doCompareAndCompress |
|
229 |
translateLabel: true |
|
230 |
isVisible: notEditingClassSource |
|
231 |
) |
|
232 |
(MenuItem |
|
233 |
label: '-' |
|
234 |
isVisible: notEditingClassSource |
|
235 |
) |
|
236 |
(MenuItem |
|
237 |
enabled: hasSingleSelection |
|
238 |
label: 'Fileout && Delete all Changes for Class' |
|
239 |
itemValue: doFileoutAndDeleteClassAll |
|
240 |
translateLabel: true |
|
241 |
isVisible: notEditingClassSource |
|
242 |
) |
|
243 |
(MenuItem |
|
244 |
enabled: hasSelection |
|
245 |
label: 'CheckIn && Delete all Changes for Class' |
|
246 |
itemValue: doCheckinAndDeleteClassAll |
|
247 |
translateLabel: true |
|
248 |
isVisible: notEditingClassSource |
|
249 |
) |
|
250 |
(MenuItem |
|
251 |
label: '-' |
|
252 |
isVisible: notEditingClassSource |
|
253 |
) |
|
254 |
(MenuItem |
|
255 |
enabled: hasSelection |
|
256 |
label: 'Save In...' |
|
257 |
itemValue: doSave |
|
258 |
translateLabel: true |
|
259 |
) |
|
260 |
(MenuItem |
|
261 |
enabled: hasSingleSelection |
|
262 |
label: 'Save to End In...' |
|
263 |
itemValue: doSaveRest |
|
264 |
translateLabel: true |
|
265 |
) |
|
266 |
(MenuItem |
|
267 |
enabled: hasSingleSelection |
|
268 |
label: 'Save for Class to End In...' |
|
269 |
itemValue: doSaveClassRest |
|
270 |
translateLabel: true |
|
271 |
) |
|
272 |
(MenuItem |
|
273 |
enabled: hasSingleSelection |
|
274 |
label: 'Save all for Class In...' |
|
275 |
itemValue: doSaveClassAll |
|
276 |
translateLabel: true |
|
277 |
) |
|
278 |
(MenuItem |
|
279 |
label: '-' |
|
280 |
) |
|
281 |
(MenuItem |
|
282 |
label: 'Writeback ClassFile' |
|
283 |
itemValue: doWriteBack |
|
284 |
translateLabel: true |
|
285 |
isVisible: editingClassSource |
|
286 |
) |
|
287 |
(MenuItem |
|
288 |
label: 'Writeback ChangeFile' |
|
289 |
itemValue: doWriteBack |
|
290 |
translateLabel: true |
|
291 |
isVisible: notEditingClassSource |
|
292 |
) |
|
293 |
(MenuItem |
|
294 |
label: '-' |
|
295 |
) |
|
296 |
(MenuItem |
|
297 |
label: 'Update' |
|
298 |
itemValue: doUpdate |
|
299 |
translateLabel: true |
|
300 |
) |
|
301 |
(MenuItem |
|
302 |
label: '-' |
|
303 |
) |
|
304 |
(MenuItem |
|
305 |
label: 'Exit' |
|
306 |
itemValue: menuExit |
|
307 |
translateLabel: true |
|
308 |
) |
|
309 |
) |
|
310 |
nil |
|
311 |
nil |
|
312 |
) |
|
313 |
) |
|
314 |
(MenuItem |
|
315 |
label: 'Change' |
|
316 |
translateLabel: true |
|
7360 | 317 |
submenu: |
7096 | 318 |
(Menu |
319 |
( |
|
320 |
(MenuItem |
|
321 |
enabled: hasSelection |
|
322 |
label: 'Apply' |
|
323 |
itemValue: doApply |
|
324 |
translateLabel: true |
|
325 |
) |
|
326 |
(MenuItem |
|
327 |
enabled: hasSingleSelection |
|
328 |
label: 'Apply to End' |
|
329 |
itemValue: doApplyRest |
|
330 |
translateLabel: true |
|
331 |
) |
|
332 |
(MenuItem |
|
333 |
enabled: hasSingleSelection |
|
334 |
label: 'Apply from Begin' |
|
335 |
itemValue: doApplyFromBeginning |
|
336 |
translateLabel: true |
|
337 |
) |
|
338 |
(MenuItem |
|
339 |
enabled: hasSingleSelection |
|
340 |
label: 'Apply for Class to End' |
|
341 |
itemValue: doApplyClassRest |
|
342 |
translateLabel: true |
|
343 |
) |
|
344 |
(MenuItem |
|
345 |
enabled: hasSingleSelection |
|
346 |
label: 'Apply for Class from Begin' |
|
347 |
itemValue: doApplyClassFromBeginning |
|
348 |
translateLabel: true |
|
349 |
) |
|
350 |
(MenuItem |
|
351 |
enabled: hasNoSelection |
|
352 |
label: 'Apply All' |
|
353 |
itemValue: doApplyAll |
|
354 |
translateLabel: true |
|
355 |
) |
|
356 |
(MenuItem |
|
357 |
enabled: hasSingleSelection |
|
358 |
label: 'Apply to Conflict or End' |
|
359 |
itemValue: doApplyToConflictOrEnd |
|
360 |
translateLabel: true |
|
361 |
) |
|
362 |
(MenuItem |
|
363 |
label: '-' |
|
364 |
) |
|
365 |
(MenuItem |
|
366 |
enabled: hasSelection |
|
367 |
label: 'Delete' |
|
368 |
itemValue: doDelete |
|
369 |
translateLabel: true |
|
370 |
) |
|
371 |
(MenuItem |
|
372 |
enabled: hasSingleSelection |
|
373 |
label: 'Delete to End' |
|
374 |
itemValue: doDeleteRest |
|
375 |
translateLabel: true |
|
376 |
) |
|
377 |
(MenuItem |
|
378 |
enabled: hasSingleSelection |
|
379 |
label: 'Delete from Begin' |
|
380 |
itemValue: doDeleteFromBeginning |
|
381 |
translateLabel: true |
|
382 |
) |
|
383 |
(MenuItem |
|
384 |
enabled: hasSingleSelection |
|
385 |
label: 'Delete for Class to End' |
|
386 |
itemValue: doDeleteClassRest |
|
387 |
translateLabel: true |
|
388 |
) |
|
389 |
(MenuItem |
|
390 |
enabled: hasSingleSelection |
|
391 |
label: 'Delete for Class from Begin' |
|
392 |
itemValue: doDeleteClassFromBeginning |
|
393 |
translateLabel: true |
|
394 |
) |
|
395 |
(MenuItem |
|
396 |
enabled: hasSelection |
|
397 |
label: 'Delete all for Class' |
|
398 |
itemValue: doDeleteClassAll |
|
399 |
translateLabel: true |
|
400 |
isVisible: hasNoMultiSelection |
|
401 |
) |
|
402 |
(MenuItem |
|
403 |
enabled: hasSelection |
|
404 |
label: 'Delete all for Class && its Private Classes' |
|
405 |
itemValue: doDeleteClassAndPrivateClassesAll |
|
406 |
translateLabel: true |
|
407 |
isVisible: hasNoMultiSelection |
|
408 |
) |
|
409 |
(MenuItem |
|
410 |
enabled: hasSelection |
|
411 |
label: 'Delete all for Classes' |
|
412 |
itemValue: doDeleteClassAll |
|
413 |
translateLabel: true |
|
414 |
isVisible: hasMultiSelection |
|
415 |
) |
|
416 |
(MenuItem |
|
417 |
enabled: hasSelection |
|
418 |
label: 'Delete all for Classes && their Private Classes' |
|
419 |
itemValue: doDeleteClassAndPrivateClassesAll |
|
420 |
translateLabel: true |
|
421 |
isVisible: hasMultiSelection |
|
422 |
) |
|
423 |
(MenuItem |
|
424 |
label: '-' |
|
425 |
) |
|
426 |
(MenuItem |
|
427 |
enabled: hasSelection |
|
428 |
label: 'Delete all Versions of Selected Method' |
|
429 |
itemValue: doDeleteClassSelectorAll |
|
430 |
translateLabel: true |
|
431 |
isVisible: hasNoMultiSelection |
|
432 |
) |
|
433 |
(MenuItem |
|
434 |
enabled: hasSelection |
|
435 |
label: 'Delete all Versions of all Selected Methods' |
|
436 |
itemValue: doDeleteClassSelectorAll |
|
437 |
translateLabel: true |
|
438 |
isVisible: hasMultiSelection |
|
439 |
) |
|
440 |
(MenuItem |
|
441 |
label: '-' |
|
442 |
) |
|
443 |
(MenuItem |
|
444 |
enabled: hasSingleSelection |
|
445 |
label: 'Compare with Current' |
|
446 |
itemValue: doCompare |
|
447 |
translateLabel: true |
|
448 |
) |
|
449 |
(MenuItem |
|
450 |
label: '-' |
|
451 |
) |
|
452 |
(MenuItem |
|
453 |
enabled: hasSelection |
|
454 |
label: 'Make Change a Patch' |
|
455 |
itemValue: doMakePatch |
|
456 |
translateLabel: true |
|
457 |
) |
|
458 |
) |
|
459 |
nil |
|
460 |
nil |
|
461 |
) |
|
462 |
) |
|
463 |
(MenuItem |
|
464 |
label: 'Search' |
|
465 |
translateLabel: true |
|
7360 | 466 |
submenu: |
7096 | 467 |
(Menu |
468 |
( |
|
469 |
(MenuItem |
|
470 |
label: 'Class...' |
|
471 |
itemValue: findClass |
|
472 |
translateLabel: true |
|
473 |
) |
|
474 |
(MenuItem |
|
475 |
enabled: hasSelection |
|
476 |
label: 'Previous for Class' |
|
477 |
itemValue: findPreviousForClass |
|
478 |
translateLabel: true |
|
479 |
) |
|
480 |
(MenuItem |
|
481 |
enabled: hasSelection |
|
482 |
label: 'Next for Class' |
|
483 |
itemValue: findNextForClass |
|
484 |
translateLabel: true |
|
485 |
) |
|
486 |
(MenuItem |
|
487 |
label: '-' |
|
488 |
) |
|
489 |
(MenuItem |
|
490 |
label: 'Selector...' |
|
491 |
itemValue: findSelector |
|
492 |
translateLabel: true |
|
493 |
) |
|
494 |
(MenuItem |
|
495 |
enabled: hasSelection |
|
496 |
label: 'Previous for Selector' |
|
497 |
itemValue: findPreviousForSelector |
|
498 |
translateLabel: true |
|
499 |
) |
|
500 |
(MenuItem |
|
501 |
enabled: hasSelection |
|
502 |
label: 'Next for Selector' |
|
503 |
itemValue: findNextForSelector |
|
504 |
translateLabel: true |
|
505 |
) |
|
506 |
(MenuItem |
|
507 |
label: '-' |
|
508 |
) |
|
509 |
(MenuItem |
|
510 |
label: 'String...' |
|
511 |
itemValue: findString |
|
512 |
translateLabel: true |
|
513 |
) |
|
514 |
(MenuItem |
|
515 |
enabled: hasSelection |
|
516 |
label: 'Previous with String' |
|
517 |
itemValue: findPreviousForString |
|
518 |
translateLabel: true |
|
519 |
) |
|
520 |
(MenuItem |
|
521 |
enabled: hasSelection |
|
522 |
label: 'Next with String' |
|
523 |
itemValue: findNextForString |
|
524 |
translateLabel: true |
|
525 |
) |
|
526 |
(MenuItem |
|
527 |
label: '-' |
|
528 |
) |
|
529 |
(MenuItem |
|
530 |
enabled: hasSelection |
|
531 |
label: 'Previous Difference' |
|
532 |
itemValue: findPreviousDifference |
|
533 |
translateLabel: true |
|
534 |
) |
|
535 |
(MenuItem |
|
536 |
enabled: hasSelection |
|
537 |
label: 'Next Difference' |
|
538 |
itemValue: findNextDifference |
|
539 |
translateLabel: true |
|
540 |
) |
|
541 |
(MenuItem |
|
542 |
label: '-' |
|
543 |
) |
|
544 |
(MenuItem |
|
545 |
enabled: hasSelection |
|
546 |
label: 'Previous Snapshot' |
|
547 |
itemValue: findPreviousSnapshot |
|
548 |
translateLabel: true |
|
549 |
) |
|
550 |
(MenuItem |
|
551 |
enabled: hasSelection |
|
552 |
label: 'Next Snapshot' |
|
553 |
itemValue: findNextSnapshot |
|
554 |
translateLabel: true |
|
555 |
) |
|
7360 | 556 |
(MenuItem |
557 |
label: 'Last Snapshot' |
|
558 |
itemValue: findLastSnapshot |
|
559 |
translateLabel: true |
|
560 |
) |
|
7096 | 561 |
) |
562 |
nil |
|
563 |
nil |
|
564 |
) |
|
565 |
) |
|
566 |
(MenuItem |
|
567 |
label: 'Browse' |
|
568 |
translateLabel: true |
|
7360 | 569 |
submenu: |
7096 | 570 |
(Menu |
571 |
( |
|
572 |
(MenuItem |
|
573 |
enabled: hasSingleSelection |
|
574 |
label: 'Class' |
|
575 |
itemValue: doBrowse |
|
576 |
translateLabel: true |
|
577 |
) |
|
578 |
(MenuItem |
|
579 |
label: '-' |
|
580 |
) |
|
581 |
(MenuItem |
|
582 |
label: 'Senders...' |
|
583 |
itemValue: doBrowseSenders |
|
584 |
translateLabel: true |
|
585 |
) |
|
586 |
(MenuItem |
|
587 |
label: 'Implementors...' |
|
588 |
itemValue: doBrowseImplementors |
|
589 |
translateLabel: true |
|
590 |
) |
|
591 |
) |
|
592 |
nil |
|
593 |
nil |
|
594 |
) |
|
595 |
) |
|
596 |
(MenuItem |
|
597 |
label: 'Settings' |
|
598 |
translateLabel: true |
|
7360 | 599 |
submenu: |
7096 | 600 |
(Menu |
601 |
( |
|
602 |
(MenuItem |
|
603 |
label: 'Auto Compare' |
|
604 |
translateLabel: true |
|
605 |
indication: autoCompare |
|
606 |
) |
|
607 |
(MenuItem |
|
608 |
label: 'Autoload As Required' |
|
609 |
translateLabel: true |
|
610 |
indication: autoloadAsRequired |
|
611 |
) |
|
612 |
(MenuItem |
|
613 |
label: 'Show Diffs' |
|
614 |
translateLabel: true |
|
615 |
indication: showingDiffs |
|
616 |
) |
|
617 |
(MenuItem |
|
618 |
label: 'Auto Update' |
|
619 |
translateLabel: true |
|
620 |
indication: autoUpdate |
|
621 |
) |
|
622 |
(MenuItem |
|
623 |
label: '-' |
|
624 |
) |
|
625 |
(MenuItem |
|
626 |
label: 'Add to ChangeSet when Applying' |
|
627 |
translateLabel: true |
|
628 |
indication: updateChangeSet |
|
629 |
) |
|
630 |
(MenuItem |
|
631 |
label: '-' |
|
632 |
) |
|
633 |
(MenuItem |
|
634 |
label: 'Apply into Package...' |
|
635 |
itemValue: setEnforcedPackage |
|
636 |
translateLabel: true |
|
637 |
) |
|
638 |
(MenuItem |
|
639 |
label: 'Apply into NameSpace...' |
|
640 |
itemValue: setEnforcedNameSpace |
|
641 |
translateLabel: true |
|
642 |
) |
|
643 |
) |
|
644 |
nil |
|
645 |
nil |
|
646 |
) |
|
647 |
) |
|
648 |
(MenuItem |
|
7463
e8e74bdbfbda
support '?' as help (for now: controlled by resources)
Claus Gittinger <cg@exept.de>
parents:
7415
diff
changeset
|
649 |
label: 'MENU_Help' |
7096 | 650 |
translateLabel: true |
7415 | 651 |
startGroup: conditionalRight |
7360 | 652 |
submenu: |
7096 | 653 |
(Menu |
654 |
( |
|
655 |
(MenuItem |
|
656 |
label: 'ChangesBrowser Documentation' |
|
657 |
itemValue: openHTMLDocument: |
|
658 |
translateLabel: true |
|
659 |
argument: 'tools/cbrowser/TOP.html' |
|
660 |
) |
|
661 |
(MenuItem |
|
662 |
label: '-' |
|
663 |
) |
|
664 |
(MenuItem |
|
665 |
label: 'About ChangesBrowser...' |
|
666 |
itemValue: openAboutThisApplication |
|
667 |
translateLabel: true |
|
668 |
) |
|
669 |
) |
|
670 |
nil |
|
671 |
nil |
|
672 |
) |
|
673 |
) |
|
674 |
) |
|
675 |
nil |
|
676 |
nil |
|
3202 | 677 |
) |
7463
e8e74bdbfbda
support '?' as help (for now: controlled by resources)
Claus Gittinger <cg@exept.de>
parents:
7415
diff
changeset
|
678 |
|
e8e74bdbfbda
support '?' as help (for now: controlled by resources)
Claus Gittinger <cg@exept.de>
parents:
7415
diff
changeset
|
679 |
"Modified: / 23-10-2006 / 23:16:01 / cg" |
3202 | 680 |
! ! |
681 |
||
3674 | 682 |
!ChangesBrowser class methodsFor:'private-changeFile access'! |
683 |
||
684 |
readXMLChangesFrom:aStream inBackground:inBackground |
|
685 |
"read an XML source file (format as in campSmalltalk DTD)" |
|
686 |
||
687 |
|changeSet| |
|
688 |
||
689 |
(XML isNil or:[XML::SourceNodeBuilder isNil or:[XML::XMLParser isNil]]) ifTrue:[ |
|
6288 | 690 |
Smalltalk loadPackage:'stx:goodies/xml/vw'. |
691 |
(XML isNil or:[XML::SourceNodeBuilder isNil or:[XML::XMLParser isNil]]) ifTrue:[ |
|
692 |
self error:'Could not load XML package(s) from ''stx:goodies/xml/vw'''. |
|
693 |
] |
|
3674 | 694 |
]. |
695 |
||
696 |
changeSet := ChangeSet new. |
|
6288 | 697 |
XML::SourceScannerNodeBuilder new |
698 |
scanFile:aStream |
|
699 |
do:[:eachChange | |
|
700 |
changeSet addChange:eachChange. |
|
701 |
]. |
|
3674 | 702 |
^ changeSet |
703 |
||
704 |
"/ builder := XML::SourceScannerNodeBuilder new. |
|
705 |
"/ parser := XML::XMLParser on:aStream. |
|
706 |
"/ parser builder:builder. |
|
707 |
"/ parser validate:false. |
|
708 |
"/ parser scanDocument. |
|
709 |
! |
|
710 |
||
711 |
readXMLChangesFromFile:changeFileName inBackground:inBackground |
|
712 |
|s set| |
|
713 |
||
714 |
s := changeFileName asFilename readStream. |
|
715 |
set := self readXMLChangesFrom:s inBackground:inBackground. |
|
716 |
s close. |
|
717 |
^ set. |
|
718 |
! ! |
|
719 |
||
720 |
!ChangesBrowser class methodsFor:'utilities'! |
|
721 |
||
722 |
isXMLFile:aFilename |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
723 |
|stream first| |
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
724 |
|
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
725 |
stream := aFilename asFilename readStreamOrNil. |
3674 | 726 |
stream isNil ifTrue:[^ false]. |
727 |
||
728 |
stream skipSeparators. |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
729 |
first := stream peek. |
3674 | 730 |
stream close. |
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
731 |
^ first == $< |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
732 |
! |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
733 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
734 |
methodDefinitionSelectors |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
735 |
^ #( |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
736 |
#'methodsFor:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
737 |
#'privateMethodsFor:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
738 |
#'publicMethodsFor:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
739 |
#'ignoredMethodsFor:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
740 |
#'protectedMethodsFor:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
741 |
#'methodsFor:stamp:' "/ Squeak support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
742 |
#'commentStamp:prior:' "/ Squeak support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
743 |
#methodsFor "/ Dolphin support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
744 |
#categoriesForClass "/ Dolphin support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
745 |
#'categoriesFor:' "/ Dolphin support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
746 |
#methods "/ STV support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
747 |
#publicMethods "/ STV / V'Age support |
6532 | 748 |
#privateMethods "/ STV / V'Age support |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
749 |
#'methodsForUndefined:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
750 |
) |
3674 | 751 |
! ! |
752 |
||
3202 | 753 |
!ChangesBrowser methodsFor:'aspects'! |
754 |
||
755 |
applyInOriginalNameSpace |
|
756 |
^ applyInOriginalNameSpace |
|
757 |
! |
|
758 |
||
3472 | 759 |
applyNotInOriginalNameSpace |
6288 | 760 |
^ BlockValue forLogicalNot:self applyInOriginalNameSpace |
3472 | 761 |
! |
762 |
||
3202 | 763 |
autoCompare |
764 |
^ autoCompare |
|
765 |
! |
|
766 |
||
767 |
autoUpdate |
|
768 |
"enabled/disable automatic update from the change-file (for monitoring)" |
|
769 |
||
770 |
^ autoUpdate |
|
771 |
||
772 |
"Created: 3.12.1995 / 14:14:24 / cg" |
|
773 |
"Modified: 3.12.1995 / 14:20:45 / cg" |
|
774 |
! |
|
775 |
||
6216 | 776 |
autoloadAsRequired |
777 |
^ autoloadAsRequired |
|
778 |
! |
|
779 |
||
3202 | 780 |
editingClassSource |
3203 | 781 |
^ editingClassSource ? false |
3202 | 782 |
! |
783 |
||
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
784 |
hasMultiSelection |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
785 |
^ self hasSelection and:[self hasSingleSelection not] |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
786 |
! |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
787 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
788 |
hasNoMultiSelection |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
789 |
^ self hasMultiSelection not |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
790 |
! |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
791 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
792 |
hasNoSelection |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
793 |
^ self hasSelection not |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
794 |
! |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
795 |
|
3202 | 796 |
hasSelection |
6288 | 797 |
^ changeListView hasSelection |
3202 | 798 |
! |
799 |
||
3211 | 800 |
hasSingleSelection |
801 |
changeListView multipleSelectOk ifTrue:[ |
|
6288 | 802 |
^ changeListView selection size == 1 |
3211 | 803 |
]. |
804 |
^ changeListView hasSelection |
|
805 |
! |
|
806 |
||
3202 | 807 |
notEditingClassSource |
808 |
^ self editingClassSource not |
|
3211 | 809 |
! |
810 |
||
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
811 |
notEditingClassSourceAndNotReadOnly |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
812 |
^ (self editingClassSource or:[readOnly == true]) not |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
813 |
! |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
814 |
|
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
815 |
notReadOnly |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
816 |
^ (readOnly ~~ true) |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
817 |
! |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
818 |
|
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
819 |
readOnly:aBoolean |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
820 |
readOnly := aBoolean |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
821 |
! |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
822 |
|
4487 | 823 |
showingDiffs |
824 |
showingDiffs isNil ifTrue:[ |
|
6288 | 825 |
showingDiffs := self showingDiffsDefault asValue. |
826 |
showingDiffs |
|
827 |
onChangeEvaluate:[ |
|
828 |
showingDiffs value ifTrue:[ |
|
829 |
self updateDiffView. |
|
830 |
self makeDiffViewVisible |
|
831 |
] ifFalse:[ |
|
832 |
self makeDiffViewInvisible |
|
833 |
]. |
|
834 |
DefaultShowingDiffs := showingDiffs value. |
|
835 |
] |
|
4487 | 836 |
]. |
837 |
^ showingDiffs |
|
838 |
! |
|
839 |
||
4943 | 840 |
showingDiffsDefault |
841 |
^ (DefaultShowingDiffs ? true) |
|
842 |
! |
|
843 |
||
3211 | 844 |
theSingleSelection |
845 |
|sel| |
|
846 |
||
847 |
sel := changeListView selection. |
|
848 |
changeListView multipleSelectOk ifTrue:[ |
|
6288 | 849 |
sel size == 1 ifTrue:[ |
850 |
^ sel first |
|
851 |
]. |
|
852 |
^ nil |
|
3211 | 853 |
]. |
854 |
^ sel. |
|
3319 | 855 |
! |
856 |
||
857 |
updateChangeSet |
|
858 |
^ updateChangeSet |
|
3202 | 859 |
! ! |
860 |
||
202 | 861 |
!ChangesBrowser methodsFor:'compiler interface'! |
862 |
||
863 |
wantChangeLog |
|
864 |
"sent by the compiler to ask if a changeLog entry should |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
865 |
be written when compiling. Return false here." |
202 | 866 |
|
867 |
^ false |
|
868 |
! ! |
|
869 |
||
4869 | 870 |
!ChangesBrowser methodsFor:'compiler interface-error handling'! |
202 | 871 |
|
872 |
correctableError:aString position:relPos to:relEndPos from:aCompiler |
|
873 |
"compiler notifys us of an error - this should really not happen since |
|
874 |
changes ought to be correct (did someone edit the changes file ??). |
|
875 |
Show the bad change in the codeView and let codeView hilight the error; |
|
876 |
no corrections allowed here therefore return false" |
|
877 |
||
2293 | 878 |
ShowWarningDialogs == true ifTrue:[ |
6288 | 879 |
self error:aString position:relPos to:relEndPos from:aCompiler. |
2293 | 880 |
] ifFalse:[ |
6288 | 881 |
Transcript showCR:aString. |
2293 | 882 |
]. |
202 | 883 |
^ false |
884 |
! |
|
885 |
||
2555 | 886 |
correctableSelectorWarning:aString position:relPos to:relEndPos from:aCompiler |
887 |
"compiler notifys us of a warning" |
|
888 |
||
889 |
^ false |
|
890 |
||
891 |
"Modified: / 19.1.2000 / 16:25:31 / cg" |
|
892 |
"Created: / 19.1.2000 / 16:27:23 / cg" |
|
893 |
! |
|
894 |
||
202 | 895 |
error:aString position:relPos to:relEndPos from:aCompiler |
896 |
"compiler notifys us of an error - this should really not happen since |
|
897 |
changes ought to be correct (did someone edit the changes file ??). |
|
898 |
Show the bad change in the codeView and let codeView hilight the error" |
|
899 |
||
900 |
|action| |
|
901 |
||
902 |
(changeNrProcessed ~~ changeNrShown) ifTrue:[ |
|
6288 | 903 |
self changeSelection:changeNrProcessed |
202 | 904 |
]. |
905 |
(skipSignal notNil) ifTrue:[ |
|
906 |
||
6288 | 907 |
codeView highlightingErrorPosition:relPos to:relEndPos do:[ |
908 |
|box| |
|
909 |
||
910 |
" |
|
911 |
start dialog - make certain cleanup is done |
|
912 |
" |
|
913 |
action := OptionBox |
|
914 |
request:aString |
|
915 |
label:'Error' |
|
916 |
image:(WarningBox iconBitmap) |
|
917 |
buttonLabels:#('Cancel' 'Skip' " 'Shut up' " 'Continue') |
|
918 |
values:#(#abort #skip " #shutUp " #continue) |
|
919 |
default:#continue |
|
920 |
onCancel:#abort. |
|
921 |
]. |
|
2293 | 922 |
|
923 |
"/ action == #shutUp ifTrue:[ |
|
924 |
"/ aCompiler ignoreWarnings. |
|
6288 | 925 |
"/ ^ false |
2293 | 926 |
"/ ]. |
927 |
||
6288 | 928 |
(action == #abort) ifTrue:[ |
929 |
AbortOperationRequest raise. |
|
930 |
^ false |
|
931 |
]. |
|
932 |
action == #skip ifTrue:[ |
|
933 |
skipSignal raise. |
|
934 |
^ false |
|
935 |
]. |
|
936 |
^ false |
|
202 | 937 |
]. |
938 |
^ codeView error:aString position:relPos to:relEndPos from:aCompiler |
|
373 | 939 |
|
3436
c4fe19deba58
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3406
diff
changeset
|
940 |
"Modified: / 16.11.2001 / 17:38:10 / cg" |
202 | 941 |
! |
942 |
||
3064 | 943 |
unusedVariableWarning:aString position:relPos to:relEndPos from:aCompiler |
944 |
"compiler notifies us of a (or some) unused variables; |
|
945 |
hilight the error (relPos to relEndPos) and show a Box asking for continue/correct/abort; |
|
946 |
this method should return true to the compiler if user wants the error |
|
947 |
to be corrected; false otherwise" |
|
948 |
||
949 |
^ false |
|
950 |
! |
|
951 |
||
202 | 952 |
warning:aString position:relPos to:relEndPos from:aCompiler |
953 |
"compiler notifys us of a warning - ignore it" |
|
954 |
||
955 |
^ self |
|
956 |
! ! |
|
957 |
||
2604 | 958 |
!ChangesBrowser methodsFor:'event handling'! |
202 | 959 |
|
960 |
handlesKeyPress:key inView:view |
|
961 |
"this method is reached via delegation: are we prepared to handle |
|
962 |
a keyPress in some other view ?" |
|
963 |
||
1127 | 964 |
<resource: #keyboard (#Delete #BackSpace #Accept #Find #FindPrev #FindNext)> |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
965 |
|
202 | 966 |
view == changeListView ifTrue:[ |
6288 | 967 |
(key == #Delete |
968 |
or:[key == #BackSpace |
|
969 |
or:[key == #Accept |
|
970 |
or:[key == #Find |
|
971 |
or:[key == #FindPrev |
|
972 |
or:[key == #FindNext]]]]]) ifTrue:[^ true]. |
|
202 | 973 |
]. |
974 |
^ false |
|
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
975 |
|
1127 | 976 |
"Modified: 8.4.1997 / 11:01:42 / cg" |
0 | 977 |
! |
978 |
||
202 | 979 |
keyPress:key x:x y:y view:view |
980 |
"this method is reached via delegation from the changeListView" |
|
981 |
||
1127 | 982 |
<resource: #keyboard (#Delete #BackSpace #Accept #Find #FindPrev #FindNext)> |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
983 |
|
3249 | 984 |
(key == #Delete) ifTrue:[ |
6288 | 985 |
self sensor shiftDown ifTrue:[ |
986 |
self doDeleteAndSelectPrevious. |
|
987 |
] ifFalse:[ |
|
988 |
self doDelete. |
|
989 |
]. |
|
990 |
^ self |
|
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
991 |
]. |
3249 | 992 |
(key == #BackSpace) ifTrue:[ |
6288 | 993 |
self doDeleteAndSelectPrevious. |
994 |
^ self |
|
3249 | 995 |
]. |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
996 |
(key == #Accept) ifTrue:[ |
6288 | 997 |
self doApply. |
998 |
^ self |
|
202 | 999 |
]. |
1127 | 1000 |
(key == #Find) ifTrue:[ |
6288 | 1001 |
self findClass. |
1002 |
^ self |
|
1127 | 1003 |
]. |
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1004 |
(key == #FindPrev) ifTrue:[ |
6288 | 1005 |
self findPrevious. |
1006 |
^ self |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1007 |
]. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1008 |
(key == #FindNext) ifTrue:[ |
6288 | 1009 |
self findNext. |
1010 |
^ self |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1011 |
]. |
202 | 1012 |
changeListView keyPress:key x:x y:y |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
1013 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
1014 |
"Modified: / 18.6.1998 / 22:15:36 / cg" |
202 | 1015 |
! ! |
1016 |
||
3327 | 1017 |
!ChangesBrowser methodsFor:'help'! |
202 | 1018 |
|
394 | 1019 |
showActivity:someMessage |
502 | 1020 |
"some activityNotification to be forwarded to the user; |
1021 |
show it in the windows title area here." |
|
1022 |
||
394 | 1023 |
self label:someMessage |
1024 |
||
1025 |
"Created: 24.2.1996 / 19:35:42 / cg" |
|
502 | 1026 |
"Modified: 23.4.1996 / 21:39:36 / cg" |
202 | 1027 |
! ! |
1028 |
||
4868 | 1029 |
!ChangesBrowser methodsFor:'initialization & release'! |
202 | 1030 |
|
3202 | 1031 |
autoCompareChanged |
1032 |
"sent from the compare-toggle" |
|
1033 |
||
3534 | 1034 |
|doCompare| |
1035 |
||
1036 |
doCompare := autoCompare value. |
|
1037 |
DefaultAutoCompare := doCompare. |
|
1038 |
self setupTabSpec. |
|
1039 |
doCompare ifTrue:[ |
|
6288 | 1040 |
self doUpdate |
3202 | 1041 |
] ifFalse:[ |
6288 | 1042 |
changeListView invalidate. "/ clear; redraw. |
3202 | 1043 |
] |
1044 |
! |
|
1045 |
||
202 | 1046 |
changeListMenu |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1047 |
"return the menu for the change (upper) list" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1048 |
|
586 | 1049 |
<resource: #keyboard ( #Accept #Delete ) > |
1359 | 1050 |
<resource: #programMenu > |
586 | 1051 |
|
3211 | 1052 |
|items m replNext replPrev sel| |
1670
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1053 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
1054 |
self sensor ctrlDown ifTrue:[ |
7360 | 1055 |
"/ notice - findNext/prev shortKeys will search for the same thing again. |
1056 |
items := #( |
|
1057 |
('Search Class...' findClass #Find ) |
|
1058 |
('Previous for this Class' findPreviousForClass #FindPrevClass ) |
|
1059 |
('Next for this Class' findNextForClass #FindNextClass ) |
|
1060 |
('-' ) |
|
1061 |
('Search Selector...' findSelector ) |
|
1062 |
('Previous with this Selector' findPreviousForSelector #FindPrevSelector ) |
|
1063 |
('Next with this Selector' findNextForSelector #FindNextSelector ) |
|
1064 |
('-' ) |
|
1065 |
('Search String...' findString ) |
|
1066 |
('Previous with this String' findPreviousForString #FindPrevString ) |
|
1067 |
('Next with this String' findNextForString #FindNextString ) |
|
1068 |
('-' ) |
|
1069 |
('Previous Snapshot' findPreviousSnapshot #FindPrevSnapshot ) |
|
1070 |
('Next Snapshot' findNextSnapshot #FindNextSnapshot ) |
|
1071 |
). |
|
1072 |
||
1073 |
lastSearchType == #selector ifTrue:[ |
|
1074 |
replNext := #FindNextSelector. |
|
1075 |
replPrev := #FindPrevSelector. |
|
1076 |
] ifFalse:[ |
|
1077 |
lastSearchType == #snapshot ifTrue:[ |
|
1078 |
replNext := #FindNextSnapshot. |
|
1079 |
replPrev := #FindPrevSnapshot. |
|
1080 |
] ifFalse:[ |
|
1081 |
lastSearchType == #string ifTrue:[ |
|
1082 |
replNext := #FindNextString. |
|
1083 |
replPrev := #FindPrevString. |
|
1084 |
] ifFalse:[ |
|
1085 |
replNext := #FindNextClass. |
|
1086 |
replPrev := #FindPrevClass. |
|
1087 |
] |
|
1088 |
] |
|
1089 |
]. |
|
1090 |
items := items deepCopy. |
|
1091 |
items do:[:each | |
|
1092 |
each replaceAll:replNext with:#FindNext. |
|
1093 |
each replaceAll:replPrev with:#FindPrev. |
|
1094 |
each replaceAny:#(FindNextClass FindPrevClass |
|
1095 |
FindNextSelector FindPrevSelector |
|
1096 |
FindNextSnapshot FindPrevSnapshot |
|
1097 |
FindNextString FindPrevString) |
|
1098 |
with:nil. |
|
1099 |
]. |
|
1100 |
||
1101 |
^ PopUpMenu itemList:items resources:resources. |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
1102 |
]. |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
1103 |
|
1670
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1104 |
items := #( |
7360 | 1105 |
('Apply' doApply Accept) |
1106 |
('Apply to End' doApplyRest ) |
|
1107 |
('Apply from Begin' doApplyFromBeginning ) |
|
1108 |
('Apply for Class to End' doApplyClassRest ) |
|
1109 |
('Apply for Class from Begin' doApplyClassFromBeginning ) |
|
1110 |
('Apply All' doApplyAll ) |
|
1111 |
('-' ) |
|
1112 |
('Delete' doDelete Delete) |
|
1113 |
('Delete to End' doDeleteRest ) |
|
1114 |
('Delete for Class to End' doDeleteClassRest ) |
|
1115 |
('Delete for Class from Begin' doDeleteClassFromBeginning ) |
|
1116 |
). |
|
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1117 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1118 |
(self hasSelection and:[self hasSingleSelection not]) ifTrue:[ |
7360 | 1119 |
items := items , |
1120 |
#( |
|
1121 |
('Delete All for Classes' doDeleteClassAll ) |
|
1122 |
('Delete All for Classes & their Private Classes' doDeleteClassAndPrivateClassesAll ) |
|
1123 |
). |
|
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1124 |
] ifFalse:[ |
7360 | 1125 |
items := items , |
1126 |
#( |
|
1127 |
('Delete All for Class' doDeleteClassAll ) |
|
1128 |
('Delete All for Class & its Private Classes' doDeleteClassAndPrivateClassesAll ) |
|
1129 |
). |
|
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1130 |
]. |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1131 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1132 |
items := items , |
7360 | 1133 |
#( |
1134 |
('-' ) |
|
1135 |
('Compress' doCompress ) |
|
1136 |
('Compress for Class' doCompressClass ) |
|
1137 |
('Compare and Compress' doCompareAndCompress ) |
|
1138 |
('-' ) |
|
1139 |
('Compare with current Version' doCompare ) |
|
1140 |
('Browse Class' doBrowse ) |
|
1141 |
('-' ) |
|
1142 |
('Make Change a Patch' doMakePatch ) |
|
1143 |
). |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1144 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1145 |
editingClassSource ifFalse:[ |
7360 | 1146 |
items := items , #( |
1147 |
('Fileout & Delete All for Class' doFileoutAndDeleteClassAll ) |
|
1148 |
('CheckIn & Delete All for Class' doCheckinAndDeleteClassAll ) |
|
1149 |
) |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1150 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1151 |
|
1670
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1152 |
items := items , #( |
7360 | 1153 |
('-' ) |
1154 |
('Save in...' doSave ) |
|
1155 |
('Save to End In...' doSaveRest ) |
|
1156 |
('Save for Class to End In...' doSaveClassRest ) |
|
1157 |
('Save all for Class In...' doSaveClassAll ) |
|
1158 |
('-' ) |
|
1159 |
). |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1160 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1161 |
editingClassSource ifTrue:[ |
7360 | 1162 |
items := items , #( |
1163 |
('Writeback ClassFile' doWriteBack ) |
|
1164 |
) |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1165 |
] ifFalse:[ |
7360 | 1166 |
items := items , #( |
1167 |
('Writeback ChangeFile' doWriteBack ) |
|
1168 |
) |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1169 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1170 |
|
1833
c9b1a30b326d
moved update item to the end
Claus Gittinger <cg@exept.de>
parents:
1788
diff
changeset
|
1171 |
items := items , #( |
7360 | 1172 |
('-' ) |
1173 |
('Update' doUpdate ) |
|
1174 |
). |
|
1670
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1175 |
|
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1176 |
m := PopUpMenu itemList:items resources:resources. |
202 | 1177 |
|
255 | 1178 |
"/ |
1179 |
"/ disable those that require a selected entry |
|
1180 |
"/ |
|
3202 | 1181 |
self hasSelection ifFalse:[ |
7360 | 1182 |
m disableAll:#(doApply doApplyClassRest doApplyRest doDelete doDeleteRest doDeleteClassRest |
1183 |
doDeleteClassFromBeginning doDeleteClassAll doDeleteClassAndPrivateClassesAll |
|
1184 |
doCompare doCompressClass doMakePatch doSaveChangeInFile doMakePermanent |
|
1185 |
doSave doSaveRest doSaveClassAll doSaveClassRest doBrowse |
|
1186 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll) |
|
1368 | 1187 |
] ifTrue:[ |
7360 | 1188 |
sel := self theSingleSelection. |
1189 |
sel isNil ifTrue:[ |
|
1190 |
"/ multiple selections |
|
1191 |
m disableAll:#(doApplyClassRest doApplyRest doDeleteClassRest doDeleteRest |
|
1192 |
doDeleteClassFromBeginning |
|
1193 |
doCompressClass doCompare |
|
1194 |
doSaveClassAll doSaveClassRest doSaveRest doBrowse |
|
1195 |
doFileoutAndDeleteClassAll) |
|
1196 |
] ifFalse:[ |
|
1197 |
(self classNameOfChange:sel) isNil ifTrue:[ |
|
1198 |
m disableAll:#(doApplyClassRest doDeleteClassRest |
|
1199 |
doDeleteClassFromBeginning doDeleteClassAll doDeleteClassAndPrivateClassesAll |
|
1200 |
doCompressClass doCompare doMakePatch |
|
1201 |
doSaveClassAll doSaveClassRest doBrowse |
|
1202 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll) |
|
1203 |
] |
|
1204 |
] |
|
255 | 1205 |
]. |
1206 |
||
1207 |
"/ |
|
1208 |
"/ disable those that do not make sense with autoUpdate |
|
1209 |
"/ ('cause this would be overwritten by next update operation) |
|
1210 |
"/ |
|
3202 | 1211 |
autoUpdate value ifTrue:[ |
7360 | 1212 |
m disableAll:#(doDelete doDeleteRest doDeleteClassRest doDeleteClassAll |
1213 |
doDeleteClassAndPrivateClassesAll doCompress |
|
1214 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll |
|
1215 |
doWriteBack) |
|
202 | 1216 |
]. |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1217 |
readOnly == true ifTrue:[ |
7360 | 1218 |
m disableAll:#(doDelete doDeleteRest doDeleteClassRest doDeleteClassAll |
1219 |
doDeleteClassAndPrivateClassesAll doCompress |
|
1220 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll |
|
1221 |
doWriteBack doSaveBack doUpdate |
|
1222 |
doApplyAll doApplyRest) |
|
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1223 |
]. |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1224 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1225 |
self hasSelection ifTrue:[ |
7360 | 1226 |
m disable:#doApplyAll |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1227 |
]. |
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1228 |
|
202 | 1229 |
^ m |
1230 |
||
7360 | 1231 |
"Modified: / 06-09-1995 / 17:14:22 / claus" |
1232 |
"Modified: / 06-10-2006 / 11:17:06 / cg" |
|
202 | 1233 |
! |
1234 |
||
2114 | 1235 |
destroy |
1236 |
"destroy the receiver; make certain, that boxes are destroyed too" |
|
1237 |
||
1238 |
Processor removeTimedBlock:checkBlock. |
|
1239 |
ObjectMemory removeDependent:self. |
|
1240 |
super destroy |
|
1241 |
! |
|
1242 |
||
202 | 1243 |
focusSequence |
1244 |
^ Array with:changeListView with:codeView |
|
1245 |
! |
|
1246 |
||
1247 |
initialize |
|
3202 | 1248 |
|panel v upperFrame buttonPanel menuPanel mH |
4487 | 1249 |
checkBox oldStyle codeViewBox lbl| |
3202 | 1250 |
|
3211 | 1251 |
"/ oldStyle := true. |
3202 | 1252 |
oldStyle := false. |
202 | 1253 |
|
1254 |
super initialize. |
|
1255 |
||
5702 | 1256 |
changeFileName := ObjectMemory nameForChanges. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
1257 |
encodingIfKnown := nil. |
3534 | 1258 |
autoCompare := (DefaultAutoCompare ? false) asValue. |
3202 | 1259 |
autoCompare onChangeSend:#autoCompareChanged to:self. |
1260 |
autoUpdate := false asValue. |
|
6216 | 1261 |
autoloadAsRequired := false asValue. |
2343 | 1262 |
applyInOriginalNameSpace := true asValue. |
6288 | 1263 |
applyInOriginalNameSpace |
6357 | 1264 |
onChangeEvaluate:[ |
1265 |
autoCompare value ifTrue:[ |
|
1266 |
self doUpdate |
|
1267 |
]. |
|
1268 |
]. |
|
4897 | 1269 |
updateChangeSet := true "false" asValue. |
221 | 1270 |
|
1099
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1271 |
" |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1272 |
checkBlock is executed by the Processor. |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1273 |
We use #pushEvent: to perform the update |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1274 |
in our windowgroups process. |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1275 |
" |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1276 |
checkBlock := [self pushEvent:#checkIfFileHasChanged]. |
202 | 1277 |
|
3202 | 1278 |
oldStyle ifFalse:[ |
6357 | 1279 |
menuPanel := MenuPanel in:self. |
1280 |
"/ menuPanel level:1. |
|
1281 |
menuPanel verticalLayout:false. |
|
1282 |
menuPanel receiver:self. |
|
1283 |
menuPanel menu:(self pullDownMenu). |
|
1284 |
||
1285 |
mH := menuPanel preferredExtent y. |
|
1286 |
menuPanel origin:(0.0 @ 0.0) corner:(1.0 @ (mH)). |
|
1287 |
mH := mH + 1. |
|
3202 | 1288 |
] ifTrue:[ |
6357 | 1289 |
mH := 0.0 |
3202 | 1290 |
]. |
1291 |
||
1292 |
panel := VariableVerticalPanel origin:(0.0 @ mH) |
|
6357 | 1293 |
corner:(1.0 @ 1.0) |
1294 |
borderWidth:0 |
|
1295 |
in:self. |
|
202 | 1296 |
|
3202 | 1297 |
upperFrame := panel. |
1298 |
oldStyle ifTrue:[ |
|
6357 | 1299 |
upperFrame := VariableHorizontalPanel origin:(0.0 @ 0.0) corner:(1.0 @ 0.3) in:panel. |
3202 | 1300 |
]. |
202 | 1301 |
|
1302 |
v := HVScrollableView for:SelectionInListView miniScrollerH:true in:upperFrame. |
|
3202 | 1303 |
oldStyle ifTrue:[ |
6357 | 1304 |
v origin:(0.0 @ 0.0) corner:(0.75 @ 1.0). |
3202 | 1305 |
] ifFalse:[ |
6357 | 1306 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.3). |
3202 | 1307 |
]. |
3090 | 1308 |
|
202 | 1309 |
changeListView := v scrolledView. |
1310 |
changeListView delegate:self. |
|
1311 |
changeListView menuHolder:self; menuPerformer:self; menuMessage:#changeListMenu. |
|
1471 | 1312 |
changeListView doubleClickAction:[:line | self doubleClickOnChange:line]. |
3211 | 1313 |
oldStyle ifFalse:[ |
6357 | 1314 |
changeListView multipleSelectOk:true. |
3211 | 1315 |
]. |
202 | 1316 |
|
3202 | 1317 |
oldStyle ifTrue:[ |
6357 | 1318 |
buttonPanel := VerticalPanelView in:upperFrame. |
1319 |
buttonPanel origin:(0.75 @ 0.0) corner:(1.0 @ 1.0). |
|
1320 |
buttonPanel verticalLayout:#topSpace; horizontalLayout:#leftSpace. |
|
1321 |
||
1322 |
checkBox := CheckBox new model:autoCompare. |
|
1323 |
checkBox label:(resources string:'Auto Compare'). |
|
1324 |
checkBox action:[:val | autoCompare value:val]. |
|
1325 |
buttonPanel addSubView:checkBox. |
|
1326 |
||
1327 |
checkBox := CheckBox new model:autoUpdate. |
|
1328 |
checkBox label:(resources string:'Auto Update'). |
|
1329 |
checkBox action:[:val | autoUpdate value:val]. |
|
1330 |
buttonPanel addSubView:checkBox. |
|
1331 |
||
1332 |
checkBox := CheckBox new. |
|
1333 |
checkBox label:(resources stringWithCRs:'Apply in original NameSpace'). |
|
1334 |
checkBox model:applyInOriginalNameSpace. |
|
1335 |
buttonPanel addSubView:checkBox. |
|
3202 | 1336 |
]. |
2301 | 1337 |
|
3090 | 1338 |
"/ protectExistingMethods := CheckBox new. |
1339 |
"/ protectExistingMethods label:(resources string:'Protect existing code' withCRs). |
|
1340 |
"/ protectExistingMethods model:protectExistingMethods. |
|
1341 |
"/ buttonPanel addSubView:protectExistingMethods. |
|
1342 |
||
4487 | 1343 |
codeViewBox := View in:panel. |
1344 |
codeViewBox origin:(0.0 @ 0.3) corner:(1.0 @ 1.0). |
|
1345 |
||
1346 |
v := HVScrollableView for:CodeView miniScrollerH:true miniScrollerV:false in:codeViewBox. |
|
1347 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
202 | 1348 |
codeView := v scrolledView. |
1996 | 1349 |
codeView readOnly:true. |
202 | 1350 |
|
4487 | 1351 |
diffViewBox := View in:codeViewBox. |
1352 |
diffViewBox origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
1353 |
||
1354 |
lbl := Label label:'Current' in:diffViewBox. |
|
1355 |
lbl layout:(LayoutFrame |
|
6357 | 1356 |
leftFraction:0.0 offset:0 |
1357 |
rightFraction:0.5 offset:0 |
|
1358 |
topFraction:0.0 offset:0 |
|
1359 |
bottomFraction:0.0 offset:20). |
|
4487 | 1360 |
lbl := Label label:'Change' in:diffViewBox. |
1361 |
lbl layout:(LayoutFrame |
|
6357 | 1362 |
leftFraction:0.5 offset:0 |
1363 |
rightFraction:1.0 offset:0 |
|
1364 |
topFraction:0.0 offset:0 |
|
1365 |
bottomFraction:0.0 offset:20). |
|
4487 | 1366 |
|
1367 |
"/ diffView := DiffTextView in:diffViewBox. |
|
1368 |
"/ diffView layout:(LayoutFrame |
|
1369 |
"/ leftFraction:0.0 offset:0 |
|
1370 |
"/ rightFraction:1.0 offset:0 |
|
1371 |
"/ topFraction:0.0 offset:20 |
|
1372 |
"/ bottomFraction:1.0 offset:0). |
|
1373 |
||
1374 |
v := HVScrollableView for:DiffTextView miniScrollerH:true miniScrollerV:false in:diffViewBox. |
|
1375 |
v layout:(LayoutFrame |
|
6357 | 1376 |
leftFraction:0.0 offset:0 |
1377 |
rightFraction:1.0 offset:0 |
|
1378 |
topFraction:0.0 offset:20 |
|
1379 |
bottomFraction:1.0 offset:0). |
|
4487 | 1380 |
diffView := v scrolledView. |
1381 |
||
1382 |
self showingDiffs value ifFalse:[ |
|
6357 | 1383 |
self makeDiffViewInvisible |
4487 | 1384 |
]. |
1385 |
||
202 | 1386 |
anyChanges := false. |
1387 |
ObjectMemory addDependent:self. "to get shutdown-update" |
|
1388 |
||
1389 |
tabSpec := TabulatorSpecification new. |
|
1390 |
tabSpec unit:#inch. |
|
1391 |
tabSpec positions:#(-1 0 5 8.5 ). |
|
1392 |
" +/- cls>>sel type info" |
|
1393 |
tabSpec align: #(#left #left #left #left). |
|
1394 |
||
1471 | 1395 |
"Modified: / 27.3.1997 / 11:07:07 / stefan" |
3297 | 1396 |
"Modified: / 11.10.2001 / 21:20:48 / cg" |
202 | 1397 |
! |
1398 |
||
1246
9ed3722bd2f2
setup in #postRealize instead of #realize
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
1399 |
postRealize |
3534 | 1400 |
self setupTabSpec. |
202 | 1401 |
self readChangesFileInBackground:true. |
1402 |
self setChangeList. |
|
1403 |
changeListView action:[:lineNr | self changeSelection:lineNr]. |
|
1404 |
Processor addTimedBlock:checkBlock afterSeconds:5. |
|
1246
9ed3722bd2f2
setup in #postRealize instead of #realize
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
1405 |
|
9ed3722bd2f2
setup in #postRealize instead of #realize
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
1406 |
"Created: 24.7.1997 / 18:06:12 / cg" |
202 | 1407 |
! |
1408 |
||
3202 | 1409 |
pullDownMenu |
1410 |
"return the top (pullDown) menu" |
|
1411 |
||
1412 |
<resource: #programMenu> |
|
1413 |
||
3330 | 1414 |
^ self menuFromSpec:self class menuSpec. |
1415 |
||
1416 |
"/ |m| |
|
1417 |
"/ |
|
1418 |
"/ m := self class menuSpec. |
|
1419 |
"/ m := m decodeAsLiteralArray. |
|
1420 |
"/ m receiver:self. |
|
1421 |
"/ m findGuiResourcesIn:self. |
|
1422 |
"/ ^ m. |
|
3202 | 1423 |
! |
1424 |
||
3534 | 1425 |
setupTabSpec |
1426 |
autoCompare value ifTrue:[ |
|
6288 | 1427 |
tabSpec positions:#(0 0.15 5 8.5 ). |
3534 | 1428 |
] ifFalse:[ |
6288 | 1429 |
"/ |
1430 |
"/ set tabs to hide compare-column |
|
1431 |
"/ |
|
1432 |
tabSpec positions:#(-1 0 5 8.5 ). |
|
3534 | 1433 |
] |
1434 |
! |
|
1435 |
||
627 | 1436 |
update:what with:aParameter from:changedObject |
202 | 1437 |
|box| |
1438 |
||
1439 |
(what == #aboutToExit) ifTrue:[ |
|
6639 | 1440 |
" |
1441 |
smalltalk is about to shut down - |
|
1442 |
- if change list was modified, ask user and save if requested. |
|
1443 |
" |
|
1444 |
anyChanges ifTrue:[ |
|
1445 |
self raiseDeiconified. |
|
1446 |
||
1447 |
box := YesNoBox new. |
|
1448 |
box title:('The modified changelist has not been written back to the change file.\\Write change file before exiting ?') withCRs. |
|
1449 |
box okText:(resources string:'Write') noText:(resources string:'Don''t write'). |
|
1450 |
box yesAction:[self writeBackChanges] |
|
1451 |
noAction:[]. |
|
1452 |
box showAtPointer. |
|
1453 |
box destroy |
|
1454 |
]. |
|
1455 |
^ self |
|
202 | 1456 |
]. |
1457 |
super update:what |
|
627 | 1458 |
|
2353
707dd9391c02
Consistent use of 'update' and 'write' in the user interface
Stefan Vogel <sv@exept.de>
parents:
2343
diff
changeset
|
1459 |
"Created: / 15.6.1996 / 15:26:30 / cg" |
707dd9391c02
Consistent use of 'update' and 'write' in the user interface
Stefan Vogel <sv@exept.de>
parents:
2343
diff
changeset
|
1460 |
"Modified: / 7.1.1997 / 23:03:47 / cg" |
707dd9391c02
Consistent use of 'update' and 'write' in the user interface
Stefan Vogel <sv@exept.de>
parents:
2343
diff
changeset
|
1461 |
"Modified: / 24.8.1999 / 09:45:06 / stefan" |
202 | 1462 |
! ! |
1463 |
||
3202 | 1464 |
!ChangesBrowser methodsFor:'menu actions'! |
1465 |
||
1466 |
menuExit |
|
3204 | 1467 |
self closeRequest |
3202 | 1468 |
! |
1469 |
||
1470 |
openAboutThisApplication |
|
1471 |
"opens an about box for this application." |
|
1472 |
||
7115 | 1473 |
Dialog aboutClass:self class. |
1474 |
||
1475 |
"Modified: / 12-09-2006 / 17:20:22 / cg" |
|
3202 | 1476 |
! |
1477 |
||
1478 |
openHTMLDocument:relativeDocPath |
|
1479 |
HTMLDocumentView openFullOnDocumentationFile:relativeDocPath |
|
1480 |
! |
|
1481 |
||
1482 |
showAboutSTX |
|
1483 |
ToolApplicationModel openAboutSTX |
|
1484 |
! ! |
|
1485 |
||
202 | 1486 |
!ChangesBrowser methodsFor:'private'! |
1487 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1488 |
autoSelect:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1489 |
"select a change" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1490 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1491 |
self class autoSelectNext ifTrue:[ |
6288 | 1492 |
(changeNr <= self numberOfChanges) ifTrue:[ |
1493 |
changeListView setSelection:changeNr. |
|
1494 |
self changeSelection:changeNr. |
|
1495 |
^ self |
|
1496 |
] |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1497 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1498 |
self clearCodeView. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1499 |
changeListView setSelection:nil. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1500 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1501 |
"Modified: / 18.5.1998 / 14:26:43 / cg" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1502 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1503 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1504 |
autoSelectLast |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1505 |
"select the last change" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1506 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1507 |
self autoSelect:(self numberOfChanges) |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1508 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1509 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1510 |
autoSelectOrEnd:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1511 |
"select the next change or the last" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1512 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1513 |
|last| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1514 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1515 |
last := self numberOfChanges. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1516 |
changeNr < last ifTrue:[ |
6288 | 1517 |
self autoSelect:changeNr |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1518 |
] ifFalse:[ |
6288 | 1519 |
last == 0 ifTrue:[ |
1520 |
last := nil |
|
1521 |
]. |
|
1522 |
changeListView setSelection:last . |
|
1523 |
self changeSelection:last. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1524 |
] |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1525 |
|
3406
8fe22b36fbc2
fixed autoselectNext if list is empty
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
1526 |
"Modified: / 13.11.2001 / 13:00:45 / cg" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1527 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1528 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1529 |
checkClassIsLoaded:aClass |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1530 |
"check for and warn if a class is unloaded (helper for compare-change)" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1531 |
|
6162
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
1532 |
|cls answer| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1533 |
|
3359
2cc7eff866e4
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
3341
diff
changeset
|
1534 |
cls := aClass theNonMetaclass. |
5825 | 1535 |
cls isLoaded ifTrue:[ |
6357 | 1536 |
^ true. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1537 |
]. |
5825 | 1538 |
|
6216 | 1539 |
autoloadAsRequired value == true ifTrue:[ |
6357 | 1540 |
answer := true |
6216 | 1541 |
] ifFalse:[ |
6357 | 1542 |
answer := (self confirmWithCancel:(resources |
1543 |
stringWithCRs:'%1 is an autoloaded class.\I can only compare the methods source if its loaded first.\\Shall the class be loaded now ?' |
|
1544 |
with:cls name allBold)). |
|
6216 | 1545 |
]. |
6162
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
1546 |
|
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
1547 |
answer == true ifTrue:[ |
6357 | 1548 |
Autoload autoloadFailedSignal handle:[:ex | |
1549 |
AbortOperationRequest raise. |
|
1550 |
^ false |
|
1551 |
] do:[ |
|
1552 |
^ cls autoload isLoaded |
|
1553 |
] |
|
5825 | 1554 |
]. |
6162
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
1555 |
|
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
1556 |
answer isNil ifTrue:[ |
6357 | 1557 |
"cancel the operation" |
1558 |
AbortAllOperationRequest raiseRequest. |
|
1559 |
^ false. |
|
6162
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
1560 |
]. |
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
1561 |
|
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
1562 |
"cancel operation for this change, (but possibly continue with others)" |
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
1563 |
AbortOperationRequest raiseRequest. |
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
1564 |
^ false. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1565 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1566 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1567 |
clearCodeView |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1568 |
"clear the (lower) code view." |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1569 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1570 |
self unselect "changeListView deselect". |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1571 |
codeView contents:nil. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1572 |
changeNrShown := nil |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1573 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1574 |
|
3203 | 1575 |
isChangeSetBrowser |
1576 |
^ false |
|
1577 |
! |
|
1578 |
||
4487 | 1579 |
makeDiffViewInvisible |
1580 |
diffViewBox lower |
|
1581 |
! |
|
1582 |
||
1583 |
makeDiffViewVisible |
|
1584 |
diffViewBox raise |
|
1585 |
! |
|
1586 |
||
3472 | 1587 |
nameSpaceForApply |
1588 |
applyInOriginalNameSpace value ifFalse:[ |
|
6288 | 1589 |
^ enforcedNameSpace ? Class nameSpaceQuerySignal query. |
3472 | 1590 |
]. |
1591 |
^ Smalltalk. |
|
1592 |
! |
|
1593 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1594 |
newLabel:how |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1595 |
|l| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1596 |
|
7507 | 1597 |
l := self class defaultLabel. |
1598 |
(changeFileName notNil and:[changeFileName ~= 'changes']) ifTrue:[ |
|
1599 |
l := l , ': ', changeFileName |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1600 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1601 |
l := l , ' ' , how. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1602 |
self label:l |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1603 |
|
7507 | 1604 |
"Created: / 08-09-1995 / 19:32:04 / claus" |
1605 |
"Modified: / 12-11-2006 / 16:23:53 / cg" |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1606 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1607 |
|
4857 | 1608 |
oldSourceForParseTree:parseTree |
1609 |
|selector thisClass method superClass thisClassSym ownerClass receiver classGlobalNode| |
|
1610 |
||
6288 | 1611 |
(parseTree isNil |
1612 |
or:[parseTree == #Error |
|
4857 | 1613 |
or:[ parseTree isMessage not ]]) ifTrue:[ |
6614 | 1614 |
^ nil |
4857 | 1615 |
]. |
1616 |
||
1617 |
selector := parseTree selector. |
|
1618 |
receiver := parseTree receiver. |
|
1619 |
||
1620 |
selector == #'removeSelector:' ifTrue:[ |
|
6614 | 1621 |
thisClass := receiver evaluate. |
1622 |
thisClass isBehavior ifTrue:[ |
|
1623 |
thisClass isLoaded ifTrue:[ |
|
1624 |
selector := (parseTree arg1 evaluate). |
|
1625 |
(thisClass includesSelector:selector) ifTrue:[ |
|
1626 |
^ (thisClass compiledMethodAt:selector) source. |
|
1627 |
] |
|
1628 |
] ifFalse:[ |
|
1629 |
^ 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
1630 |
] |
|
1631 |
] ifFalse:[ |
|
1632 |
^ 'Cannot compare this change (class not present)'. |
|
1633 |
]. |
|
4857 | 1634 |
]. |
1635 |
selector == #'comment:' ifTrue:[ |
|
6614 | 1636 |
thisClass := receiver evaluate. |
1637 |
thisClass isBehavior ifTrue:[ |
|
1638 |
thisClass isLoaded ifTrue:[ |
|
1639 |
^ thisClass name , ' comment: ' , thisClass comment storeString. |
|
1640 |
] ifFalse:[ |
|
1641 |
^ 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
1642 |
] |
|
1643 |
] ifFalse:[ |
|
1644 |
^ 'Cannot compare this change (class not present)'. |
|
1645 |
]. |
|
4857 | 1646 |
]. |
1647 |
||
1648 |
selector == #'category:' ifTrue:[ |
|
6614 | 1649 |
receiver isMessage ifTrue:[ |
1650 |
receiver selector == #compiledMethodAt: ifTrue:[ |
|
1651 |
classGlobalNode := receiver receiver. |
|
1652 |
(classGlobalNode isMessage and:[classGlobalNode selector == #class]) ifTrue:[ |
|
1653 |
classGlobalNode := classGlobalNode receiver |
|
1654 |
]. |
|
1655 |
classGlobalNode isUndeclared ifTrue:[ |
|
1656 |
^ 'Class does not exist.'. |
|
1657 |
]. |
|
1658 |
Error handle:[method := nil] do:[method := receiver evaluate]. |
|
1659 |
method isMethod ifTrue:[ |
|
1660 |
method category = parseTree arg1 evaluate ifFalse:[ |
|
1661 |
^ '(' , method class name , ' compiledMethodAt: ' , method selector storeString , ') category: ' , method category storeString. |
|
1662 |
] |
|
1663 |
] ifFalse:[ |
|
1664 |
^ 'There is no such method'. |
|
1665 |
] |
|
1666 |
] |
|
1667 |
] |
|
4857 | 1668 |
]. |
1669 |
||
1670 |
selector == #'instanceVariableNames:' ifTrue:[ |
|
6614 | 1671 |
receiver isMessage ifTrue:[ |
1672 |
receiver selector == #class ifTrue:[ |
|
1673 |
thisClass := receiver evaluate. |
|
1674 |
thisClass isBehavior ifTrue:[ |
|
1675 |
thisClass isLoaded ifTrue:[ |
|
4857 | 1676 |
"/ varsHere := thisClass instanceVariableString asCollectionOfWords. |
1677 |
"/ varsInChange := (parseTree arguments at:1) evaluate asCollectionOfWords. |
|
6614 | 1678 |
^ thisClass definition. |
1679 |
] ifFalse:[ |
|
1680 |
^ 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
1681 |
]. |
|
1682 |
] ifFalse:[ |
|
1683 |
^ 'Cannot compare this change (class not present)'. |
|
1684 |
] |
|
1685 |
]. |
|
1686 |
] |
|
4857 | 1687 |
]. |
1688 |
||
1689 |
(Class definitionSelectors includes:selector) |
|
6288 | 1690 |
"/ selector == #'subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:' |
4857 | 1691 |
ifTrue:[ |
6614 | 1692 |
"/ Class nameSpaceQuerySignal |
1693 |
"/ answer:(self nameSpaceForApply) |
|
1694 |
"/ do:[ |
|
1695 |
"/ superClass := receiver evaluate. |
|
1696 |
"/ ]. |
|
1697 |
"/ superClass isBehavior ifFalse:[ |
|
1698 |
"/ self nameSpaceForApply classNamed:receiver name |
|
1699 |
"/ ]. |
|
1700 |
"/ superClass isBehavior ifFalse:[ |
|
1701 |
"/ |rest matchingKeys superClassName| |
|
1702 |
"/ |
|
1703 |
"/ rest := '::' , receiver name. |
|
1704 |
"/ matchingKeys := Smalltalk keys select:[:nm | nm endsWith:rest]. |
|
1705 |
"/ superClassName := Dialog choose:'Which Class ?' fromList:matchingKeys lines:10. |
|
1706 |
"/ superClassName notEmptyOrNil ifTrue:[ |
|
1707 |
"/ superClass := Smalltalk at:superClassName asSymbol. |
|
1708 |
"/ ]. |
|
1709 |
"/ ]. |
|
1710 |
"/ superClass isBehavior ifFalse:[ |
|
1711 |
"/ ^ 'Cannot compare this change\\(no such superclass).' withCRs. |
|
1712 |
"/ ]. |
|
1713 |
"/ superClass isLoaded ifFalse:[ |
|
1714 |
"/ ^ 'Cannot compare this change\\(superclass not loaded).' withCRs. |
|
1715 |
"/ ]. |
|
1716 |
||
1717 |
thisClassSym := (parseTree arguments at:1) evaluate. |
|
1718 |
||
1719 |
(selector endsWith:':privateIn:') ifTrue:[ |
|
1720 |
ownerClass := (parseTree arguments at:5). |
|
1721 |
ownerClass isUndeclared ifFalse:[ |
|
1722 |
ownerClass := ownerClass evaluate. |
|
1723 |
] ifTrue:[ |
|
1724 |
ownerClass := nil. |
|
1725 |
]. |
|
1726 |
ownerClass isNil ifTrue:[ |
|
1727 |
^ 'Cannot compare this change\\(owning class is not loaded).' withCRs. |
|
1728 |
]. |
|
1729 |
thisClass := ownerClass privateClassesAt:thisClassSym. |
|
1730 |
] ifFalse:[ |
|
1731 |
thisClass := (self nameSpaceForApply) at:thisClassSym ifAbsent:nil. |
|
1732 |
]. |
|
1733 |
thisClass notNil ifTrue:[ |
|
1734 |
thisClass isLoaded ifFalse:[ |
|
1735 |
^ 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
1736 |
] ifTrue:[ |
|
1737 |
^ thisClass definition. |
|
1738 |
] |
|
1739 |
] |
|
4857 | 1740 |
]. |
1741 |
||
1742 |
^ nil. |
|
1743 |
! |
|
1744 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1745 |
queryCloseText |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1746 |
"made this a method for easy redefinition in subclasses" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1747 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1748 |
^ 'Quit without updating changeFile ?' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1749 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1750 |
|
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
1751 |
selectedClassNames |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
1752 |
|classes| |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
1753 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
1754 |
classes := Set new. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
1755 |
self withSelectedChangesDo:[:changeNr | |
6288 | 1756 |
| classNameToCompress | |
1757 |
||
1758 |
classNameToCompress := self classNameOfChange:changeNr. |
|
1759 |
classNameToCompress notNil ifTrue:[ |
|
1760 |
classes add:classNameToCompress. |
|
1761 |
] |
|
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
1762 |
]. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
1763 |
^ classes |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
1764 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
1765 |
"Created: / 19.11.2001 / 21:54:59 / cg" |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
1766 |
! |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
1767 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1768 |
setChangeList |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1769 |
"extract type-information from changes and stuff into top selection |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1770 |
view" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1771 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1772 |
changeListView setList:changeHeaderLines expandTabs:false redraw:false. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1773 |
changeListView invalidate. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1774 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1775 |
"/ changeListView deselect. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1776 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1777 |
"Modified: / 18.5.1998 / 14:29:10 / cg" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1778 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1779 |
|
3211 | 1780 |
setSingleSelection:changeNr |
1781 |
changeListView multipleSelectOk ifFalse:[ |
|
6288 | 1782 |
changeListView setSelection:changeNr. |
3211 | 1783 |
] ifTrue:[ |
6288 | 1784 |
changeListView setSelection:(Array with:changeNr). |
3211 | 1785 |
]. |
1786 |
! |
|
1787 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1788 |
showNotFound |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1789 |
|savedCursor| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1790 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1791 |
savedCursor := cursor. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1792 |
[ |
6288 | 1793 |
self cursor:(Cursor cross). |
1794 |
self beep. |
|
1795 |
Delay waitForMilliseconds:300. |
|
3597
2e7fc0ae28c9
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
1796 |
] ensure:[ |
6288 | 1797 |
self cursor:savedCursor |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1798 |
] |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1799 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1800 |
"Modified: / 29.4.1999 / 22:36:54 / cg" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1801 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1802 |
|
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1803 |
sourceOfChange:changeNr |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1804 |
|aStream sawExcla chunk| |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1805 |
|
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1806 |
aStream := self streamForChange:changeNr. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1807 |
aStream isNil ifTrue:[ |
6288 | 1808 |
^ nil |
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1809 |
]. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1810 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1811 |
chunk := aStream nextChunk. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1812 |
sawExcla ifTrue:[ |
6288 | 1813 |
chunk := aStream nextChunk |
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1814 |
]. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1815 |
aStream close. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1816 |
^ chunk |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1817 |
! |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1818 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1819 |
unselect |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1820 |
"common unselect" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1821 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1822 |
changeListView setSelection:nil. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1823 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1824 |
"Modified: 25.5.1996 / 13:02:49 / cg" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1825 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1826 |
|
3211 | 1827 |
withSelectedChangesDo:aBlock |
1828 |
"just a helper, check for a selected change and evaluate aBlock |
|
1829 |
with busy cursor" |
|
1830 |
||
1831 |
self withSelectedChangesInOrder:nil do:aBlock |
|
1832 |
! |
|
1833 |
||
1834 |
withSelectedChangesInOrder:order do:aBlock |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1835 |
"just a helper, check for a selected change and evaluate aBlock |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1836 |
with busy cursor" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1837 |
|
3211 | 1838 |
|changeNrSelection| |
1839 |
||
1840 |
changeNrSelection := changeListView selection. |
|
1841 |
changeListView multipleSelectOk ifFalse:[ |
|
6288 | 1842 |
changeNrSelection notNil ifTrue:[ |
1843 |
self withExecuteCursorDo:[ |
|
1844 |
aBlock value:changeNrSelection |
|
1845 |
] |
|
1846 |
] |
|
3211 | 1847 |
] ifTrue:[ |
6288 | 1848 |
changeNrSelection size > 0 ifTrue:[ |
1849 |
self withExecuteCursorDo:[ |
|
1850 |
|changeNumbers| |
|
1851 |
||
1852 |
changeNumbers := changeNrSelection copy sort. |
|
1853 |
order == #reverse ifTrue:[ |
|
1854 |
changeNumbers reverse |
|
1855 |
]. |
|
1856 |
changeNumbers do:aBlock |
|
1857 |
] |
|
1858 |
] |
|
3211 | 1859 |
]. |
1860 |
! |
|
1861 |
||
1862 |
withSelectedChangesReverseDo:aBlock |
|
1863 |
"just a helper, check for a selected change and evaluate aBlock |
|
1864 |
with busy cursor" |
|
1865 |
||
1866 |
self withSelectedChangesInOrder:#reverse do:aBlock |
|
3668 | 1867 |
! |
1868 |
||
1869 |
withSingleSelectedChangeDo:aBlock |
|
1870 |
"just a helper, check for a single selection, and evaluate aBlock |
|
1871 |
with busy cursor" |
|
1872 |
||
1873 |
self theSingleSelection isNil ifTrue:[ |
|
6288 | 1874 |
^ self information:'Only possible if a single change is selected.'. |
3668 | 1875 |
]. |
1876 |
||
1877 |
self withSelectedChangesInOrder:nil do:aBlock |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1878 |
! ! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1879 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1880 |
!ChangesBrowser methodsFor:'private-change access'! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1881 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1882 |
changeIsFollowupMethodChange:changeNr |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1883 |
"return true, if a change is a followup change (i.e. a followup change |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1884 |
in a bunch of methodsFor-changes)" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1885 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1886 |
^ changeIsFollowupMethodChange at:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1887 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1888 |
"Created: / 6.2.1998 / 13:03:39 / cg" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1889 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1890 |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1891 |
changeIsSnapShotInfo:changeNr |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1892 |
"return true, if a change is a snapShot info chunk" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1893 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1894 |
|words chunk| |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1895 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1896 |
(self classNameOfChange:changeNr) isNil ifTrue:[ |
6288 | 1897 |
" |
1898 |
get the chunk |
|
1899 |
" |
|
1900 |
chunk := changeChunks at:changeNr. |
|
1901 |
"mhmh - empty ??" |
|
1902 |
chunk notNil ifTrue:[ |
|
1903 |
(chunk startsWith:'''---') ifTrue:[ |
|
1904 |
words := chunk asCollectionOfWords. |
|
1905 |
words size > 2 ifTrue:[ |
|
1906 |
(words at:2) = 'snapshot' ifTrue:[ |
|
1907 |
^ true |
|
1908 |
]. |
|
1909 |
]. |
|
1910 |
]. |
|
1911 |
]. |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1912 |
]. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1913 |
^ false |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1914 |
! |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1915 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1916 |
classNameOfChange:changeNr |
6288 | 1917 |
"return the classname of a change |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1918 |
(for classChanges (i.e. xxx class), the non-metaClassName (i.e. xxx) is returned)" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1919 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1920 |
|name| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1921 |
|
3364 | 1922 |
name := self realClassNameOfChange:changeNr. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1923 |
name isNil ifTrue:[^ nil]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1924 |
(name endsWith:' class') ifTrue:[ |
6288 | 1925 |
name := name copyWithoutLast:6 |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1926 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1927 |
^ name |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1928 |
|
3364 | 1929 |
"Modified: / 5.11.2001 / 18:10:25 / cg" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1930 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1931 |
|
3202 | 1932 |
extractSelectorOfMethodChange:changeNr |
1933 |
"return a method-changes selector, or nil if its not a methodChange" |
|
1934 |
||
1935 |
|source parser sel chunk aParseTree | |
|
1936 |
||
1937 |
source := self sourceOfMethodChange:changeNr. |
|
1938 |
source isNil ifTrue:[ |
|
6288 | 1939 |
(self classNameOfChange:changeNr) notNil ifTrue:[ |
1940 |
chunk := changeChunks at:changeNr. |
|
1941 |
chunk isNil ifTrue:[^ nil]. "mhmh - empty" |
|
1942 |
||
1943 |
aParseTree := Parser parseExpression:chunk. |
|
1944 |
(aParseTree isNil |
|
1945 |
or:[aParseTree == #Error |
|
1946 |
or:[aParseTree isMessage not]]) ifTrue:[ |
|
1947 |
^ nil "seems strange ... (could be a comment)" |
|
1948 |
]. |
|
1949 |
sel := aParseTree selector. |
|
1950 |
(#( |
|
1951 |
#'removeSelector:' |
|
1952 |
) includes:sel) ifTrue:[ |
|
1953 |
sel := aParseTree arguments at:1. |
|
1954 |
sel isConstant ifTrue:[ |
|
1955 |
sel := sel evaluate. |
|
1956 |
sel isSymbol ifTrue:[ |
|
1957 |
^ sel |
|
1958 |
] |
|
1959 |
] |
|
1960 |
] |
|
1961 |
]. |
|
1962 |
^ nil |
|
3202 | 1963 |
]. |
1964 |
||
1965 |
||
6288 | 1966 |
parser := Parser |
1967 |
parseMethodArgAndVarSpecification:source |
|
1968 |
in:nil |
|
1969 |
ignoreErrors:true |
|
1970 |
ignoreWarnings:true |
|
1971 |
parseBody:false. |
|
3202 | 1972 |
|
1973 |
(parser notNil and:[parser ~~ #Error]) ifTrue:[ |
|
6288 | 1974 |
sel := parser selector. |
3202 | 1975 |
]. |
1976 |
^ sel |
|
1977 |
||
1978 |
"Created: 24.11.1995 / 14:30:46 / cg" |
|
1979 |
"Modified: 5.9.1996 / 17:12:50 / cg" |
|
1980 |
! |
|
1981 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1982 |
fullClassNameOfChange:changeNr |
6288 | 1983 |
"return the full classname of a change |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
1984 |
(for classChanges (i.e. xxx class), a string ending in ' class' is returned." |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1985 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1986 |
|chunk aParseTree recTree sel name arg1Tree isMeta prevMethodDefNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1987 |
words changeStream fullParseTree ownerTree ownerName oldDollarSetting| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1988 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1989 |
changeNr isNil ifTrue:[^ nil]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1990 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1991 |
first look, if not already known |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1992 |
" |
5145 | 1993 |
name := changeClassNames at:changeNr. |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
1994 |
name notNil ifTrue:[ |
6288 | 1995 |
name == #nil ifTrue:[^ nil]. |
1996 |
^ name |
|
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
1997 |
]. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1998 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1999 |
prevMethodDefNr := changeNr. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2000 |
[changeIsFollowupMethodChange at:prevMethodDefNr] whileTrue:[ |
6288 | 2001 |
prevMethodDefNr := prevMethodDefNr - 1. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2002 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2003 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2004 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2005 |
get the chunk |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2006 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2007 |
chunk := changeChunks at:prevMethodDefNr. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2008 |
chunk isNil ifTrue:[^ nil]. "mhmh - empty" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2009 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2010 |
(chunk startsWith:'''---') ifTrue:[ |
6288 | 2011 |
words := chunk asCollectionOfWords. |
2012 |
words size > 2 ifTrue:[ |
|
2013 |
(words at:2) = 'checkin' ifTrue:[ |
|
2014 |
name := words at:3. |
|
2015 |
^ name |
|
2016 |
] |
|
2017 |
]. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2018 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2019 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2020 |
"/ fix it - otherwise, it cannot be parsed |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2021 |
(chunk endsWith:'primitiveDefinitions:') ifTrue:[ |
6288 | 2022 |
chunk := chunk , '''''' |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2023 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2024 |
(chunk endsWith:'primitiveFunctions:') ifTrue:[ |
6288 | 2025 |
chunk := chunk , '''''' |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2026 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2027 |
(chunk endsWith:'primitiveVariables:') ifTrue:[ |
6288 | 2028 |
chunk := chunk , '''''' |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2029 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2030 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2031 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2032 |
use parser to construct a parseTree |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2033 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2034 |
oldDollarSetting := Parser allowDollarInIdentifier. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2035 |
[ |
6288 | 2036 |
Parser allowDollarInIdentifier:true. |
5014 | 2037 |
"/ Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
2038 |
"/ do:[ |
|
6288 | 2039 |
aParseTree := Parser parseExpression:chunk. |
5014 | 2040 |
"/ ]. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2041 |
|
6288 | 2042 |
aParseTree == #Error ifTrue:[ |
2043 |
(chunk includesString:'comment') ifTrue:[ |
|
2044 |
"/ could be a comment ... |
|
2045 |
aParseTree := Parser parseExpression:chunk , ''''. |
|
2046 |
] |
|
2047 |
]. |
|
3597
2e7fc0ae28c9
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
2048 |
] ensure:[ |
6288 | 2049 |
Parser allowDollarInIdentifier:oldDollarSetting |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2050 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2051 |
(aParseTree isNil or:[aParseTree == #Error]) ifTrue:[ |
6288 | 2052 |
^ nil "seems strange ... (could be a comment)" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2053 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2054 |
aParseTree isMessage ifFalse:[ |
6288 | 2055 |
^ nil "very strange ... (whats that ?)" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2056 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2057 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2058 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2059 |
ask parser for selector |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2060 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2061 |
sel := aParseTree selector. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2062 |
recTree := aParseTree receiver. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2063 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2064 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2065 |
is it a method-change, methodRemove or comment-change ? |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2066 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2067 |
|
6288 | 2068 |
(#(#'methodsFor:' |
2069 |
#'privateMethodsFor:' |
|
2070 |
#'protectedMethodsFor:' |
|
2071 |
#'ignoredMethodsFor:' |
|
2072 |
#'publicMethodsFor:' |
|
2073 |
#'removeSelector:' |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2074 |
#'comment:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2075 |
#'primitiveDefinitions:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2076 |
#'primitiveFunctions:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2077 |
#'primitiveVariables:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2078 |
#'renameCategory:to:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2079 |
#'instanceVariableNames:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2080 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2081 |
#'methodsFor:stamp:' "/ Squeak support |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2082 |
#'commentStamp:prior:' "/ Squeak support |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2083 |
#'addClassVarName:' "/ Squeak support |
2527
afa639104477
some support for dolphin source files
Claus Gittinger <cg@exept.de>
parents:
2511
diff
changeset
|
2084 |
#methodsFor "/ Dolphin support |
3472 | 2085 |
#categoriesForClass "/ Dolphin support |
2086 |
#categoriesFor: "/ Dolphin support |
|
2606 | 2087 |
#methods "/ STV support |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2088 |
) includes:sel) ifTrue:[ |
6288 | 2089 |
" |
2090 |
yes, the className is the receiver |
|
2091 |
" |
|
2092 |
(recTree notNil and:[recTree ~~ #Error]) ifTrue:[ |
|
2093 |
isMeta := false. |
|
2094 |
recTree isUnaryMessage ifTrue:[ |
|
2095 |
(recTree selector ~~ #class) ifTrue:[^ nil]. |
|
2096 |
"id class methodsFor:..." |
|
2097 |
recTree := recTree receiver. |
|
2098 |
isMeta := true. |
|
2099 |
]. |
|
2100 |
recTree isPrimary ifTrue:[ |
|
2101 |
name := recTree name. |
|
2102 |
isMeta ifTrue:[ |
|
2103 |
name := name , ' class'. |
|
2104 |
]. |
|
2105 |
^ name |
|
2106 |
] |
|
2107 |
]. |
|
2108 |
"more strange things" |
|
2109 |
^ nil |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2110 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2111 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2112 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2113 |
is it a change in a class-description ? |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2114 |
" |
2322 | 2115 |
|
6288 | 2116 |
(('subclass:*' match:sel) |
2322 | 2117 |
or:[('variable*ubclass:*' match:sel)]) ifTrue:[ |
6288 | 2118 |
"/ must parse the full changes text, to get |
2119 |
"/ privacy information. |
|
2120 |
||
2121 |
changeStream := self streamForChange:changeNr. |
|
2122 |
changeStream notNil ifTrue:[ |
|
2123 |
chunk := changeStream nextChunk. |
|
2124 |
changeStream close. |
|
2125 |
fullParseTree := Parser parseExpression:chunk. |
|
2126 |
(fullParseTree isNil or:[fullParseTree == #Error]) ifTrue:[ |
|
2127 |
fullParseTree := nil |
|
2128 |
] ifFalse:[ |
|
2129 |
fullParseTree isMessage ifFalse:[ |
|
2130 |
fullParseTree := nil |
|
2131 |
] |
|
2132 |
]. |
|
2133 |
"/ actually, the nil case cannot happen |
|
2134 |
fullParseTree notNil ifTrue:[ |
|
2135 |
aParseTree := fullParseTree. |
|
2136 |
sel := aParseTree selector. |
|
2137 |
]. |
|
2138 |
]. |
|
2139 |
||
2140 |
arg1Tree := aParseTree arg1. |
|
2141 |
(arg1Tree notNil and:[arg1Tree isConstant]) ifTrue:[ |
|
2142 |
name := arg1Tree value asString. |
|
2143 |
||
2144 |
"/ is it a private-class ? |
|
2145 |
('*privateIn:' match:sel) ifTrue:[ |
|
2146 |
ownerTree := aParseTree args last. |
|
2147 |
ownerName := ownerTree name asString. |
|
2148 |
name := ownerName , '::' , name |
|
2149 |
]. |
|
2150 |
^ name |
|
2151 |
]. |
|
2152 |
"very strange" |
|
2153 |
^ nil |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2154 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2155 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2156 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2157 |
is it a class remove ? |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2158 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2159 |
(sel == #removeClass:) ifTrue:[ |
6288 | 2160 |
(recTree notNil |
2161 |
and:[recTree ~~ #Error |
|
2162 |
and:[recTree isPrimary |
|
2163 |
and:[recTree name = 'Smalltalk']]]) ifTrue:[ |
|
2164 |
arg1Tree := aParseTree arg1. |
|
2165 |
(arg1Tree notNil and:[arg1Tree isPrimary]) ifTrue:[ |
|
2166 |
name := arg1Tree name. |
|
2167 |
^ name |
|
2168 |
]. |
|
2169 |
] |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2170 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2171 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2172 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2173 |
is it a method category change ? |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2174 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2175 |
((sel == #category:) |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2176 |
or:[sel == #privacy:]) ifTrue:[ |
6288 | 2177 |
(recTree notNil |
2178 |
and:[recTree ~~ #Error |
|
2179 |
and:[recTree isMessage |
|
2180 |
and:[recTree selector == #compiledMethodAt:]]]) ifTrue:[ |
|
2181 |
isMeta := false. |
|
2182 |
recTree := recTree receiver. |
|
2183 |
recTree isUnaryMessage ifTrue:[ |
|
2184 |
(recTree selector ~~ #class) ifTrue:[^ nil]. |
|
2185 |
"id class " |
|
2186 |
recTree := recTree receiver |
|
2187 |
]. |
|
2188 |
recTree isPrimary ifTrue:[ |
|
2189 |
isMeta ifTrue:[ |
|
2190 |
name := name , ' class'. |
|
2191 |
]. |
|
2192 |
name := recTree name. |
|
2193 |
^ name |
|
2194 |
] |
|
2195 |
] |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2196 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2197 |
^ nil |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2198 |
|
2606 | 2199 |
"Modified: / 13.2.2000 / 15:05:28 / cg" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2200 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2201 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2202 |
numberOfChanges |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2203 |
^ changePositions size |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2204 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2205 |
"Created: 3.12.1995 / 18:15:39 / cg" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2206 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2207 |
|
2511 | 2208 |
ownerClassNameOfChange:changeNr |
6288 | 2209 |
"return the owner classname of a change |
2511 | 2210 |
For a normal class, this is the className; |
2211 |
for a private class, this is the name of the owning class" |
|
2212 |
||
4706 | 2213 |
|name "ns idx" cls| |
2511 | 2214 |
|
2215 |
name := self classNameOfChange:changeNr. |
|
2216 |
name isNil ifTrue:[^ nil]. |
|
2217 |
cls := Smalltalk at:name asSymbol. |
|
2218 |
(cls notNil and:[cls isBehavior]) ifTrue:[ |
|
6288 | 2219 |
cls owningClass notNil ifTrue:[ |
2220 |
^ cls owningClass name |
|
2221 |
]. |
|
2222 |
^ cls name |
|
2511 | 2223 |
]. |
2224 |
||
2225 |
"/ (name includes:$:) ifTrue:[ |
|
2226 |
"/ idx := name indexOf:$:. |
|
2227 |
"/ ns := name copyTo:idx-1. |
|
2228 |
"/ ns := Smalltalk at:ns asSymbol. |
|
2229 |
"/ ns notNil ifTrue:[ |
|
6288 | 2230 |
"/ |
2511 | 2231 |
"/ ]. |
2232 |
"/ |
|
2233 |
"/ name := name copyFrom:idx+2. |
|
2234 |
"/ (Smalltalk at:ns asSymbol) notNil ifTrue:[ |
|
2235 |
"/ cls |
|
2236 |
"/ ]. |
|
2237 |
"/ ^ name copyWithoutLast:6 |
|
2238 |
"/ ]. |
|
2239 |
^ name |
|
2240 |
||
2241 |
"Modified: 6.12.1995 / 17:06:31 / cg" |
|
2242 |
! |
|
2243 |
||
3364 | 2244 |
realClassNameOfChange:changeNr |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
2245 |
"return the classname of a change. |
6288 | 2246 |
- since parsing ascii methods is slow, keep result cached in |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
2247 |
changeClassNames for the next query" |
3364 | 2248 |
|
2249 |
|name| |
|
2250 |
||
2251 |
name := changeClassNames at:changeNr. |
|
2252 |
name isNil ifTrue:[ |
|
6288 | 2253 |
name := self fullClassNameOfChange:changeNr. |
2254 |
name isNil ifTrue:[ |
|
2255 |
changeClassNames at:changeNr put:#nil. |
|
2256 |
]. |
|
3364 | 2257 |
]. |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
2258 |
name == #nil ifTrue:[^ nil]. |
3364 | 2259 |
^ name |
2260 |
||
2261 |
"Modified: / 6.12.1995 / 17:06:31 / cg" |
|
2262 |
"Created: / 5.11.2001 / 18:09:46 / cg" |
|
2263 |
! |
|
2264 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2265 |
selectorOfMethodChange:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2266 |
"return a method-changes selector, or nil if its not a methodChange" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2267 |
|
3202 | 2268 |
|sel | |
2269 |
||
2270 |
changeSelectors size >= changeNr ifTrue:[ |
|
6288 | 2271 |
sel := changeSelectors at:changeNr. |
2272 |
sel notNil ifTrue:[ ^ sel ]. |
|
3202 | 2273 |
]. |
2274 |
||
2275 |
sel := self extractSelectorOfMethodChange:changeNr. |
|
2276 |
sel notNil ifTrue:[ |
|
6288 | 2277 |
changeSelectors isNil ifTrue:[ |
2278 |
changeSelectors := OrderedCollection new |
|
2279 |
]. |
|
2280 |
changeSelectors grow:changeNr. |
|
2281 |
changeSelectors at:changeNr put:sel. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2282 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2283 |
^ sel |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2284 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2285 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2286 |
sourceOfMethodChange:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2287 |
"return a method-changes source code, or nil if its not a methodChange." |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2288 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2289 |
|aStream chunk sawExcla parseTree sourceChunk sel| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2290 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2291 |
aStream := self streamForChange:changeNr. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2292 |
aStream isNil ifTrue:[^ nil]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2293 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2294 |
(self changeIsFollowupMethodChange:changeNr) ifFalse:[ |
6288 | 2295 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
2296 |
chunk := aStream nextChunk. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2297 |
] ifTrue:[ |
6288 | 2298 |
chunk := (changeChunks at:changeNr). |
2299 |
sawExcla := true. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2300 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2301 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2302 |
sawExcla ifTrue:[ |
6288 | 2303 |
parseTree := Parser parseExpression:chunk. |
2304 |
(parseTree notNil |
|
2305 |
and:[parseTree ~~ #Error |
|
2306 |
and:[parseTree isMessage]]) ifTrue:[ |
|
2307 |
sel := parseTree selector. |
|
2308 |
(#( |
|
2309 |
#methodsFor: |
|
2310 |
#privateMethodsFor: |
|
2311 |
#publicMethodsFor: |
|
2312 |
#ignoredMethodsFor: |
|
2313 |
#protectedMethodsFor: |
|
2314 |
||
2315 |
#methodsFor:stamp: "/ Squeak support |
|
2316 |
#commentStamp:prior: "/ Squeak support |
|
2317 |
#methodsFor "/ Dolphin support |
|
2318 |
#methods "/ STV support |
|
2319 |
) |
|
2320 |
includes:sel) ifTrue:[ |
|
2321 |
sourceChunk := aStream nextChunk. |
|
2322 |
] |
|
2323 |
]. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2324 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2325 |
aStream close. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2326 |
^ sourceChunk |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2327 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2328 |
"Created: / 5.9.1996 / 17:11:32 / cg" |
2606 | 2329 |
"Modified: / 13.2.2000 / 15:05:45 / cg" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2330 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2331 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2332 |
streamForChange:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2333 |
"answer a stream for change" |
6288 | 2334 |
|
5702 | 2335 |
|aStream encoding decoder| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2336 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2337 |
(changeNr between:1 and:changePositions size) ifFalse:[^ nil]. |
5702 | 2338 |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
2339 |
aStream := changeFileName asFilename readStreamOrNil. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2340 |
aStream isNil ifTrue:[^ nil]. |
5702 | 2341 |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
2342 |
encodingIfKnown isNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
2343 |
encoding := CharacterEncoder guessEncodingOfStream:aStream. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
2344 |
encodingIfKnown := encoding ? #none |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
2345 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
2346 |
(encodingIfKnown notNil and:[encodingIfKnown ~~ #none]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
2347 |
decoder := CharacterEncoder encoderFor:encodingIfKnown. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
2348 |
aStream := EncodedStream stream:aStream encoder:decoder. |
5702 | 2349 |
]. |
2350 |
||
4599
9a95e5ae08ad
code rewritten to be independent of stream zero-base
Claus Gittinger <cg@exept.de>
parents:
4497
diff
changeset
|
2351 |
aStream position1Based:(changePositions at:changeNr). |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2352 |
^ aStream |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2353 |
! ! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2354 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2355 |
!ChangesBrowser methodsFor:'private-changeFile access'! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2356 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2357 |
changeFileName:aFileName |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
2358 |
"set the name of the changeFile" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
2359 |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
2360 |
changeFileName := aFileName. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
2361 |
encodingIfKnown := nil. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2362 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2363 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2364 |
checkIfFileHasChanged |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
2365 |
"check if the changeFile has been modified since the last check; |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
2366 |
install a timeout for rechecking after some time." |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
2367 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2368 |
|f info | |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2369 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2370 |
Processor removeTimedBlock:checkBlock. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2371 |
f := changeFileName asFilename. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2372 |
(info := f info) isNil ifTrue:[ |
6288 | 2373 |
self newLabel:'(unaccessable)' |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2374 |
] ifFalse:[ |
6288 | 2375 |
(info modificationTime) > changeFileTimestamp ifTrue:[ |
2376 |
self newLabel:'(outdated)'. |
|
2377 |
autoUpdate value ifTrue:[ |
|
2378 |
self doUpdate |
|
2379 |
] |
|
2380 |
] ifFalse:[ |
|
2381 |
self newLabel:'' |
|
2382 |
] |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2383 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2384 |
Processor addTimedBlock:checkBlock afterSeconds:5. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2385 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2386 |
"Created: 8.9.1995 / 19:30:19 / claus" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2387 |
"Modified: 8.9.1995 / 19:38:18 / claus" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2388 |
"Modified: 1.11.1996 / 20:22:56 / cg" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2389 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2390 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2391 |
readChangesFile |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2392 |
"read the changes file, create a list of header-lines (changeChunks) |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2393 |
and a list of chunk-positions (changePositions)" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2394 |
|
5178 | 2395 |
self readChangesFileInBackground:false. |
2396 |
self newLabel:''. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2397 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2398 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2399 |
readChangesFileInBackground:inBackground |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2400 |
"read the changes file, create a list of header-lines (changeChunks) |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2401 |
and a list of chunk-positions (changePositions). |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2402 |
Starting with 2.10.3, the entries are multi-col entries; |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2403 |
the cols are: |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2404 |
1 delta (only if comparing) |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2405 |
'+' -> new method (w.r.t. current state) |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2406 |
'-' -> removed method (w.r.t. current state) |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2407 |
'?' -> class does not exist currently |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
2408 |
'=' -> change is the same as current methods source |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
2409 |
'~' -> change is almost the same as current methods source |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2410 |
2 class/selector |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2411 |
3 type of change |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2412 |
doit |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2413 |
method |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2414 |
category change |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2415 |
4 timestamp |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2416 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2417 |
since comparing slows down startup time, it is now disabled by |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2418 |
default and can be enabled via a toggle." |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2419 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
2420 |
|inStream i f askedForEditingClassSource myProcess myPriority myPrioRange encoding decoder| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2421 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2422 |
editingClassSource := false. |
2641 | 2423 |
askedForEditingClassSource := false. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2424 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
2425 |
"/ maxLen := 60. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2426 |
|
3674 | 2427 |
self newLabel:'updating ...'. |
2428 |
||
2429 |
(self class isXMLFile:changeFileName) ifTrue:[ |
|
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2430 |
^ self class readXMLChangesFromFile:changeFileName inBackground:inBackground |
3674 | 2431 |
]. |
2432 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2433 |
f := changeFileName asFilename. |
7346 | 2434 |
f exists ifFalse:[^ self]. |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2435 |
inStream := f readStream. |
5715 | 2436 |
|
6173
4ba4589e4952
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
6162
diff
changeset
|
2437 |
encoding := CharacterEncoder guessEncodingOfStream:inStream. |
5696 | 2438 |
encoding notNil ifTrue:[ |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2439 |
decoder := CharacterEncoder encoderFor:encoding. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2440 |
inStream := EncodedStream stream:inStream encoder:decoder. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2441 |
inStream skipEncodingChunk. |
5696 | 2442 |
]. |
2443 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2444 |
i := f info. |
3965
e499c0dae8fc
use #fileSize instead of #size
Claus Gittinger <cg@exept.de>
parents:
3962
diff
changeset
|
2445 |
changeFileSize := i fileSize. |
3962
3906b10c42fd
modified -> modificationTime
Claus Gittinger <cg@exept.de>
parents:
3930
diff
changeset
|
2446 |
changeFileTimestamp := i modificationTime. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2447 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2448 |
self withReadCursorDo:[ |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2449 |
" |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2450 |
this is a time consuming operation (especially, if reading an |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2451 |
NFS-mounted directory; therefore lower my priority ... |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2452 |
" |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2453 |
inBackground ifTrue:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2454 |
myProcess := Processor activeProcess. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2455 |
myPriority := myProcess priority. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2456 |
myPrioRange := myProcess priorityRange. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2457 |
myProcess priorityRange:(Processor userBackgroundPriority to:Processor activePriority). |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2458 |
]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2459 |
|
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2460 |
[ |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
2461 |
|reader| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
2462 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
2463 |
reader := ChangeFileReader new. |
6516
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
2464 |
reader changeFileName:changeFileName. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
2465 |
reader browser:self. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
2466 |
reader enforcedNameSpace:enforcedNameSpace. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
2467 |
reader autoCompare:autoCompare. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
2468 |
reader tabSpec:tabSpec. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
2469 |
reader inStream:inStream. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
2470 |
reader noColoring:(NoColoring == true). |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
2471 |
reader readChangesFile. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
2472 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
2473 |
editingClassSource := reader thisIsAClassSource. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
2474 |
changeChunks := reader changeChunks. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
2475 |
changeClassNames := reader changeClassNames. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
2476 |
changeHeaderLines := reader changeHeaderLines. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
2477 |
changePositions := reader changePositions. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
2478 |
changeTimeStamps := reader changeTimeStamps. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
2479 |
changeIsFollowupMethodChange := reader changeIsFollowupMethodChange. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
2480 |
|
7360 | 2481 |
anyChanges := false. |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2482 |
] ensure:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2483 |
inStream close. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2484 |
inBackground ifTrue:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2485 |
myProcess priority:myPriority. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2486 |
myProcess priorityRange:myPrioRange. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2487 |
]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2488 |
]. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2489 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2490 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2491 |
self checkIfFileHasChanged |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2492 |
|
7360 | 2493 |
"Modified: / 27-08-1995 / 23:06:55 / claus" |
2494 |
"Modified: / 06-10-2006 / 11:08:37 / cg" |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2495 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2496 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2497 |
writeBackChanges |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2498 |
"write back the changes file. To avoid problems when the disk is full |
6288 | 2499 |
or a crash occurs while writing (well, or someone kills us), |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2500 |
first write the stuff to a new temporary file. If this works ok, |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2501 |
rename the old change-file to a .bak file and finally rename the |
6288 | 2502 |
tempfile back to the change-file. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2503 |
That way, if anything happens, either the original file is left unchanged, |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2504 |
or we have at least a backup of the previous change file." |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2505 |
|
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2506 |
|inStream outStream tempfile stamp f encoding decoder| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2507 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2508 |
editingClassSource ifTrue:[ |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2509 |
(self confirm:'You are editing a classes sourceFile (not a changeFile) !!\\Are you certain, you want to overwrite it ?' withCRs) |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2510 |
ifFalse:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2511 |
^ false |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2512 |
] |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2513 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2514 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2515 |
tempfile := Filename newTemporaryIn:nil. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2516 |
tempfile exists ifTrue:[tempfile remove]. |
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
2517 |
[ |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2518 |
outStream := tempfile writeStream. |
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
2519 |
] on:FileStream openErrorSignal do:[:ex| |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2520 |
self warn:'Cannot create temp file in current directory.'. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2521 |
^ false |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2522 |
]. |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2523 |
[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2524 |
inStream := changeFileName asFilename readStream. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2525 |
] on:FileStream openErrorSignal do:[:ex| |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2526 |
self warn:'Cannot open old changesFile.'. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2527 |
^ false |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2528 |
]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2529 |
|
5715 | 2530 |
outStream nextPutLine:'"{ Encoding: utf8 }" !!'. |
5733 | 2531 |
outStream := EncodedStream stream:outStream encoder:(CharacterEncoder encoderForUTF8). |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2532 |
|
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2533 |
encoding := CharacterEncoder guessEncodingOfStream:inStream. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2534 |
encoding notNil ifTrue:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2535 |
decoder := CharacterEncoder encoderFor:encoding. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2536 |
inStream := EncodedStream stream:inStream encoder:decoder. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2537 |
]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2538 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2539 |
self withCursor:(Cursor write) do:[ |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2540 |
|excla sawExcla done first chunk |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2541 |
nChanges "{Class:SmallInteger}" | |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2542 |
|
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2543 |
Stream writeErrorSignal handle:[:ex | |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2544 |
self warn:('Could not update the changes file.\\' , ex description) withCRs. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2545 |
tempfile exists ifTrue:[tempfile remove]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2546 |
^ false |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2547 |
] do:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2548 |
excla := inStream class chunkSeparator. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2549 |
nChanges := self numberOfChanges. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2550 |
|
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2551 |
1 to:nChanges do:[:index | |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2552 |
inStream position1Based:(changePositions at:index). |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2553 |
sawExcla := inStream peekFor:excla. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2554 |
chunk := inStream nextChunk. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2555 |
|
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2556 |
(chunk notNil |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2557 |
and:[(chunk startsWith:'''---- snap') not]) ifTrue:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2558 |
(stamp := changeTimeStamps at:index) notNil ifTrue:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2559 |
outStream nextPutAll:'''---- timestamp ' , stamp , ' ----'''. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2560 |
outStream nextPut:excla; cr. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2561 |
]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2562 |
]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2563 |
|
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2564 |
sawExcla ifTrue:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2565 |
outStream nextPut:excla. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2566 |
outStream nextChunkPut:chunk. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2567 |
outStream cr; cr. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2568 |
" |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2569 |
a method-definition chunk - output followups |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2570 |
" |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2571 |
done := false. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2572 |
first := true. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2573 |
[done] whileFalse:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2574 |
chunk := inStream nextChunk. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2575 |
chunk isNil ifTrue:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2576 |
outStream cr; cr. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2577 |
done := true |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2578 |
] ifFalse:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2579 |
chunk isEmpty ifTrue:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2580 |
outStream space; nextChunkPut:chunk; cr; cr. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2581 |
done := true. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2582 |
] ifFalse:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2583 |
first ifFalse:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2584 |
outStream cr; cr. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2585 |
]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2586 |
outStream nextChunkPut:chunk. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2587 |
]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2588 |
]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2589 |
first := false. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2590 |
]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2591 |
] ifFalse:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2592 |
outStream nextChunkPut:chunk. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2593 |
outStream cr |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2594 |
] |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2595 |
]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2596 |
outStream close. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2597 |
inStream close. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2598 |
]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2599 |
|
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2600 |
f := changeFileName asFilename. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2601 |
f renameTo:(f withSuffix:'bak'). |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2602 |
tempfile renameOrCopyTo:changeFileName. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
2603 |
anyChanges := false |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2604 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2605 |
^ true |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2606 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2607 |
"Modified: / 2.12.1996 / 22:29:15 / stefan" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2608 |
"Modified: / 21.4.1998 / 17:50:11 / cg" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2609 |
! ! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2610 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2611 |
!ChangesBrowser methodsFor:'private-user interaction ops'! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2612 |
|
5735 | 2613 |
appendChange:changeNr toFile:aFileNameOrFileNameString |
202 | 2614 |
"append change to a file. return true if ok." |
2615 |
||
5735 | 2616 |
|fileName changeInStream outStream chunk chunk2 sawExcla separator encoding| |
2617 |
||
2618 |
changeInStream := self streamForChange:changeNr. |
|
2619 |
changeInStream isNil ifTrue:[ |
|
6288 | 2620 |
self warn:'Cannot read change'. |
2621 |
^ false |
|
2394
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
2622 |
]. |
5735 | 2623 |
changeInStream skipSeparators. |
2624 |
||
2625 |
separator := changeInStream class chunkSeparator. |
|
2394
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
2626 |
|
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
2627 |
(self changeIsFollowupMethodChange:changeNr) ifTrue:[ |
6288 | 2628 |
sawExcla := true. |
2629 |
chunk := changeChunks at:changeNr. |
|
2394
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
2630 |
] ifFalse:[ |
6288 | 2631 |
sawExcla := changeInStream peekFor:separator. |
2632 |
chunk := changeInStream nextChunk. |
|
3991 | 2633 |
]. |
2634 |
chunk withoutSeparators isEmpty ifTrue:[ |
|
6288 | 2635 |
self error:'Empty chunk - should not happen'. |
5735 | 2636 |
]. |
2637 |
||
2638 |
fileName := aFileNameOrFileNameString asFilename. |
|
2639 |
fileName exists ifTrue:[ |
|
6288 | 2640 |
encoding := CharacterEncoder guessEncodingOfFile:fileName. |
5735 | 2641 |
] ifFalse:[ |
6288 | 2642 |
encoding := #utf8. |
2394
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
2643 |
]. |
202 | 2644 |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
2645 |
[ |
6288 | 2646 |
outStream := fileName readWriteStream. |
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
2647 |
] on:FileStream openErrorSignal do:[:ex| |
6288 | 2648 |
self warn:'Cannot update file: ''%1''' with:fileName. |
2649 |
^ false |
|
73 | 2650 |
]. |
202 | 2651 |
|
5735 | 2652 |
encoding notNil ifTrue:[ |
6288 | 2653 |
outStream := EncodedStream stream:outStream encoder:(CharacterEncoder encoderFor:encoding). |
2654 |
outStream nextPutLine:'"{ Encoding: utf8 }" !!'. |
|
5735 | 2655 |
]. |
2656 |
||
202 | 2657 |
outStream setToEnd. |
2658 |
||
2659 |
sawExcla ifTrue:[ |
|
6288 | 2660 |
outStream nextPut:separator |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2661 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2662 |
outStream nextChunkPut:chunk; cr. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2663 |
sawExcla ifTrue:[ |
6288 | 2664 |
chunk2 := changeInStream nextChunk. |
2665 |
chunk2 withoutSeparators isEmpty ifTrue:[ |
|
2666 |
self error:'Empty chunk - should not happen'. |
|
2667 |
]. |
|
2668 |
outStream nextChunkPut:chunk2; space |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2669 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2670 |
sawExcla ifTrue:[ |
6288 | 2671 |
outStream nextPut:separator |
202 | 2672 |
]. |
2673 |
outStream cr. |
|
5735 | 2674 |
|
2675 |
changeInStream close. |
|
202 | 2676 |
outStream close. |
2677 |
^ true |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2678 |
|
1472 | 2679 |
"Modified: / 6.2.1998 / 13:03:54 / cg" |
73 | 2680 |
! |
2681 |
||
51 | 2682 |
applyChange:changeNr |
2683 |
"fileIn a change" |
|
2684 |
||
3091 | 2685 |
|aStream applyAction nameSpace className changeClass ownerName ownerClass |
6288 | 2686 |
sig reader doItChunk methodsForChunk pkg |
4877 | 2687 |
alternativeClass shortName orgClassName nsClass aborted| |
45 | 2688 |
|
51 | 2689 |
aStream := self streamForChange:changeNr. |
2690 |
aStream isNil ifTrue:[^ self]. |
|
2691 |
||
2965 | 2692 |
className := self classNameOfChange:changeNr. |
2693 |
className notNil ifTrue:[ |
|
6378 | 2694 |
className := className asSymbol. |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
2695 |
enforcedNameSpace notNil ifTrue:[ |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
2696 |
changeClass := enforcedNameSpace at:className ifAbsent:nil. |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
2697 |
] ifFalse:[ |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
2698 |
changeClass := Smalltalk at:className ifAbsent:nil. |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
2699 |
]. |
6378 | 2700 |
changeClass isNil ifTrue:[ |
2701 |
changeClass := self classOfChange:changeNr. |
|
2702 |
]. |
|
51 | 2703 |
]. |
45 | 2704 |
|
51 | 2705 |
changeNrProcessed := changeNr. |
4877 | 2706 |
aborted := false. |
45 | 2707 |
|
6288 | 2708 |
applyAction := |
6378 | 2709 |
[ |
2710 |
(skipSignal notNil) ifTrue:[ |
|
2711 |
sig := skipSignal |
|
2712 |
] ifFalse:[ |
|
2713 |
sig := AbortOperationRequest |
|
2714 |
]. |
|
2715 |
sig handle:[:ex | |
|
2716 |
aborted := true. |
|
2717 |
ex return. |
|
2718 |
] do:[ |
|
2719 |
nameSpace := self nameSpaceForApply. |
|
2720 |
||
2721 |
pkg := enforcedPackage ? Class packageQuerySignal query. |
|
2722 |
Class packageQuerySignal answer:pkg |
|
2723 |
do:[ |
|
2724 |
Class nameSpaceQuerySignal answer:nameSpace |
|
2725 |
do:[ |
|
2726 |
"/ a followup methodsFor: chunk ... |
|
2727 |
(self changeIsFollowupMethodChange:changeNr) ifTrue:[ |
|
2728 |
methodsForChunk := (changeChunks at:changeNr). |
|
2729 |
] ifFalse:[ |
|
2730 |
doItChunk := aStream nextChunk. "/ an empty chunk sometimes ... |
|
2731 |
doItChunk notEmpty ifTrue:[ |
|
2732 |
Compiler evaluate:doItChunk notifying:self. |
|
2733 |
] ifFalse:[ |
|
2734 |
methodsForChunk := aStream nextChunk. "/ the real one |
|
2735 |
] |
|
2736 |
]. |
|
2737 |
methodsForChunk notNil ifTrue:[ |
|
2738 |
changeClass isNil ifTrue:[ |
|
2739 |
orgClassName := className. |
|
2740 |
||
2741 |
(className includes:$:) ifTrue:[ |
|
2742 |
ownerName := className copyTo:(className lastIndexOf:$:) - 1. |
|
2743 |
(ownerName endsWith:$:) ifTrue:[ |
|
2744 |
ownerName := ownerName copyWithoutLast:1. |
|
2745 |
]. |
|
2746 |
||
2747 |
ownerClass := Smalltalk at:(ownerName asSymbol) ifAbsent:[]. |
|
2748 |
ownerClass notNil ifTrue:[ |
|
2749 |
ownerClass autoload |
|
2750 |
]. |
|
2751 |
]. |
|
2752 |
(nameSpace notNil and:[nameSpace ~~ Smalltalk]) ifTrue:[ |
|
2753 |
changeClass := nameSpace at:className ifAbsent:[]. |
|
2754 |
]. |
|
2755 |
changeClass isNil ifTrue:[ |
|
2756 |
changeClass := Smalltalk at:className ifAbsent:[]. |
|
2757 |
]. |
|
2758 |
[changeClass isNil] whileTrue:[ |
|
6682 | 2759 |
(NameSpace allNameSpaces |
6378 | 2760 |
detect:[:ns | (nsClass := (ns at:className)) notNil] ifNone:nil) |
2761 |
notNil ifTrue:[ |
|
2762 |
shortName := nsClass name. |
|
2763 |
] ifFalse:[ |
|
2764 |
shortName := className copyFrom:(className lastIndexOf:$:) + 1. |
|
2765 |
shortName = className ifTrue:[ |
|
2766 |
shortName := '' |
|
2767 |
]. |
|
2768 |
]. |
|
2769 |
className := Dialog |
|
2770 |
request:'No class ''' , className , ''' for change. Add to which class ?' |
|
2771 |
initialAnswer:shortName. |
|
2772 |
||
2773 |
className size == 0 ifTrue:[ |
|
2774 |
^ self |
|
2775 |
]. |
|
2776 |
alternativeClass := Smalltalk classNamed:className. |
|
2777 |
alternativeClass notNil ifTrue:[ |
|
2778 |
changeClass := alternativeClass |
|
2779 |
] |
|
2780 |
]. |
|
2781 |
methodsForChunk := methodsForChunk copyFrom:(methodsForChunk indexOfSeparator). |
|
2782 |
methodsForChunk := changeClass name , methodsForChunk. |
|
2783 |
]. |
|
2784 |
||
2785 |
reader := Compiler evaluate:methodsForChunk notifying:self. |
|
2786 |
reader fileInFrom:aStream notifying:self passChunk:false single:true. |
|
2787 |
] |
|
2788 |
] |
|
2789 |
] |
|
2790 |
]. |
|
2791 |
changeNrProcessed := nil. |
|
2792 |
]. |
|
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
2793 |
|
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
2794 |
"/ |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
2795 |
"/ 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
|
2796 |
"/ |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
2797 |
changeFileName = ObjectMemory nameForChanges ifTrue:[ |
6378 | 2798 |
Class withoutUpdatingChangesDo:[ |
2799 |
Class updateChangeListQuerySignal answer:updateChangeSet value do:applyAction |
|
2800 |
] |
|
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
2801 |
] ifFalse:[ |
6378 | 2802 |
applyAction value |
45 | 2803 |
]. |
4877 | 2804 |
aStream close. |
2805 |
||
2806 |
^ aborted not |
|
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
2807 |
|
3436
c4fe19deba58
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3406
diff
changeset
|
2808 |
"Modified: / 16.11.2001 / 17:38:06 / cg" |
45 | 2809 |
! |
2810 |
||
255 | 2811 |
compareChange:changeNr |
2835 | 2812 |
"compare a change with the current (in-image) version; show the result of the compare (as dialog)" |
2813 |
||
2814 |
^ self compareChange:changeNr showResult:true |
|
2815 |
! |
|
2816 |
||
2817 |
compareChange:changeNr showResult:doShowResult |
|
2818 |
"compare a change with current version. |
|
2819 |
Return the result of the compare (same -> true, different -> false, uncomparable -> nil). |
|
2820 |
If doShowResult is true, the outcome is shown in a dialog/diffViewer." |
|
255 | 2821 |
|
2822 |
|aStream chunk sawExcla parseTree thisClass cat oldSource newSource |
|
742
2ef5e22d8983
code cleanup (unused vars eliminated)
Claus Gittinger <cg@exept.de>
parents:
724
diff
changeset
|
2823 |
parser sel oldMethod outcome showDiff d t1 t2 selector isLoaded |
2835 | 2824 |
method beep superClass thisClassSym varsHere varsInChange addedVars removedVars |
4296
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
2825 |
isSame ownerClass superClassHere superClassInChange| |
255 | 2826 |
|
2827 |
aStream := self streamForChange:changeNr. |
|
2835 | 2828 |
aStream isNil ifTrue:[^ nil]. |
255 | 2829 |
|
275
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
2830 |
showDiff := false. |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
2831 |
|
1472 | 2832 |
(self changeIsFollowupMethodChange:changeNr) ifFalse:[ |
6357 | 2833 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
2834 |
chunk := aStream nextChunk. |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2835 |
] ifTrue:[ |
6357 | 2836 |
chunk := (changeChunks at:changeNr). |
2837 |
sawExcla := true. |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2838 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
2839 |
|
2835 | 2840 |
isSame := nil. |
2841 |
||
761 | 2842 |
beep := false. |
255 | 2843 |
sawExcla ifFalse:[ |
6357 | 2844 |
outcome := 'cannot compare this change\\(i.e. this is not a method change).'. |
2845 |
||
2846 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
|
2847 |
do:[ |
|
2848 |
parseTree := Parser parseExpression:chunk. |
|
2849 |
]. |
|
2850 |
(parseTree notNil and:[parseTree ~~ #Error and:[ parseTree isMessage ]]) ifTrue:[ |
|
2851 |
selector := parseTree selector. |
|
2852 |
||
2853 |
selector == #'removeSelector:' ifTrue:[ |
|
2854 |
thisClass := (parseTree receiver evaluate). |
|
2855 |
thisClass isBehavior ifTrue:[ |
|
2856 |
(self checkClassIsLoaded:thisClass) ifTrue:[ |
|
2857 |
selector := (parseTree arg1 evaluate). |
|
2858 |
(thisClass includesSelector:selector) ifTrue:[ |
|
2859 |
outcome := 'Change removes the #' , selector , ' method from ' , thisClass name. |
|
2860 |
isSame := false. |
|
2861 |
] ifFalse:[ |
|
2862 |
outcome := 'Change has no effect\\(there is no method for #' , selector , ' in ' , thisClass name , ')'. |
|
2863 |
isSame := true. |
|
2864 |
] |
|
2865 |
] ifFalse:[ |
|
2866 |
beep := true. |
|
2867 |
outcome := 'Cannot compare this change (compare requires class to be loaded).'. |
|
2868 |
isSame := nil. |
|
2869 |
] |
|
2870 |
] ifFalse:[ |
|
2871 |
outcome := 'Cannot compare this change (class not present)'. |
|
2872 |
isSame := nil. |
|
2873 |
]. |
|
2874 |
]. |
|
2875 |
selector == #'category:' ifTrue:[ |
|
2876 |
parseTree receiver isMessage ifTrue:[ |
|
2877 |
parseTree receiver selector == #compiledMethodAt: ifTrue:[ |
|
2878 |
|receiver| |
|
2879 |
receiver := parseTree receiver. |
|
2880 |
(receiver receiver evaluate isBehavior |
|
2881 |
and:[(method := receiver evaluate) isMethod]) ifTrue:[ |
|
2882 |
method category = parseTree arg1 evaluate ifTrue:[ |
|
2883 |
outcome := 'Change has no effect\\(same category)'. |
|
2884 |
isSame := true. |
|
2885 |
] ifFalse:[ |
|
2886 |
outcome := 'Category is different (''' , method category , ''' vs. ''' , parseTree arg1 evaluate , ''')'. |
|
2887 |
isSame := false. |
|
2888 |
] |
|
2889 |
] ifFalse:[ |
|
2890 |
beep := true. |
|
2891 |
outcome := 'There is no such method'. |
|
2892 |
isSame := nil. |
|
2893 |
] |
|
2894 |
] |
|
2895 |
] |
|
2896 |
]. |
|
2897 |
selector == #'comment:' ifTrue:[ |
|
2898 |
thisClass := (parseTree receiver evaluate). |
|
2899 |
thisClass isBehavior ifTrue:[ |
|
2900 |
(self checkClassIsLoaded:thisClass) ifTrue:[ |
|
2901 |
(thisClass comment = parseTree arg1 evaluate) ifTrue:[ |
|
2902 |
outcome := 'Change has no effect\\(same comment)'. |
|
2903 |
isSame := true. |
|
2904 |
] ifFalse:[ |
|
2905 |
outcome := 'Comment is different'. |
|
2906 |
isSame := false. |
|
2907 |
] |
|
2908 |
] ifFalse:[ |
|
2909 |
beep := true. |
|
2910 |
outcome := 'Cannot compare this change (compare requires class to be loaded).'. |
|
2911 |
isSame := nil. |
|
2912 |
] |
|
2913 |
] ifFalse:[ |
|
2914 |
outcome := 'Cannot compare this change (class not present)'. |
|
2915 |
isSame := nil. |
|
2916 |
]. |
|
2917 |
]. |
|
2918 |
||
2919 |
selector == #'instanceVariableNames:' ifTrue:[ |
|
2920 |
parseTree receiver isMessage ifTrue:[ |
|
2921 |
parseTree receiver selector == #class ifTrue:[ |
|
2922 |
thisClass := (parseTree receiver evaluate). |
|
2923 |
varsHere := thisClass instanceVariableString asCollectionOfWords. |
|
2924 |
varsInChange := (parseTree arguments at:1) evaluate asCollectionOfWords. |
|
2925 |
varsHere = varsInChange ifTrue:[ |
|
2926 |
outcome := 'Change has no effect\\(same definition)'. |
|
2927 |
isSame := true. |
|
2928 |
] ifFalse:[ |
|
2929 |
outcome := 'Class-instanceVariable definition is different'. |
|
2930 |
isSame := false. |
|
2931 |
]. |
|
2932 |
]. |
|
2933 |
] |
|
2934 |
]. |
|
2935 |
||
2936 |
(Class definitionSelectors includes:selector) |
|
2937 |
"/ selector == #'subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:' |
|
2938 |
ifTrue:[ |
|
2939 |
superClass := (parseTree receiver evaluate). |
|
2940 |
superClass isBehavior ifFalse:[ |
|
2941 |
outcome := 'Cannot compare this change\\(superclass not loaded).'. |
|
2942 |
isSame := nil. |
|
2943 |
] ifTrue:[ |
|
2944 |
(self checkClassIsLoaded:superClass) ifTrue:[ |
|
2945 |
thisClassSym := (parseTree arguments at:1) evaluate. |
|
2946 |
||
2947 |
(selector endsWith:':privateIn:') ifTrue:[ |
|
2948 |
ownerClass := (parseTree arguments at:5) evaluate. |
|
2949 |
ownerClass isBehavior ifTrue:[ |
|
2950 |
thisClass := ownerClass privateClassesAt:thisClassSym. |
|
2951 |
]. |
|
2952 |
] ifFalse:[ |
|
2953 |
thisClass := (self nameSpaceForApply) at:thisClassSym ifAbsent:nil. |
|
2954 |
]. |
|
2955 |
thisClass isNil ifTrue:[ |
|
2956 |
outcome := 'Change defines the class: ' , thisClassSym allBold. |
|
2957 |
isSame := false. |
|
2958 |
] ifFalse:[ |
|
2959 |
(isLoaded := self checkClassIsLoaded:thisClass) ifFalse:[ |
|
2960 |
outcome := 'Cannot compare this change\\(compare requires class to be loaded).'. |
|
2961 |
isSame := nil. |
|
2962 |
] ifTrue:[ |
|
2963 |
superClassHere := thisClass superclass name. |
|
2964 |
superClassInChange := parseTree receiver name. |
|
2965 |
superClassHere ~~ superClassInChange ifTrue:[ |
|
2966 |
outcome := 'Superclass is different.'. |
|
2967 |
isSame := false. |
|
2968 |
] ifFalse:[ |
|
2969 |
varsHere := thisClass instanceVariableString asCollectionOfWords. |
|
2970 |
varsInChange := (parseTree arguments at:2) evaluate asCollectionOfWords. |
|
2971 |
varsHere = varsInChange ifTrue:[ |
|
2972 |
thisClass classVariableString asCollectionOfWords = (parseTree arguments at:3) evaluate asCollectionOfWords ifTrue:[ |
|
2973 |
((thisClass sharedPools size == 0) and:[(parseTree arguments at:4) evaluate = '']) ifTrue:[ |
|
2974 |
((selector endsWith:':category:') |
|
2975 |
and:[thisClass category ~= (parseTree arguments at:5) evaluate]) ifTrue:[ |
|
2976 |
outcome := 'Category is different'. |
|
2977 |
isSame := false. |
|
2978 |
] ifFalse:[ |
|
2979 |
outcome := 'Change has no effect\\(same definition)'. |
|
2980 |
isSame := true. |
|
2981 |
] |
|
4296
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
2982 |
"/ thisClass category = (parseTree arguments at:5) evaluate ifTrue:[ |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
2983 |
"/ outcome := 'Change has no effect\\(same definition)'. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
2984 |
"/ isSame := true. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
2985 |
"/ ] ifFalse:[ |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
2986 |
"/ outcome := 'Category is different'. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
2987 |
"/ isSame := false. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
2988 |
"/ ] |
6357 | 2989 |
] ifFalse:[ |
2990 |
outcome := 'SharedPool definition is different'. |
|
2991 |
isSame := false. |
|
2992 |
]. |
|
2993 |
] ifFalse:[ |
|
2994 |
outcome := 'ClassVariable definition is different'. |
|
2995 |
isSame := false. |
|
2996 |
] |
|
2997 |
] ifFalse:[ |
|
2998 |
outcome := 'InstanceVariable definition is different'. |
|
2999 |
isSame := false. |
|
3000 |
addedVars := varsInChange select:[:eachVar | (varsHere includes:eachVar) not]. |
|
3001 |
removedVars := varsHere select:[:eachVar | (varsInChange includes:eachVar) not]. |
|
3002 |
addedVars isEmpty ifTrue:[ |
|
3003 |
removedVars isEmpty ifTrue:[ |
|
3004 |
outcome := 'Change reorders instanceVariable(s)'. |
|
3005 |
] ifFalse:[ |
|
3006 |
removedVars := removedVars collect:[:eachVar | '''' , eachVar , '''']. |
|
3007 |
outcome := 'Change removes instanceVariable(s): ' , (removedVars asStringWith:Character space) allBold. |
|
3008 |
] |
|
3009 |
] ifFalse:[ |
|
3010 |
removedVars isEmpty ifTrue:[ |
|
3011 |
addedVars := addedVars collect:[:eachVar | '''' , eachVar , '''']. |
|
3012 |
outcome := 'Change adds instanceVariable(s): ' , (addedVars asStringWith:Character space) allBold. |
|
3013 |
]. |
|
3014 |
]. |
|
3015 |
] |
|
3016 |
] |
|
3017 |
] |
|
3018 |
] |
|
3019 |
] |
|
3020 |
] |
|
3021 |
] |
|
3022 |
] |
|
255 | 3023 |
] ifTrue:[ |
6357 | 3024 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
3025 |
do:[ |
|
3026 |
parseTree := Parser parseExpression:chunk. |
|
3027 |
]. |
|
3028 |
(parseTree notNil |
|
3029 |
and:[parseTree ~~ #Error |
|
3030 |
and:[parseTree isMessage]]) ifTrue:[ |
|
3031 |
"/ Squeak support (#methodsFor:***) |
|
3032 |
(#( |
|
3033 |
#methodsFor: |
|
3034 |
#privateMethodsFor: |
|
3035 |
#publicMethodsFor: |
|
3036 |
#ignoredMethodsFor: |
|
3037 |
#protectedMethodsFor: |
|
3038 |
||
3039 |
#methodsFor:stamp: "/ Squeak support |
|
3040 |
#methodsFor "/ Dolphin support |
|
3041 |
#methods "/ STV support |
|
3042 |
) |
|
3043 |
includes:parseTree selector) ifTrue:[ |
|
3044 |
thisClass := (parseTree receiver evaluate). |
|
3045 |
(thisClass notNil and:[thisClass isKindOf:UndefinedVariable]) ifTrue:[ |
|
3046 |
|thisName path| |
|
3047 |
||
3048 |
thisName := thisClass name. |
|
3049 |
path := thisName asCollectionOfSubstringsSeparatedByAll:'::'. |
|
3050 |
1 to:path size do:[:length | |
|
3051 |
|ownerName owner| |
|
3052 |
||
3053 |
ownerName := (path copyTo:length) asStringCollection asStringWith:'::'. |
|
6820
4e8815b9e661
Do not autoload class when comparing changes.
Stefan Vogel <sv@exept.de>
parents:
6682
diff
changeset
|
3054 |
owner := Smalltalk loadedClassNamed:ownerName. |
6357 | 3055 |
(owner notNil and:[owner isBehavior and:[owner isLoaded not]]) ifTrue:[ |
3056 |
self checkClassIsLoaded:owner. |
|
3057 |
]. |
|
3058 |
]. |
|
3059 |
thisClass := (parseTree receiver evaluate). |
|
3060 |
]. |
|
3061 |
||
3062 |
thisClass isBehavior ifTrue:[ |
|
3063 |
(isLoaded := self checkClassIsLoaded:thisClass) ifFalse:[ |
|
3064 |
outcome := 'Cannot compare this change\\(compare requires class to be loaded).'. |
|
3065 |
isSame := nil. |
|
3066 |
]. |
|
3067 |
||
3068 |
parseTree selector == #methodsFor ifTrue:[ |
|
3069 |
cat := 'Dolphin methods'. |
|
3070 |
] ifFalse:[ |
|
3071 |
parseTree selector == #methods ifTrue:[ |
|
3072 |
cat := 'STV methods'. |
|
3073 |
] ifFalse:[ |
|
3074 |
cat := parseTree arg1 evaluate. |
|
3075 |
]. |
|
3076 |
]. |
|
3077 |
newSource := aStream nextChunk. |
|
3078 |
||
3079 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
|
3080 |
do:[ |
|
3081 |
parser := Parser parseMethod:newSource in:thisClass. |
|
3082 |
]. |
|
3083 |
(parser notNil and:[parser ~~ #Error]) ifTrue:[ |
|
3084 |
sel := parser selector. |
|
3085 |
oldMethod := thisClass compiledMethodAt:sel. |
|
3086 |
oldMethod notNil ifTrue:[ |
|
3087 |
(oldMethod category = cat) ifFalse:[ |
|
6447 | 3088 |
"/ Transcript showCR:'category changed.'. |
6357 | 3089 |
]. |
3090 |
oldSource := oldMethod source. |
|
3091 |
(oldSource = newSource) ifTrue:[ |
|
3092 |
outcome := 'Same source'. |
|
3093 |
isSame := true. |
|
3094 |
] ifFalse:[ |
|
3095 |
oldSource isNil ifTrue:[ |
|
3096 |
beep := true. |
|
3097 |
outcome := 'No source for compare.'. |
|
3098 |
isSame := true. |
|
3099 |
] ifFalse:[ |
|
3100 |
"/ |
|
3101 |
"/ compare for tabulator <-> space changes |
|
3102 |
"/ before showing diff ... |
|
3103 |
"/ |
|
3104 |
t1 := oldSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
3105 |
t2 := newSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
3106 |
t1 = t2 ifTrue:[ |
|
3107 |
outcome := 'Same source'. |
|
3108 |
isSame := true. |
|
3109 |
] ifFalse:[ |
|
3110 |
outcome := 'Source changed.'. |
|
3111 |
showDiff := true. |
|
3112 |
isSame := false. |
|
3113 |
||
3114 |
"/ |
|
3115 |
"/ check if only historyLine diffs |
|
3116 |
"/ |
|
3117 |
(HistoryManager notNil |
|
3118 |
and:[HistoryManager isActive]) ifTrue:[ |
|
3119 |
(HistoryManager withoutHistoryLines:newSource) |
|
3120 |
= |
|
3121 |
(HistoryManager withoutHistoryLines:oldSource) |
|
3122 |
ifTrue:[ |
|
3123 |
outcome := 'Same source (history only)'. |
|
3124 |
isSame := true. |
|
3125 |
showDiff := false. |
|
3126 |
] |
|
3127 |
]. |
|
3128 |
] |
|
3129 |
] |
|
3130 |
] |
|
3131 |
] ifFalse:[ |
|
3132 |
isLoaded ifTrue:[ |
|
3133 |
beep := true. |
|
3134 |
outcome := 'Method does not exist.'. |
|
3135 |
isSame := nil. |
|
3136 |
] |
|
3137 |
] |
|
3138 |
] ifFalse:[ |
|
3139 |
outcome := 'Change is unparsable (parse error).'. |
|
3140 |
isSame := nil. |
|
3141 |
]. |
|
3142 |
doShowResult ifTrue:[ |
|
3143 |
(showDiff and:[oldSource notNil and:[newSource notNil]]) ifTrue:[ |
|
3144 |
d := DiffTextView |
|
6639 | 3145 |
openOn:oldSource label:(resources string:'Current version (in image)') |
3146 |
and:newSource label:(resources string:'Change version'). |
|
6357 | 3147 |
d label:'method differences'. |
3148 |
] |
|
3149 |
] |
|
3150 |
] ifFalse:[ |
|
3151 |
beep := true. |
|
3152 |
outcome := 'Class does not exist.'. |
|
3153 |
isSame := nil. |
|
3154 |
] |
|
3155 |
] ifFalse:[ |
|
3156 |
beep := true. |
|
3157 |
outcome := 'Not comparable.'. |
|
3158 |
isSame := nil. |
|
3159 |
] |
|
3160 |
] ifFalse:[ |
|
3161 |
beep := true. |
|
3162 |
outcome := 'Not comparable.'. |
|
3163 |
isSame := nil. |
|
3164 |
] |
|
255 | 3165 |
]. |
3166 |
aStream close. |
|
2835 | 3167 |
|
3168 |
doShowResult ifTrue:[ |
|
6357 | 3169 |
showDiff ifFalse:[ |
3170 |
outcome := (resources stringWithCRs:outcome). |
|
3171 |
beep ifTrue:[ |
|
3172 |
self warn:outcome. |
|
3173 |
] ifFalse:[ |
|
3174 |
self information:outcome. |
|
3175 |
] |
|
553 | 3176 |
"/ Transcript showCR:outcome. |
6357 | 3177 |
]. |
255 | 3178 |
]. |
2835 | 3179 |
^ isSame. |
255 | 3180 |
|
1472 | 3181 |
"Created: / 24.11.1995 / 14:30:46 / cg" |
2606 | 3182 |
"Modified: / 13.2.2000 / 15:04:39 / cg" |
255 | 3183 |
! |
3184 |
||
1359 | 3185 |
compressForClass:aClassNameOrNil |
6288 | 3186 |
"compress the change-set; |
1359 | 3187 |
this replaces multiple method-changes by the last (i.e. the most recent) change. |
3188 |
If the class argument is nil, compress for all classes. |
|
3189 |
otherwise, only changes for that class are compressed." |
|
3190 |
||
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3191 |
self |
6288 | 3192 |
compressForClass:aClassNameOrNil selector:nil |
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3193 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3194 |
"Modified: / 19.11.2001 / 22:04:12 / cg" |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3195 |
! |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3196 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3197 |
compressForClass:aClassNameOrNil selector:selectorToCompressOrNil |
6288 | 3198 |
"compress the change-set; |
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3199 |
this replaces multiple method-changes by the last (i.e. the most recent) change. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3200 |
If the class argument is nil, compress for all classes. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3201 |
otherwise, only changes for that class are compressed." |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3202 |
|
6288 | 3203 |
|lbl aStream searchIndex anyMore deleteSet index |
7507 | 3204 |
str snapshotProto snapshotPrefix snapshotNameIndex| |
3205 |
||
3206 |
changeFileName notNil ifTrue:[ |
|
3207 |
aStream := changeFileName asFilename readStreamOrNil. |
|
3208 |
aStream isNil ifTrue:[^ self]. |
|
3209 |
]. |
|
1359 | 3210 |
|
4762 | 3211 |
lbl := 'compressing'. |
1359 | 3212 |
aClassNameOrNil isNil ifTrue:[ |
7507 | 3213 |
selectorToCompressOrNil notNil ifTrue:[ |
3214 |
lbl := lbl , ' for ' , selectorToCompressOrNil. |
|
3215 |
] |
|
1359 | 3216 |
] ifFalse:[ |
7507 | 3217 |
selectorToCompressOrNil isNil ifTrue:[ |
3218 |
lbl := lbl , ' for ' , aClassNameOrNil. |
|
3219 |
] ifFalse:[ |
|
3220 |
lbl := lbl , ' for ' , aClassNameOrNil , '>>' , selectorToCompressOrNil. |
|
3221 |
] |
|
1359 | 3222 |
]. |
6288 | 3223 |
lbl := lbl , '...'. |
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3224 |
self newLabel:lbl. |
1359 | 3225 |
|
3226 |
CompressSnapshotInfo == true ifTrue:[ |
|
7507 | 3227 |
" |
3228 |
get a prototype snapshot record (to be independent of |
|
3229 |
the actual format .. |
|
3230 |
" |
|
3231 |
str := WriteStream on:String new. |
|
3232 |
Class addChangeRecordForSnapshot:'foo' to:str. |
|
3233 |
snapshotProto := str contents. |
|
3234 |
snapshotPrefix := snapshotProto copyTo:10. |
|
3235 |
snapshotNameIndex := snapshotProto findString:'foo'. |
|
1359 | 3236 |
]. |
3237 |
||
3238 |
self withExecuteCursorDo:[ |
|
7507 | 3239 |
|numChanges classes selectors types excla sawExcla |
3240 |
chunk aParseTree parseTreeChunk |
|
3241 |
thisClass thisSelector codeChunk codeParser |
|
3242 |
compressThis fileName| |
|
3243 |
||
3244 |
numChanges := self numberOfChanges. |
|
3245 |
classes := Array new:numChanges. |
|
3246 |
selectors := Array new:numChanges. |
|
3247 |
types := Array new:numChanges. |
|
3248 |
||
3249 |
"starting at the end, get the change class and change selector; |
|
3250 |
collect all in classes / selectors" |
|
3251 |
||
3252 |
aStream notNil ifTrue:[ |
|
3253 |
excla := aStream class chunkSeparator. |
|
3254 |
numChanges to:1 by:-1 do:[:changeNr | |
|
3255 |
aStream position1Based:(changePositions at:changeNr). |
|
3256 |
sawExcla := aStream peekFor:excla. |
|
3257 |
chunk := aStream nextChunk. |
|
3258 |
sawExcla ifTrue:[ |
|
3259 |
"optimize a bit if multiple methods for same category arrive" |
|
3260 |
(chunk = parseTreeChunk) ifFalse:[ |
|
3261 |
aParseTree := Parser parseExpression:chunk. |
|
3262 |
parseTreeChunk := chunk |
|
3263 |
]. |
|
3264 |
(aParseTree notNil |
|
3265 |
and:[(aParseTree ~~ #Error) |
|
3266 |
and:[aParseTree isMessage]]) ifTrue:[ |
|
3267 |
(#( |
|
3268 |
#methodsFor: |
|
3269 |
#privateMethodsFor: |
|
3270 |
#publicMethodsFor: |
|
3271 |
#ignoredMethodsFor: |
|
3272 |
#protectedMethodsFor: |
|
3273 |
#methodsFor:stamp: "/ Squeak support |
|
3274 |
#methodsFor "/ Dolphin support |
|
3275 |
#methods "/ STV support |
|
3276 |
) |
|
3277 |
includes:aParseTree selector) ifTrue:[ |
|
3278 |
thisClass := (aParseTree receiver evaluate). |
|
3279 |
codeChunk := aStream nextChunk. |
|
3280 |
codeParser := Parser |
|
3281 |
parseMethodSpecification:codeChunk |
|
3282 |
in:thisClass |
|
3283 |
ignoreErrors:true |
|
3284 |
ignoreWarnings:true. |
|
3285 |
(codeParser notNil and:[codeParser ~~ #Error]) ifTrue:[ |
|
3286 |
selectors at:changeNr put:(codeParser selector). |
|
3287 |
classes at:changeNr put:thisClass. |
|
3288 |
types at:changeNr put:#methodsFor |
|
3289 |
] |
|
3290 |
] |
|
3291 |
] |
|
3292 |
] ifFalse:[ |
|
3293 |
aParseTree := Parser parseExpression:chunk. |
|
3294 |
parseTreeChunk := chunk. |
|
3295 |
(aParseTree notNil |
|
3296 |
and:[(aParseTree ~~ #Error) |
|
3297 |
and:[aParseTree isMessage]]) ifTrue:[ |
|
3298 |
(aParseTree selector == #removeSelector:) ifTrue:[ |
|
3299 |
selectors at:changeNr put:(aParseTree arg1 value ). |
|
3300 |
classes at:changeNr put:(aParseTree receiver evaluate). |
|
3301 |
types at:changeNr put:#removeSelector |
|
3302 |
] |
|
3303 |
] ifFalse:[ |
|
3304 |
CompressSnapshotInfo == true ifTrue:[ |
|
3305 |
(chunk startsWith:snapshotPrefix) ifTrue:[ |
|
3306 |
str := chunk readStream position1Based:snapshotNameIndex. |
|
3307 |
fileName := str upTo:(Character space). |
|
3308 |
" |
|
3309 |
kludge to allow use of match-check below |
|
3310 |
" |
|
3311 |
selectors at:changeNr put:snapshotPrefix. |
|
3312 |
classes at:changeNr put:fileName. |
|
3313 |
] |
|
3314 |
] |
|
3315 |
] |
|
3316 |
]. |
|
3317 |
]. |
|
3318 |
aStream close. |
|
3319 |
] ifFalse:[ |
|
3320 |
numChanges to:1 by:-1 do:[:changeNr | |
|
3321 |
|change| |
|
3322 |
||
3323 |
classes at:changeNr put:(self classOfChange:changeNr ifAbsent:[:className| nil]). |
|
3324 |
selectors at:changeNr put:(self selectorOfMethodChange:changeNr). |
|
3325 |
]. |
|
3326 |
]. |
|
3327 |
||
3328 |
"for all changes, look for another class/selector occurrence later |
|
3329 |
in the list and, if there is one, add change number to the delete set" |
|
3330 |
||
3331 |
deleteSet := OrderedCollection new. |
|
3332 |
1 to:self numberOfChanges-1 do:[:changeNr | |
|
3333 |
thisClass := classes at:changeNr. |
|
3334 |
||
3335 |
compressThis := false. |
|
3336 |
aClassNameOrNil isNil ifTrue:[ |
|
3337 |
compressThis := true |
|
3338 |
] ifFalse:[ |
|
3339 |
"/ skipping unloaded/unknown classes |
|
3340 |
thisClass isBehavior ifTrue:[ |
|
3341 |
compressThis := aClassNameOrNil = thisClass theNonMetaclass name. |
|
3342 |
] |
|
3343 |
]. |
|
3344 |
compressThis ifTrue:[ |
|
3345 |
thisSelector := selectors at:changeNr. |
|
3346 |
compressThis := (selectorToCompressOrNil isNil or:[thisSelector == selectorToCompressOrNil]). |
|
3347 |
compressThis ifTrue:[ |
|
3348 |
searchIndex := changeNr. |
|
3349 |
anyMore := true. |
|
3350 |
[anyMore] whileTrue:[ |
|
3351 |
searchIndex := classes indexOf:thisClass startingAt:(searchIndex + 1). |
|
3352 |
(searchIndex ~~ 0) ifTrue:[ |
|
3353 |
((selectors at:searchIndex) == thisSelector) ifTrue:[ |
|
3354 |
thisClass notNil ifTrue:[ |
|
3355 |
deleteSet add:changeNr. |
|
3356 |
anyMore := false |
|
3357 |
] |
|
3358 |
] |
|
3359 |
] ifFalse:[ |
|
3360 |
anyMore := false |
|
3361 |
] |
|
3362 |
]. |
|
3363 |
]. |
|
3364 |
]. |
|
3365 |
]. |
|
3366 |
||
3367 |
"finally delete what has been found" |
|
3368 |
||
3369 |
(deleteSet size > 0) ifTrue:[ |
|
3370 |
changeListView setSelection:nil. |
|
3371 |
index := deleteSet size. |
|
3372 |
[index > 0] whileTrue:[ |
|
3373 |
self silentDeleteChange:(deleteSet at:index). |
|
3374 |
index := index - 1 |
|
3375 |
]. |
|
3376 |
self setChangeList. |
|
3377 |
" |
|
3378 |
scroll back a bit, if we are left way behind the list |
|
3379 |
" |
|
3380 |
changeListView firstLineShown > self numberOfChanges ifTrue:[ |
|
3381 |
changeListView makeLineVisible:self numberOfChanges |
|
3382 |
]. |
|
3383 |
self clearCodeView |
|
3384 |
] |
|
1359 | 3385 |
]. |
3386 |
self newLabel:''. |
|
3387 |
||
7507 | 3388 |
"Created: / 19-11-2001 / 22:03:42 / cg" |
3389 |
"Modified: / 13-11-2006 / 11:00:03 / cg" |
|
1359 | 3390 |
! |
3391 |
||
255 | 3392 |
deleteChange:changeNr |
3393 |
"delete a change" |
|
3394 |
||
3395 |
self deleteChangesFrom:changeNr to:changeNr |
|
3396 |
! |
|
3397 |
||
3398 |
deleteChangesFrom:start to:stop |
|
3399 |
"delete a range of changes" |
|
3400 |
||
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
3401 |
changeListView setSelection:nil. |
255 | 3402 |
stop to:start by:-1 do:[:changeNr | |
6288 | 3403 |
self silentDeleteInternalChange:changeNr. |
255 | 3404 |
]. |
6255 | 3405 |
changeListView removeFromIndex:start toIndex:stop. |
744
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3406 |
|
1070
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
3407 |
"/ changeListView contentsChanged. |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
3408 |
"/ changeListView redrawFromLine:start. |
255 | 3409 |
|
744
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3410 |
"/ self setChangeList |
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3411 |
|
1648 | 3412 |
"Modified: / 18.5.1998 / 14:22:27 / cg" |
255 | 3413 |
! |
3414 |
||
202 | 3415 |
makeChangeAPatch:changeNr |
3416 |
"append change to patchfile" |
|
3417 |
||
3418 |
self appendChange:changeNr toFile:'patches' |
|
3419 |
! |
|
3420 |
||
3421 |
makeChangePermanent:changeNr |
|
3422 |
"rewrite the source file where change changeNr lies" |
|
3423 |
||
3424 |
self notify:'this is not yet implemented' |
|
3425 |
! |
|
3426 |
||
73 | 3427 |
silentDeleteChange:changeNr |
3428 |
"delete a change do not update changeListView" |
|
57 | 3429 |
|
73 | 3430 |
anyChanges := true. |
3431 |
changeChunks removeIndex:changeNr. |
|
3203 | 3432 |
changePositions size >= changeNr ifTrue:[ changePositions removeIndex:changeNr ]. |
3433 |
changeClassNames size >= changeNr ifTrue:[ changeClassNames removeIndex:changeNr ]. |
|
3434 |
changeSelectors size >= changeNr ifTrue:[ changeSelectors removeIndex:changeNr ]. |
|
3435 |
changeHeaderLines size >= changeNr ifTrue:[ changeHeaderLines removeIndex:changeNr ]. |
|
3436 |
changeTimeStamps size >= changeNr ifTrue:[ changeTimeStamps removeIndex:changeNr ]. |
|
3437 |
changeIsFollowupMethodChange size >= changeNr ifTrue:[ changeIsFollowupMethodChange removeIndex:changeNr ]. |
|
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
3438 |
|
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
3439 |
"Modified: 18.11.1995 / 17:08:44 / cg" |
45 | 3440 |
! |
3441 |
||
202 | 3442 |
silentDeleteChangesFor:aClassName from:start to:stop |
1428
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
3443 |
"delete changes for a given class in a range. |
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
3444 |
Return the number of deleted changes." |
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
3445 |
|
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
3446 |
|thisClassName index numDeleted| |
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
3447 |
|
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
3448 |
numDeleted := 0. |
202 | 3449 |
index := stop. |
3450 |
[index >= start] whileTrue:[ |
|
6288 | 3451 |
thisClassName := self classNameOfChange:index. |
3452 |
thisClassName = aClassName ifTrue:[ |
|
3453 |
self silentDeleteChange:index. |
|
3454 |
numDeleted := numDeleted + 1. |
|
3455 |
]. |
|
3456 |
index := index - 1 |
|
1428
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
3457 |
]. |
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
3458 |
^ numDeleted |
51 | 3459 |
|
45 | 3460 |
! |
3461 |
||
3607 | 3462 |
silentDeleteChangesFor:aClassName selector:selector from:start to:stop |
3463 |
"delete changes for given class/selector in a range. |
|
3464 |
Return the number of deleted changes." |
|
3465 |
||
3466 |
|thisClassName index numDeleted| |
|
3467 |
||
3468 |
numDeleted := 0. |
|
3469 |
index := stop. |
|
3470 |
[index >= start] whileTrue:[ |
|
6288 | 3471 |
thisClassName := self classNameOfChange:index. |
3472 |
thisClassName = aClassName ifTrue:[ |
|
3473 |
(self selectorOfMethodChange:index) == selector ifTrue:[ |
|
3474 |
self silentDeleteChange:index. |
|
3475 |
numDeleted := numDeleted + 1. |
|
3476 |
] |
|
3477 |
]. |
|
3478 |
index := index - 1 |
|
3607 | 3479 |
]. |
3480 |
^ numDeleted |
|
3481 |
! |
|
3482 |
||
2511 | 3483 |
silentDeleteChangesForClassAndPrivateClasses:aClassName from:start to:stop |
3484 |
"delete changes for a given class and its private classes in a range. |
|
3485 |
Return the number of deleted changes." |
|
3486 |
||
3487 |
|thisClassName index numDeleted| |
|
3488 |
||
3489 |
numDeleted := 0. |
|
3490 |
index := stop. |
|
3491 |
[index >= start] whileTrue:[ |
|
6288 | 3492 |
thisClassName := self ownerClassNameOfChange:index. |
3493 |
thisClassName = aClassName ifTrue:[ |
|
3494 |
self silentDeleteChange:index. |
|
3495 |
numDeleted := numDeleted + 1. |
|
3496 |
]. |
|
3497 |
index := index - 1 |
|
2511 | 3498 |
]. |
3499 |
^ numDeleted |
|
3500 |
||
3501 |
! |
|
3502 |
||
1070
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
3503 |
silentDeleteInternalChange:changeNr |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
3504 |
"delete a change do not update changeListView" |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
3505 |
|
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
3506 |
anyChanges := true. |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
3507 |
changeChunks removeIndex:changeNr. |
1473 | 3508 |
changePositions size >= changeNr ifTrue:[changePositions removeIndex:changeNr]. |
3509 |
changeClassNames size >= changeNr ifTrue:[changeClassNames removeIndex:changeNr]. |
|
3203 | 3510 |
changeSelectors size >= changeNr ifTrue:[ changeSelectors removeIndex:changeNr ]. |
2394
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
3511 |
changeTimeStamps size >= changeNr ifTrue:[changeTimeStamps removeIndex:changeNr]. |
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
3512 |
changeIsFollowupMethodChange size >= changeNr ifTrue:[changeIsFollowupMethodChange removeIndex:changeNr]. |
1473 | 3513 |
|
3514 |
"Created: / 7.3.1997 / 16:28:32 / cg" |
|
3515 |
"Modified: / 7.2.1998 / 19:59:11 / cg" |
|
1496
978b3c3565c9
#silentDeleteInternalChange: copy-paste error
Stefan Vogel <sv@exept.de>
parents:
1473
diff
changeset
|
3516 |
"Modified: / 26.2.1998 / 18:20:48 / stefan" |
4487 | 3517 |
! |
3518 |
||
3519 |
updateDiffView |
|
3520 |
self withSelectedChangesDo:[:changeNr | |
|
6288 | 3521 |
self updateDiffViewFor:changeNr. |
3522 |
^ self. |
|
4487 | 3523 |
]. |
3524 |
||
3525 |
diffView text1:'' text2:'' |
|
3526 |
! |
|
3527 |
||
3528 |
updateDiffViewFor:changeNr |
|
3529 |
|aStream chunk sawExcla parseTree thisClass cat oldSource newSource |
|
4857 | 3530 |
parser sel showDiff selector oldMethod| |
4487 | 3531 |
|
3532 |
aStream := self streamForChange:changeNr. |
|
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
3533 |
aStream isNil ifTrue:[ |
6317 | 3534 |
^ self |
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
3535 |
]. |
4487 | 3536 |
|
3537 |
showDiff := false. |
|
3538 |
||
3539 |
(self changeIsFollowupMethodChange:changeNr) ifFalse:[ |
|
6317 | 3540 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
3541 |
chunk := aStream nextChunk. |
|
4487 | 3542 |
] ifTrue:[ |
6317 | 3543 |
chunk := (changeChunks at:changeNr). |
3544 |
sawExcla := true. |
|
4487 | 3545 |
]. |
3546 |
||
4857 | 3547 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
3548 |
do:[ |
|
6317 | 3549 |
parseTree := Parser parseExpression:chunk. |
3550 |
(parseTree notNil and:[parseTree ~~ #Error and:[ parseTree isMessage ]]) ifTrue:[ |
|
3551 |
selector := parseTree selector. |
|
3552 |
] |
|
4857 | 3553 |
]. |
3554 |
||
3555 |
selector isNil ifTrue:[ |
|
6317 | 3556 |
newSource := chunk. |
3557 |
oldSource := 'Not comparable.'. |
|
4857 | 3558 |
] ifFalse:[ |
6317 | 3559 |
sawExcla ifFalse:[ |
3560 |
"/ not a method-change |
|
3561 |
newSource := chunk. |
|
3562 |
oldSource := self oldSourceForParseTree:parseTree. |
|
3563 |
] ifTrue:[ |
|
3564 |
"/ a method-change |
|
3565 |
||
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3566 |
(self class methodDefinitionSelectors includes:selector) ifTrue:[ |
6317 | 3567 |
newSource := aStream nextChunk. |
3568 |
||
3569 |
thisClass := (parseTree receiver evaluate). |
|
6378 | 3570 |
thisClass isBehavior ifFalse:[ |
3571 |
thisClass := self classOfChange:changeNr. |
|
3572 |
]. |
|
6317 | 3573 |
thisClass isBehavior ifTrue:[ |
3574 |
(thisClass isLoaded |
|
3575 |
or:[ autoloadAsRequired value |
|
3576 |
and:[self checkClassIsLoaded:thisClass]]) ifFalse:[ |
|
3577 |
oldSource := 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
3578 |
] ifTrue:[ |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3579 |
selector numArgs == 0 ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3580 |
cat := '* as yet uncategorized *'. |
6532 | 3581 |
cat := selector. |
6317 | 3582 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3583 |
cat := parseTree arg1 evaluate. |
6317 | 3584 |
]. |
3585 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
|
3586 |
do:[ |
|
6639 | 3587 |
Error catch:[ |
6317 | 3588 |
parser := Parser parseMethod:newSource in:thisClass. |
3589 |
] |
|
3590 |
]. |
|
3591 |
(parser notNil and:[parser ~~ #Error]) ifTrue:[ |
|
3592 |
sel := parser selector. |
|
3593 |
oldMethod := thisClass compiledMethodAt:sel. |
|
3594 |
oldMethod notNil ifTrue:[ |
|
3595 |
(oldMethod category = cat) ifFalse:[ |
|
6447 | 3596 |
"/ Transcript showCR:'category changed.'. |
6317 | 3597 |
]. |
3598 |
oldSource := oldMethod source. |
|
3599 |
(oldSource = newSource) ifFalse:[ |
|
3600 |
oldSource isNil ifTrue:[ |
|
3601 |
oldSource := 'No source for compare.'. |
|
3602 |
] ifFalse:[ |
|
3603 |
"/ |
|
3604 |
"/ compare for tabulator <-> space changes |
|
3605 |
"/ before showing diff ... |
|
3606 |
"/ |
|
3607 |
oldSource := oldSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
3608 |
newSource := newSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
3609 |
oldSource = newSource ifFalse:[ |
|
3610 |
"/ |
|
3611 |
"/ check if only historyLine diffs |
|
3612 |
"/ |
|
3613 |
(HistoryManager notNil |
|
3614 |
and:[HistoryManager isActive]) ifTrue:[ |
|
3615 |
oldSource := oldSource asStringCollection asString. |
|
3616 |
newSource := newSource asStringCollection asString. |
|
3617 |
(HistoryManager withoutHistoryLines:oldSource) |
|
3618 |
= |
|
3619 |
(HistoryManager withoutHistoryLines:newSource) |
|
3620 |
ifTrue:[ |
|
3621 |
oldSource := (HistoryManager withoutHistoryLines:oldSource). |
|
3622 |
newSource := (HistoryManager withoutHistoryLines:newSource). |
|
3623 |
] |
|
3624 |
]. |
|
3625 |
] |
|
3626 |
] |
|
3627 |
] |
|
3628 |
] ifFalse:[ |
|
3629 |
oldSource := 'Method does not exist.'. |
|
3630 |
] |
|
3631 |
] ifFalse:[ |
|
3632 |
oldSource := 'Change is unparsable (parse error).'. |
|
3633 |
]. |
|
3634 |
]. |
|
3635 |
] ifFalse:[ |
|
3636 |
oldSource := 'Class does not exist.'. |
|
3637 |
] |
|
3638 |
] ifFalse:[ |
|
3639 |
newSource := chunk. "/ aStream contents. |
|
3640 |
oldSource := 'Not comparable.'. |
|
3641 |
] |
|
3642 |
] |
|
4487 | 3643 |
]. |
3644 |
aStream close. |
|
3645 |
||
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
3646 |
oldSource := oldSource ? ''. |
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
3647 |
newSource := newSource ? ''. |
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
3648 |
(oldSource = newSource |
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
3649 |
or:[ oldSource asStringCollection withTabsExpanded = newSource asStringCollection withTabsExpanded]) ifTrue:[ |
6317 | 3650 |
self makeDiffViewInvisible |
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
3651 |
] ifFalse:[ |
6317 | 3652 |
self makeDiffViewVisible. |
3653 |
diffView text1:oldSource text2:newSource. |
|
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
3654 |
]. |
4487 | 3655 |
|
3656 |
"Created: / 24.11.1995 / 14:30:46 / cg" |
|
4699
393443e15c9b
compare fix if historyManager is enabled.
Claus Gittinger <cg@exept.de>
parents:
4632
diff
changeset
|
3657 |
"Modified: / 21.3.2003 / 14:26:58 / cg" |
202 | 3658 |
! ! |
0 | 3659 |
|
202 | 3660 |
!ChangesBrowser methodsFor:'termination'! |
51 | 3661 |
|
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
3662 |
askIfChangesAreToBeWrittenBack |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
3663 |
|action again| |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
3664 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
3665 |
anyChanges ifFalse:[^ self]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
3666 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
3667 |
again := true. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
3668 |
[again] whileTrue:[ |
6357 | 3669 |
action := OptionBox |
3670 |
request:(resources stringWithCRs:'The modified changelist has not been written back to the change file.\\Write change file before closing ?') |
|
3671 |
label:'ChangesBrowser' |
|
3672 |
image:(WarningBox iconBitmap) |
|
3673 |
buttonLabels:(resources array:#('Cancel' 'Don''t Write' 'Write')) |
|
3674 |
values:#(#abort #ignore #save) |
|
3675 |
default:#save |
|
3676 |
onCancel:#abort. |
|
3677 |
||
3678 |
again := false. |
|
3679 |
action == #abort ifTrue:[AbortSignal raise. ^ self]. |
|
3680 |
action == #save ifTrue:[ |
|
3681 |
again := self writeBackChanges not |
|
3682 |
]. |
|
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
3683 |
]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
3684 |
! |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
3685 |
|
1787 | 3686 |
closeRequest |
3687 |
"window manager wants us to go away" |
|
3688 |
||
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
3689 |
self askIfChangesAreToBeWrittenBack. |
1787 | 3690 |
super closeRequest |
3691 |
! |
|
3692 |
||
202 | 3693 |
saveAndTerminate |
3694 |
"update the changes file and quit. |
|
3695 |
Dont depend on this being sent, not all window managers |
|
3696 |
send it; instead, they simply destroy the view." |
|
28 | 3697 |
|
202 | 3698 |
anyChanges ifTrue:[ |
6288 | 3699 |
self writeBackChanges. |
0 | 3700 |
]. |
1787 | 3701 |
super saveAndTerminate |
3702 |
||
3703 |
"Modified: / 3.8.1998 / 19:54:00 / cg" |
|
0 | 3704 |
! ! |
3705 |
||
73 | 3706 |
!ChangesBrowser methodsFor:'user interaction'! |
51 | 3707 |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3708 |
askForSearch:msg initialAnswer:initial thenSearchUsing:searchBlock2 onCancel:cancelBlock |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3709 |
|searchString directionHolder searchBlock| |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3710 |
|
6288 | 3711 |
searchString := self |
3712 |
askForSearchString:msg |
|
3713 |
initialAnswer:initial |
|
3714 |
directionInto:(directionHolder := ValueHolder new). |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3715 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3716 |
searchString isNil ifTrue:[ |
6288 | 3717 |
^ cancelBlock value |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3718 |
]. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3719 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3720 |
searchBlock := [:changeNr | searchBlock2 value:searchString value:changeNr]. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3721 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3722 |
directionHolder value == #backward ifTrue:[ |
6288 | 3723 |
changeNrShown isNil ifTrue:[ |
3724 |
changeNrShown := self numberOfChanges. |
|
3725 |
]. |
|
3726 |
self findPreviousForWhich:searchBlock |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3727 |
] ifFalse:[ |
6288 | 3728 |
changeNrShown isNil ifTrue:[ |
3729 |
changeNrShown := 0. |
|
3730 |
]. |
|
3731 |
self findNextForWhich:searchBlock |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3732 |
]. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3733 |
! |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3734 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3735 |
askForSearchString:msg initialAnswer:initial directionInto:aValueHolder |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3736 |
"common code to open a search box" |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3737 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3738 |
|searchString direction| |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3739 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3740 |
direction := #forward. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3741 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3742 |
Dialog aboutToOpenBoxNotificationSignal handle:[:ex | |
6288 | 3743 |
|box nextButton prevButton| |
3744 |
||
3745 |
box := ex parameter. |
|
3746 |
nextButton := box okButton. |
|
3747 |
prevButton := Button label:(resources string:'Previous'). |
|
3748 |
prevButton action:[direction := #backward. box okPressed.]. |
|
3749 |
box addButton:prevButton after:nextButton. |
|
3750 |
nextButton label:(resources string:'Next'). |
|
3751 |
ex proceed. |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3752 |
] do:[ |
6288 | 3753 |
searchString := Dialog |
3754 |
request:msg |
|
3755 |
initialAnswer:initial |
|
3756 |
onCancel:nil. |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3757 |
]. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3758 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3759 |
searchString isNil ifTrue:[ |
6288 | 3760 |
^ nil |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3761 |
]. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3762 |
aValueHolder value:direction. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3763 |
^ searchString |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3764 |
! |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
3765 |
|
221 | 3766 |
autoUpdate:aBoolean |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3767 |
"enabled/disable automatic update from the change-file (for monitoring)" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3768 |
|
6216 | 3769 |
autoUpdate value:aBoolean |
221 | 3770 |
|
3771 |
"Created: 3.12.1995 / 14:14:24 / cg" |
|
3772 |
"Modified: 3.12.1995 / 14:20:45 / cg" |
|
3773 |
! |
|
3774 |
||
6216 | 3775 |
autoloadAsRequired:aBoolean |
3776 |
"enabled/disable automatic load of unloaded classes" |
|
3777 |
||
3778 |
autoloadAsRequired value:aBoolean |
|
3779 |
! |
|
3780 |
||
3211 | 3781 |
changeSelection:lineNrCollection |
0 | 3782 |
"show a change in the codeView" |
3783 |
||
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3784 |
|chunk lineNr| |
3211 | 3785 |
|
3786 |
lineNrCollection isInteger ifTrue:[ |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3787 |
lineNr := lineNrCollection |
3211 | 3788 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3789 |
changeListView multipleSelectOk ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3790 |
lineNrCollection size == 1 ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3791 |
lineNr := lineNrCollection first. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3792 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3793 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3794 |
lineNr := lineNrCollection |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3795 |
]. |
3211 | 3796 |
]. |
0 | 3797 |
|
2293 | 3798 |
lineNr isNil ifTrue:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3799 |
codeView contents:nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3800 |
codeView initializeDoITAction. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3801 |
changeNrShown := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3802 |
^ self |
2293 | 3803 |
]. |
3804 |
||
3211 | 3805 |
"/ display the changes code |
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3806 |
chunk := self sourceOfChange:lineNr. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3807 |
chunk isNil ifTrue:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3808 |
codeView initializeDoITAction. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3809 |
^ self |
2044 | 3810 |
]. |
0 | 3811 |
codeView contents:chunk. |
13 | 3812 |
codeView acceptAction:[:theCode | self doApply "noChangesAllowed"]. |
2043
66b5276b2760
set self in changesBrowsers doIt.
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
3813 |
codeView doItAction:[:theCode | |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3814 |
|clsName cls| |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3815 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3816 |
clsName := self classNameOfChange:lineNr. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3817 |
clsName notNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3818 |
clsName := clsName asSymbolIfInterned. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3819 |
clsName notNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3820 |
cls := Smalltalk at:clsName ifAbsent:nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3821 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3822 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3823 |
Compiler |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3824 |
evaluate:theCode |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3825 |
in:nil |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3826 |
receiver:cls |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3827 |
notifying:self |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3828 |
logged:true |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3829 |
ifFail:nil |
2043
66b5276b2760
set self in changesBrowsers doIt.
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
3830 |
]. |
15 | 3831 |
changeNrShown := lineNr. |
0 | 3832 |
|
4487 | 3833 |
self showingDiffs value ifTrue:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3834 |
AbortOperationRequest catch:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3835 |
self updateDiffViewFor:changeNrShown. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
3836 |
] |
4487 | 3837 |
]. |
3838 |
||
2044 | 3839 |
"Modified: / 28.2.1999 / 15:26:46 / cg" |
51 | 3840 |
! |
3841 |
||
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
3842 |
classOfChange:changeNr |
3806
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
3843 |
^ self |
6386 | 3844 |
classOfChange:changeNr |
3845 |
ifAbsent:[:className | |
|
3846 |
|msg| |
|
3847 |
||
3848 |
className isNil ifTrue:[ |
|
3849 |
msg := 'Could not extract classname from change'. |
|
3850 |
] ifFalse:[ |
|
3851 |
msg := 'Class not found: ''' , className , ''''. |
|
3852 |
]. |
|
3853 |
"/ self warn:msg. |
|
3854 |
nil |
|
3855 |
] |
|
3806
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
3856 |
! |
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
3857 |
|
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
3858 |
classOfChange:changeNr ifAbsent:exceptionBlock |
4271 | 3859 |
|className cls isMeta ownerClassName ownerClass| |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
3860 |
|
5014 | 3861 |
className := self realClassNameOfChange:changeNr. |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
3862 |
className isNil ifTrue:[ |
6378 | 3863 |
^ exceptionBlock value:nil |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
3864 |
]. |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
3865 |
|
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
3866 |
isMeta := false. |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
3867 |
(className endsWith:' class') ifTrue:[ |
6378 | 3868 |
className := className copyWithoutLast:6. |
3869 |
isMeta := true. |
|
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
3870 |
]. |
3472 | 3871 |
|
3872 |
(cls := (self nameSpaceForApply) classNamed:className) isNil ifTrue:[ |
|
6378 | 3873 |
cls := Smalltalk classNamed:className |
3472 | 3874 |
]. |
3875 |
||
3876 |
cls isNil ifTrue:[ |
|
6378 | 3877 |
(className includes:$:) ifTrue:[ |
3878 |
ownerClassName := className copyTo:(className lastIndexOf:$:)-1. |
|
3879 |
(ownerClassName endsWith:$:) ifTrue:[ |
|
3880 |
ownerClassName := ownerClassName copyWithoutLast:1 |
|
3881 |
]. |
|
3882 |
ownerClass := Smalltalk classNamed:ownerClassName. |
|
3883 |
ownerClass isBehavior ifTrue:[ |
|
3884 |
ownerClass isLoaded ifFalse:[ |
|
3885 |
autoloadAsRequired value == true ifTrue:[ |
|
3886 |
ownerClass autoload. |
|
3887 |
cls := Smalltalk classNamed:className |
|
3888 |
]. |
|
3889 |
]. |
|
3890 |
]. |
|
3891 |
]. |
|
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
3892 |
]. |
6378 | 3893 |
cls isNil ifTrue:[ |
3894 |
^ exceptionBlock value:className |
|
3895 |
]. |
|
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
3896 |
isMeta ifTrue:[ |
6378 | 3897 |
cls := cls class |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
3898 |
]. |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
3899 |
^ cls |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
3900 |
! |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
3901 |
|
202 | 3902 |
doApply |
3903 |
"user wants a change to be applied" |
|
45 | 3904 |
|
3211 | 3905 |
self withSelectedChangesDo:[:changeNr | |
6682 | 3906 |
skipSignal := nil. |
3907 |
(self applyChange:changeNr) ifFalse:[ |
|
3908 |
^ self "/ cancel |
|
3909 |
]. |
|
3910 |
self autoSelect:(changeNr + 1) |
|
202 | 3911 |
] |
45 | 3912 |
! |
3913 |
||
202 | 3914 |
doApplyAll |
3915 |
"user wants all changes to be applied" |
|
37 | 3916 |
|
294 | 3917 |
self withExecuteCursorDo:[ |
6288 | 3918 |
|lastNr "{ Class: SmallInteger }" | |
3919 |
||
3920 |
self clearCodeView. |
|
3921 |
skipSignal isNil ifTrue:[skipSignal := Signal new]. |
|
3922 |
lastNr := self numberOfChanges. |
|
3923 |
1 to:lastNr do:[:changeNr | |
|
3924 |
changeListView setSelection:changeNr. |
|
3925 |
self applyChange:changeNr |
|
3926 |
]. |
|
3927 |
self autoSelectLast |
|
202 | 3928 |
] |
294 | 3929 |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
3930 |
"Modified: 21.1.1997 / 22:26:30 / cg" |
37 | 3931 |
! |
3932 |
||
3668 | 3933 |
doApplyClassFromBeginning |
3934 |
"user wants all changes for this class from 1 to changeNr to be applied" |
|
3935 |
||
3936 |
self withSingleSelectedChangeDo:[:changeNr | |
|
6288 | 3937 |
|thisClassName classNameToApply lastChange |
3938 |
lastNr "{ Class: SmallInteger }" | |
|
3939 |
||
3940 |
classNameToApply := self classNameOfChange:changeNr. |
|
3941 |
classNameToApply notNil ifTrue:[ |
|
3942 |
self clearCodeView. |
|
3943 |
skipSignal isNil ifTrue:[skipSignal := Signal new]. |
|
3944 |
||
3945 |
lastNr := self numberOfChanges. |
|
3946 |
1 to:changeNr do:[:changeNr | |
|
3947 |
thisClassName := self classNameOfChange:changeNr. |
|
3948 |
thisClassName = classNameToApply ifTrue:[ |
|
3949 |
changeListView setSelection:changeNr. |
|
3950 |
self applyChange:changeNr. |
|
3951 |
lastChange := changeNr |
|
3952 |
]. |
|
3953 |
]. |
|
3954 |
self autoSelect:changeNr+1. |
|
3955 |
] |
|
3668 | 3956 |
] |
3957 |
||
3958 |
"Modified: 21.1.1997 / 22:26:04 / cg" |
|
3959 |
! |
|
3960 |
||
202 | 3961 |
doApplyClassRest |
3962 |
"user wants all changes for this class from changeNr to be applied" |
|
3963 |
||
3668 | 3964 |
self withSingleSelectedChangeDo:[:changeNr | |
6288 | 3965 |
|thisClassName classNameToApply lastChange |
3966 |
lastNr "{ Class: SmallInteger }" | |
|
3967 |
||
3968 |
classNameToApply := self classNameOfChange:changeNr. |
|
3969 |
classNameToApply notNil ifTrue:[ |
|
3970 |
self clearCodeView. |
|
3971 |
skipSignal isNil ifTrue:[skipSignal := Signal new]. |
|
3972 |
||
3973 |
lastNr := self numberOfChanges. |
|
3974 |
changeNr to:lastNr do:[:changeNr | |
|
3975 |
thisClassName := self classNameOfChange:changeNr. |
|
3976 |
thisClassName = classNameToApply ifTrue:[ |
|
3977 |
changeListView setSelection:changeNr. |
|
3978 |
self applyChange:changeNr. |
|
3979 |
lastChange := changeNr |
|
3980 |
]. |
|
3981 |
]. |
|
3982 |
self autoSelect:lastChange. |
|
3983 |
] |
|
202 | 3984 |
] |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
3985 |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
3986 |
"Modified: 21.1.1997 / 22:26:04 / cg" |
37 | 3987 |
! |
3988 |
||
3668 | 3989 |
doApplyFromBeginning |
3990 |
"user wants all changes from 1 to changeNr to be applied" |
|
3991 |
||
3992 |
self withSingleSelectedChangeDo:[:changeNr | |
|
6288 | 3993 |
|lastNr "{ Class: SmallInteger }" | |
3994 |
||
3995 |
self clearCodeView. |
|
3996 |
skipSignal isNil ifTrue:[skipSignal := Signal new]. |
|
3997 |
||
3998 |
1 to:changeNr do:[:changeNr | |
|
3999 |
changeListView setSelection:changeNr. |
|
4000 |
self applyChange:changeNr |
|
4001 |
]. |
|
4002 |
self autoSelect:changeNr+1. |
|
3668 | 4003 |
] |
4004 |
! |
|
4005 |
||
202 | 4006 |
doApplyRest |
3806
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
4007 |
"apply all changes from changeNr to the end" |
28 | 4008 |
|
3668 | 4009 |
self withSingleSelectedChangeDo:[:changeNr | |
6288 | 4010 |
|lastNr "{ Class: SmallInteger }" | |
4011 |
||
4012 |
self clearCodeView. |
|
4013 |
skipSignal isNil ifTrue:[skipSignal := Signal new]. |
|
4014 |
||
4015 |
lastNr := self numberOfChanges. |
|
4016 |
changeNr to:lastNr do:[:changeNr | |
|
4017 |
changeListView setSelection:changeNr. |
|
4018 |
self applyChange:changeNr |
|
4019 |
]. |
|
4020 |
self autoSelect:self numberOfChanges. |
|
37 | 4021 |
] |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
4022 |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
4023 |
"Modified: 21.1.1997 / 22:25:29 / cg" |
37 | 4024 |
! |
4025 |
||
3806
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
4026 |
doApplyToConflictOrEnd |
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
4027 |
"apply all changes from changeNr to either a conflict (i.e. method exists) |
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
4028 |
or the end." |
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
4029 |
|
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
4030 |
self withSingleSelectedChangeDo:[:changeNr | |
6288 | 4031 |
|lastNr "{ Class: SmallInteger }"| |
4032 |
||
4033 |
self clearCodeView. |
|
4034 |
skipSignal isNil ifTrue:[skipSignal := Signal new]. |
|
4035 |
||
4036 |
lastNr := self numberOfChanges. |
|
4037 |
changeNr to:lastNr do:[:changeNr | |
|
4038 |
| cls sel | |
|
4039 |
changeListView setSelection:changeNr. |
|
4040 |
||
4041 |
((cls := self classOfChange:changeNr ifAbsent:[:className| nil]) notNil |
|
4042 |
and:[(sel := self selectorOfMethodChange:changeNr) notNil]) |
|
4043 |
ifTrue:[ |
|
4044 |
(cls implements:sel) ifTrue:[ |
|
4045 |
self autoSelect:changeNr. |
|
4046 |
^ self |
|
4047 |
]. |
|
4048 |
]. |
|
4049 |
self applyChange:changeNr |
|
4050 |
]. |
|
4051 |
self autoSelect:self numberOfChanges. |
|
3806
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
4052 |
] |
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
4053 |
! |
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
4054 |
|
45 | 4055 |
doBrowse |
4056 |
"user wants a browser on the class of a change" |
|
4057 |
||
3668 | 4058 |
self withSingleSelectedChangeDo:[:changeNr | |
6288 | 4059 |
|cls| |
4060 |
||
4061 |
cls := self classOfChange:changeNr. |
|
4062 |
cls notNil ifTrue:[ |
|
4063 |
UserPreferences systemBrowserClass |
|
4064 |
openInClass:cls |
|
4065 |
selector:(self selectorOfMethodChange:changeNr) |
|
4066 |
] |
|
37 | 4067 |
] |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4068 |
! |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4069 |
|
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4070 |
doBrowseImplementors |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4071 |
"open an implementors-browser" |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4072 |
|
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4073 |
|changeNr initial selector| |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4074 |
|
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4075 |
(changeNr := self theSingleSelection) notNil ifTrue:[ |
6288 | 4076 |
initial := self selectorOfMethodChange:changeNr. |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4077 |
]. |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4078 |
|
6288 | 4079 |
selector := Dialog |
4080 |
request:'Selector to browse implementors of:' |
|
4081 |
initialAnswer:(initial ? ''). |
|
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4082 |
selector size ~~ 0 ifTrue:[ |
6288 | 4083 |
UserPreferences systemBrowserClass |
4084 |
browseImplementorsMatching:selector. |
|
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4085 |
] |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4086 |
! |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4087 |
|
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4088 |
doBrowseSenders |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4089 |
"user wants a browser on the class of a change" |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4090 |
|
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4091 |
|changeNr initial selector| |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4092 |
|
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4093 |
(changeNr := self theSingleSelection) notNil ifTrue:[ |
6288 | 4094 |
initial := self selectorOfMethodChange:changeNr. |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4095 |
]. |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4096 |
|
6288 | 4097 |
selector := Dialog |
4098 |
request:'Selector to browse senders of:' |
|
4099 |
initialAnswer:(initial ? ''). |
|
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4100 |
selector size ~~ 0 ifTrue:[ |
6288 | 4101 |
UserPreferences systemBrowserClass |
4102 |
browseAllCallsOn:selector asSymbol. |
|
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4103 |
] |
37 | 4104 |
! |
4105 |
||
2541
f8b6ae881564
experimental: checkIn & deleteForClass added.
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
4106 |
doCheckinAndDeleteClassAll |
f8b6ae881564
experimental: checkIn & deleteForClass added.
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
4107 |
"first checkin the selected changes class then delete all changes |
f8b6ae881564
experimental: checkIn & deleteForClass added.
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
4108 |
for it." |
f8b6ae881564
experimental: checkIn & deleteForClass added.
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
4109 |
|
6605
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4110 |
|classes answer logTitle checkinInfo| |
3442 | 4111 |
|
4112 |
"/ self theSingleSelection isNil ifTrue:[ |
|
4113 |
"/ ^ self information:'Only possible if a single change is selected.'. |
|
4114 |
"/ ]. |
|
4115 |
||
4116 |
self withExecuteCursorDo:[ |
|
6605
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4117 |
classes := IdentitySet new. |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4118 |
|
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4119 |
self withSelectedChangesDo:[:changeNr | |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4120 |
| className class | |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4121 |
|
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4122 |
className := self classNameOfChange:changeNr. |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4123 |
className notNil ifTrue:[ |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4124 |
class := Smalltalk classNamed:className. |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4125 |
class isNil ifTrue:[ |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4126 |
self error:'oops - no class: ', className mayProceed:true. |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4127 |
]. |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4128 |
class notNil ifTrue:[ |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4129 |
class := class theNonMetaclass. |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4130 |
(classes includes:class) ifFalse:[ |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4131 |
class isPrivate ifTrue:[ |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4132 |
(classes includes:class owningClass) ifFalse:[ |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4133 |
answer := self confirmWithCancel:('This is a private class.\\CheckIn the owner ''%1'' and all of its private classes ?' |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4134 |
bindWith:class owningClass name allBold) withCRs. |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4135 |
answer isNil ifTrue:[^ self]. |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4136 |
answer ifTrue:[ |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4137 |
classes add:class owningClass |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4138 |
] |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4139 |
] |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4140 |
] ifFalse:[ |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4141 |
classes add:class |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4142 |
]. |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4143 |
] |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4144 |
] |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4145 |
] |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4146 |
]. |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4147 |
|
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4148 |
classes size == 1 ifTrue:[ |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4149 |
logTitle := classes first name. |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4150 |
] ifFalse:[ |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4151 |
logTitle := '%1 classes' bindWith:classes size. |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4152 |
]. |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4153 |
checkinInfo := SourceCodeManagerUtilities |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4154 |
getCheckinInfoFor:logTitle |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4155 |
initialAnswer:nil. |
6977 | 4156 |
checkinInfo isNil ifTrue:[^ self ]. |
6605
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4157 |
|
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4158 |
changeListView setSelection:nil. |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4159 |
classes do:[:eachClass | |
6977 | 4160 |
(SourceCodeManagerUtilities checkinClass:eachClass withInfo:checkinInfo) |
6605
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4161 |
ifTrue:[ |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4162 |
self silentDeleteChangesForClassAndPrivateClasses:eachClass name |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4163 |
from:1 to:(self numberOfChanges). |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4164 |
] |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4165 |
]. |
255a3095ad5d
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
6532
diff
changeset
|
4166 |
self setChangeList. |
2541
f8b6ae881564
experimental: checkIn & deleteForClass added.
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
4167 |
] |
f8b6ae881564
experimental: checkIn & deleteForClass added.
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
4168 |
|
3442 | 4169 |
"Modified: / 6.9.1995 / 17:11:16 / claus" |
4170 |
"Modified: / 17.11.2001 / 14:21:13 / cg" |
|
2541
f8b6ae881564
experimental: checkIn & deleteForClass added.
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
4171 |
! |
f8b6ae881564
experimental: checkIn & deleteForClass added.
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
4172 |
|
73 | 4173 |
doCompare |
4174 |
"compare change with current system version |
|
4175 |
- give a note in transcript" |
|
4176 |
||
3668 | 4177 |
self withSingleSelectedChangeDo:[:changeNr | |
6288 | 4178 |
self withExecuteCursorDo:[ |
4179 |
self compareChange:changeNr |
|
4180 |
]. |
|
4181 |
self newLabel:'' |
|
3211 | 4182 |
]. |
4183 |
||
394 | 4184 |
"Modified: 24.2.1996 / 19:37:19 / cg" |
73 | 4185 |
! |
4186 |
||
2835 | 4187 |
doCompareAndCompress |
4188 |
"remove all changes, which are equivalent to the current image version" |
|
4189 |
||
4190 |
|toDelete| |
|
4191 |
||
4192 |
toDelete := OrderedCollection new. |
|
4193 |
self withExecuteCursorDo:[ |
|
6288 | 4194 |
1 to:self numberOfChanges do:[:changeNr | |
4195 |
[ |
|
4196 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
|
4197 |
toDelete add:changeNr |
|
4198 |
] |
|
4199 |
] on:AbortOperationRequest do:[:ex| "ignore unloaded clases" ] |
|
4200 |
]. |
|
2835 | 4201 |
]. |
4202 |
||
4203 |
toDelete reverseDo:[:changeNr | |
|
6288 | 4204 |
self silentDeleteChange:changeNr. |
2835 | 4205 |
]. |
4206 |
self setChangeList. |
|
4207 |
" |
|
4208 |
scroll back a bit, if we are left way behind the list |
|
4209 |
" |
|
4210 |
changeListView firstLineShown > self numberOfChanges ifTrue:[ |
|
6288 | 4211 |
changeListView makeLineVisible:self numberOfChanges |
2835 | 4212 |
]. |
4213 |
self clearCodeView. |
|
4214 |
||
4215 |
self newLabel:'' |
|
4216 |
! |
|
4217 |
||
45 | 4218 |
doCompress |
6288 | 4219 |
"compress the change-set; this replaces multiple method-changes by the last |
45 | 4220 |
(i.e. the most recent) change" |
4221 |
||
1359 | 4222 |
self compressForClass:nil |
4223 |
||
4224 |
"Modified: / 29.10.1997 / 01:03:26 / cg" |
|
4225 |
! |
|
4226 |
||
4227 |
doCompressClass |
|
4228 |
"compress changes for the selected class. |
|
4229 |
this replaces multiple method-changes by the last (i.e. the most recent) change." |
|
4230 |
||
3211 | 4231 |
self theSingleSelection isNil ifTrue:[ |
6288 | 4232 |
^ self information:'Only possible if a single change is selected.'. |
3211 | 4233 |
]. |
4234 |
||
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4235 |
self selectedClassNames do:[:classNameToCompress | |
6288 | 4236 |
self compressForClass:classNameToCompress. |
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4237 |
] |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4238 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4239 |
"Created: / 29.10.1997 / 01:05:16 / cg" |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4240 |
"Modified: / 19.11.2001 / 21:55:17 / cg" |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4241 |
! |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4242 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4243 |
doCompressSelector |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4244 |
"compress changes for the selected class & selector. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4245 |
this replaces multiple method-changes by the last (i.e. the most recent) change." |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4246 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4247 |
|classSelectorPairs| |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4248 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4249 |
self theSingleSelection isNil ifTrue:[ |
6288 | 4250 |
^ self information:'Only possible if a single change is selected.'. |
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4251 |
]. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4252 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4253 |
classSelectorPairs := Set new. |
3211 | 4254 |
self withSelectedChangesDo:[:changeNr | |
6288 | 4255 |
| classNameToCompress selector | |
4256 |
||
4257 |
classNameToCompress := self classNameOfChange:changeNr. |
|
4258 |
classNameToCompress notNil ifTrue:[ |
|
4259 |
selector := self selectorOfMethodChange:changeNr. |
|
4260 |
selector notNil ifTrue:[ |
|
4261 |
classSelectorPairs add:(classNameToCompress -> selector). |
|
4262 |
] |
|
4263 |
] |
|
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4264 |
]. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4265 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4266 |
classSelectorPairs do:[:pair | |
6288 | 4267 |
self compressForClass:pair key selector:pair value. |
1359 | 4268 |
] |
4269 |
||
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4270 |
"Created: / 19.11.2001 / 21:50:59 / cg" |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4271 |
"Modified: / 19.11.2001 / 22:10:08 / cg" |
45 | 4272 |
! |
4273 |
||
202 | 4274 |
doDelete |
3211 | 4275 |
"delete currently selected change(s)" |
4276 |
||
6255 | 4277 |
|rangeEnd rangeStart firstDeleted| |
4278 |
||
4279 |
changeListView selection size <= 5 ifTrue:[ |
|
6288 | 4280 |
self withSelectedChangesReverseDo:[:changeNr | |
4281 |
self deleteChange:changeNr. |
|
4282 |
self autoSelectOrEnd:changeNr |
|
4283 |
]. |
|
4284 |
^ self |
|
6255 | 4285 |
]. |
4286 |
||
3211 | 4287 |
self withSelectedChangesReverseDo:[:changeNr | |
6288 | 4288 |
rangeEnd isNil ifTrue:[ |
4289 |
rangeEnd := rangeStart := changeNr |
|
4290 |
] ifFalse:[ |
|
4291 |
(changeNr = (rangeEnd + 1)) ifTrue:[ |
|
4292 |
rangeEnd := changeNr |
|
4293 |
] ifFalse:[ |
|
4294 |
(changeNr = (rangeStart - 1)) ifTrue:[ |
|
4295 |
rangeStart := changeNr |
|
4296 |
] ifFalse:[ |
|
4297 |
self deleteChangesFrom:rangeStart to:rangeEnd. |
|
4298 |
firstDeleted := (firstDeleted ? rangeStart) min:rangeStart. |
|
4299 |
rangeStart := rangeEnd := nil. |
|
4300 |
]. |
|
4301 |
]. |
|
4302 |
]. |
|
6255 | 4303 |
]. |
4304 |
rangeStart notNil ifTrue:[ |
|
6288 | 4305 |
self deleteChangesFrom:rangeStart to:rangeEnd. |
4306 |
firstDeleted := (firstDeleted ? rangeStart) min:rangeStart. |
|
6255 | 4307 |
]. |
4308 |
self autoSelectOrEnd:firstDeleted |
|
73 | 4309 |
! |
4310 |
||
3249 | 4311 |
doDeleteAndSelectPrevious |
4312 |
"delete currently selected change(s)" |
|
4313 |
||
4314 |
self withSelectedChangesReverseDo:[:changeNr | |
|
6288 | 4315 |
self deleteChange:changeNr. |
4316 |
self autoSelectOrEnd:changeNr-1 |
|
3249 | 4317 |
] |
4318 |
! |
|
4319 |
||
202 | 4320 |
doDeleteClassAll |
4321 |
"delete all changes with same class as currently selected change" |
|
4322 |
||
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4323 |
|classNamesToDelete lastChangeNr overAllNumDeletedBefore| |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4324 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4325 |
lastChangeNr := -1. |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4326 |
classNamesToDelete := Set new. |
3211 | 4327 |
self withSelectedChangesDo:[:changeNr | |
6288 | 4328 |
|classNameToDelete| |
4329 |
||
4330 |
classNameToDelete := self classNameOfChange:changeNr. |
|
4331 |
classNameToDelete notNil ifTrue:[ |
|
4332 |
classNamesToDelete add:classNameToDelete. |
|
4333 |
]. |
|
4334 |
lastChangeNr := lastChangeNr max:changeNr. |
|
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4335 |
]. |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4336 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4337 |
overAllNumDeletedBefore := 0. |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4338 |
changeListView setSelection:nil. |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4339 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4340 |
self withExecuteCursorDo:[ |
6288 | 4341 |
classNamesToDelete do:[:classNameToDelete | |
4342 |
|numDeletedBefore| |
|
4343 |
||
4344 |
self silentDeleteChangesFor:classNameToDelete |
|
4345 |
from:lastChangeNr |
|
4346 |
to:(self numberOfChanges). |
|
4347 |
numDeletedBefore := self |
|
4348 |
silentDeleteChangesFor:classNameToDelete |
|
4349 |
from:1 |
|
4350 |
to:(lastChangeNr-1). |
|
4351 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
4352 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
4353 |
]. |
|
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4354 |
]. |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4355 |
|
6288 | 4356 |
self setChangeList. |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4357 |
self autoSelectOrEnd:lastChangeNr |
286
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
4358 |
|
1431 | 4359 |
"Created: / 13.12.1995 / 16:07:14 / cg" |
4360 |
"Modified: / 28.1.1998 / 20:42:14 / 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
|
4361 |
! |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
4362 |
|
2511 | 4363 |
doDeleteClassAndPrivateClassesAll |
4364 |
"delete all changes with same class and private classes |
|
4365 |
as currently selected change" |
|
4366 |
||
6200 | 4367 |
|lastChangeNr classNamesToDelete overAllNumDeletedBefore| |
4368 |
||
4369 |
lastChangeNr := -1. |
|
4370 |
classNamesToDelete := Set new. |
|
3211 | 4371 |
self withSelectedChangesDo:[:changeNr | |
6288 | 4372 |
|classNameToDelete| |
4373 |
||
4374 |
classNameToDelete := self ownerClassNameOfChange:changeNr. |
|
4375 |
classNameToDelete notNil ifTrue:[ |
|
4376 |
classNamesToDelete add:classNameToDelete. |
|
4377 |
]. |
|
4378 |
lastChangeNr := lastChangeNr max:changeNr. |
|
6200 | 4379 |
]. |
4380 |
||
4381 |
overAllNumDeletedBefore := 0. |
|
4382 |
changeListView setSelection:nil. |
|
4383 |
||
4384 |
self withExecuteCursorDo:[ |
|
6288 | 4385 |
classNamesToDelete do:[:classNameToDelete | |
4386 |
| changeNr numDeletedBefore| |
|
4387 |
||
4388 |
classNameToDelete notNil ifTrue:[ |
|
4389 |
changeListView setSelection:nil. |
|
4390 |
self silentDeleteChangesForClassAndPrivateClasses:classNameToDelete |
|
4391 |
from:lastChangeNr |
|
4392 |
to:(self numberOfChanges). |
|
4393 |
numDeletedBefore := self |
|
4394 |
silentDeleteChangesForClassAndPrivateClasses:classNameToDelete |
|
4395 |
from:1 |
|
4396 |
to:(lastChangeNr-1). |
|
4397 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
4398 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
4399 |
] |
|
4400 |
] |
|
6200 | 4401 |
]. |
6288 | 4402 |
self setChangeList. |
6200 | 4403 |
self autoSelectOrEnd:lastChangeNr |
2511 | 4404 |
|
4405 |
"Created: / 13.12.1995 / 16:07:14 / cg" |
|
4406 |
"Modified: / 28.1.1998 / 20:42:14 / cg" |
|
4407 |
! |
|
4408 |
||
286
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
4409 |
doDeleteClassFromBeginning |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
4410 |
"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
|
4411 |
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
|
4412 |
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
|
4413 |
|
3668 | 4414 |
self withSingleSelectedChangeDo:[:changeNr | |
6288 | 4415 |
|classNameToDelete prevSelection numDeleted| |
4416 |
||
4417 |
classNameToDelete := self classNameOfChange:changeNr. |
|
4418 |
classNameToDelete notNil ifTrue:[ |
|
4419 |
prevSelection := changeNr. |
|
4420 |
changeListView setSelection:nil. |
|
4421 |
numDeleted := self |
|
4422 |
silentDeleteChangesFor:classNameToDelete |
|
4423 |
from:1 |
|
4424 |
to:changeNr. |
|
4425 |
self setChangeList. |
|
4426 |
self autoSelectOrEnd:(changeNr + 1 - numDeleted) |
|
4427 |
] |
|
1428
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
4428 |
]. |
286
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
4429 |
|
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
4430 |
"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
|
4431 |
"Modified: 25.5.1996 / 12:26:34 / cg" |
51 | 4432 |
! |
4433 |
||
73 | 4434 |
doDeleteClassRest |
4435 |
"delete rest of changes with same class as currently selected change" |
|
4436 |
||
3668 | 4437 |
self withSingleSelectedChangeDo:[:changeNr | |
6288 | 4438 |
| classNameToDelete | |
4439 |
||
4440 |
classNameToDelete := self classNameOfChange:changeNr. |
|
4441 |
classNameToDelete notNil ifTrue:[ |
|
4442 |
changeListView setSelection:nil. |
|
4443 |
self silentDeleteChangesFor:classNameToDelete |
|
4444 |
from:changeNr |
|
4445 |
to:(self numberOfChanges). |
|
4446 |
self setChangeList. |
|
4447 |
self autoSelectOrEnd:changeNr |
|
4448 |
] |
|
73 | 4449 |
] |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
4450 |
|
1648 | 4451 |
"Modified: / 18.5.1998 / 14:25:07 / cg" |
73 | 4452 |
! |
4453 |
||
3607 | 4454 |
doDeleteClassSelectorAll |
4455 |
"delete all changes with same class and selector as currently selected change" |
|
4456 |
||
4457 |
|classNameSelectorPairsToDelete lastChangeNr overAllNumDeletedBefore| |
|
4458 |
||
4459 |
lastChangeNr := -1. |
|
4460 |
classNameSelectorPairsToDelete := Set new. |
|
4461 |
self withSelectedChangesDo:[:changeNr | |
|
6288 | 4462 |
|className selector| |
4463 |
||
4464 |
className := self classNameOfChange:changeNr. |
|
4465 |
selector := self selectorOfMethodChange:changeNr. |
|
4466 |
selector notNil ifTrue:[ |
|
4467 |
(className notNil and:[selector notNil]) ifTrue:[ |
|
4468 |
classNameSelectorPairsToDelete add:(className -> selector). |
|
4469 |
] |
|
4470 |
]. |
|
4471 |
lastChangeNr := lastChangeNr max:changeNr. |
|
3607 | 4472 |
]. |
4473 |
||
4474 |
overAllNumDeletedBefore := 0. |
|
4475 |
changeListView setSelection:nil. |
|
4476 |
||
4477 |
self withExecuteCursorDo:[ |
|
6288 | 4478 |
classNameSelectorPairsToDelete do:[:pair | |
4479 |
|numDeletedBefore className selector| |
|
4480 |
||
4481 |
className := pair key. |
|
4482 |
selector := pair value. |
|
4483 |
self silentDeleteChangesFor:className selector:selector |
|
4484 |
from:lastChangeNr |
|
4485 |
to:(self numberOfChanges). |
|
4486 |
numDeletedBefore := self |
|
4487 |
silentDeleteChangesFor:className selector:selector |
|
4488 |
from:1 |
|
4489 |
to:(lastChangeNr-1). |
|
4490 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
4491 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
4492 |
]. |
|
3607 | 4493 |
]. |
4494 |
||
6288 | 4495 |
self setChangeList. |
3607 | 4496 |
self autoSelectOrEnd:lastChangeNr |
4497 |
||
4498 |
"Created: / 13.12.1995 / 16:07:14 / cg" |
|
4499 |
"Modified: / 28.1.1998 / 20:42:14 / cg" |
|
4500 |
! |
|
4501 |
||
4896 | 4502 |
doDeleteFromBeginning |
4503 |
"delete all changes from 1 to the current" |
|
4504 |
||
4505 |
self withSingleSelectedChangeDo:[:changeNr | |
|
6288 | 4506 |
self deleteChangesFrom:1 to:changeNr. |
4507 |
self clearCodeView. |
|
4508 |
self autoSelectOrEnd:changeNr |
|
4896 | 4509 |
] |
4510 |
! |
|
4511 |
||
202 | 4512 |
doDeleteRest |
4513 |
"delete all changes from current to the end" |
|
51 | 4514 |
|
3668 | 4515 |
self withSingleSelectedChangeDo:[:changeNr | |
6288 | 4516 |
self deleteChangesFrom:changeNr to:(self numberOfChanges). |
4517 |
self clearCodeView. |
|
4518 |
self autoSelectOrEnd:changeNr-1 |
|
3668 | 4519 |
] |
132 | 4520 |
! |
4521 |
||
4522 |
doFileoutAndDeleteClassAll |
|
4523 |
"first fileOut the selected changes class then delete all changes |
|
4524 |
for it." |
|
4525 |
||
3668 | 4526 |
self withSingleSelectedChangeDo:[:changeNr | |
6288 | 4527 |
| className class | |
4528 |
||
4529 |
className := self classNameOfChange:changeNr. |
|
4530 |
className notNil ifTrue:[ |
|
4531 |
class := Smalltalk classNamed:className. |
|
4532 |
class notNil ifTrue:[ |
|
4533 |
Class fileOutErrorSignal handle:[:ex | |
|
4534 |
self warn:('fileout failed: ' , ex description). |
|
4535 |
] do:[ |
|
4536 |
class fileOut. |
|
4537 |
self doDeleteClassAll |
|
4538 |
]. |
|
4539 |
]. |
|
4540 |
||
4541 |
]. |
|
132 | 4542 |
] |
4543 |
||
4544 |
"Modified: 6.9.1995 / 17:11:16 / claus" |
|
202 | 4545 |
! |
73 | 4546 |
|
202 | 4547 |
doMakePatch |
4548 |
"user wants a change to be made a patch |
|
4549 |
- copy it over to the patches file" |
|
89 | 4550 |
|
3211 | 4551 |
self withSelectedChangesDo:[:changeNr | |
6288 | 4552 |
self makeChangeAPatch:changeNr. |
4553 |
self autoSelect:(changeNr + 1) |
|
202 | 4554 |
] |
73 | 4555 |
! |
4556 |
||
202 | 4557 |
doMakePermanent |
4558 |
"user wants a change to be made permanent |
|
4559 |
- rewrite the source file where this change has to go" |
|
4560 |
||
4561 |
|yesNoBox| |
|
73 | 4562 |
|
3211 | 4563 |
(self theSingleSelection) isNil ifTrue:[ |
6639 | 4564 |
^ self information:'Only possible if a single change is selected.'. |
3211 | 4565 |
]. |
4566 |
||
202 | 4567 |
yesNoBox := YesNoBox new. |
6639 | 4568 |
yesNoBox title:(resources string:'Warning: this operation cannot be undone'). |
4569 |
yesNoBox okText:(resources string:'continue') noText:(resources string:'abort'). |
|
202 | 4570 |
yesNoBox okAction:[ |changeNr| |
4571 |
||
6639 | 4572 |
changeNr := self theSingleSelection. |
4573 |
changeNr notNil ifTrue:[ |
|
4574 |
self makeChangePermanent:changeNr. |
|
4575 |
self autoSelect:(changeNr + 1) |
|
4576 |
] |
|
4577 |
]. |
|
917 | 4578 |
yesNoBox showAtPointer. |
4579 |
yesNoBox destroy |
|
4580 |
||
4581 |
"Modified: 7.1.1997 / 23:03:33 / cg" |
|
73 | 4582 |
! |
4583 |
||
202 | 4584 |
doSave |
4585 |
"user wants a change to be appended to a file" |
|
73 | 4586 |
|
3211 | 4587 |
|fileName| |
4588 |
||
4589 |
self withSelectedChangesDo:[:changeNr | |
|
6288 | 4590 |
fileName := Dialog |
4591 |
requestFileName:'Append change to:' |
|
4592 |
default:(lastSaveFileName ? '') |
|
4593 |
ok:'Append' |
|
4594 |
abort:'Abort' |
|
4595 |
pattern:'*.chg'. |
|
4596 |
||
4597 |
fileName notNil ifTrue:[ |
|
4598 |
lastSaveFileName := fileName. |
|
4599 |
self withCursor:(Cursor write) do:[ |
|
4600 |
self appendChange:changeNr toFile:fileName. |
|
4601 |
]. |
|
4602 |
self autoSelect:(changeNr + 1) |
|
4603 |
]. |
|
202 | 4604 |
] |
73 | 4605 |
! |
4606 |
||
202 | 4607 |
doSaveClass |
4608 |
"user wants changes for some class from current to end to be appended to a file" |
|
89 | 4609 |
|
3211 | 4610 |
(self theSingleSelection) isNil ifTrue:[ |
6288 | 4611 |
^ self information:'Only possible if a single change is selected.'. |
3211 | 4612 |
]. |
202 | 4613 |
self doSaveClassFrom:1 |
89 | 4614 |
! |
4615 |
||
202 | 4616 |
doSaveClassAll |
4617 |
"user wants changes for some class from current to end to be appended to a file" |
|
73 | 4618 |
|
3211 | 4619 |
(self theSingleSelection) isNil ifTrue:[ |
6288 | 4620 |
^ self information:'Only possible if a single change is selected.'. |
3211 | 4621 |
]. |
202 | 4622 |
self doSaveClassFrom:1 |
4623 |
! |
|
4624 |
||
4625 |
doSaveClassFrom:startNr |
|
4626 |
"user wants changes from current to end to be appended to a file" |
|
4627 |
||
4628 |
|changeNr classNameToSave| |
|
73 | 4629 |
|
3211 | 4630 |
(changeNr := self theSingleSelection) isNil ifTrue:[ |
6288 | 4631 |
^ self information:'Only possible if a single change is selected.'. |
3211 | 4632 |
]. |
4633 |
classNameToSave := self classNameOfChange:changeNr. |
|
4634 |
classNameToSave notNil ifTrue:[ |
|
6288 | 4635 |
self saveClass:classNameToSave from:startNr |
202 | 4636 |
] |
4637 |
! |
|
73 | 4638 |
|
202 | 4639 |
doSaveClassRest |
4640 |
"user wants changes for some class from current to end to be appended to a file" |
|
73 | 4641 |
|
202 | 4642 |
|changeNr| |
132 | 4643 |
|
3211 | 4644 |
(changeNr := self theSingleSelection) isNil ifTrue:[ |
6317 | 4645 |
^ self information:'Only possible if a single change is selected.'. |
3211 | 4646 |
]. |
6317 | 4647 |
self doSaveClassFrom:changeNr. |
4648 |
||
4649 |
changeListView setSelection:changeNr. |
|
4650 |
"/ self changeSelection:changeNr. |
|
81 | 4651 |
! |
4652 |
||
202 | 4653 |
doSaveRest |
4654 |
"user wants changes from current to end to be appended to a file" |
|
73 | 4655 |
|
202 | 4656 |
|changeNr fileName| |
51 | 4657 |
|
3211 | 4658 |
(changeNr := self theSingleSelection) isNil ifTrue:[ |
6288 | 4659 |
^ self information:'Only possible if a single change is selected.'. |
3211 | 4660 |
]. |
4661 |
||
4662 |
fileName := Dialog |
|
6288 | 4663 |
requestFileName:'Append changes to:' |
4664 |
default:(lastSaveFileName ? '') |
|
4665 |
ok:'Append' |
|
4666 |
abort:'Abort' |
|
4667 |
pattern:'*.chg'. |
|
3211 | 4668 |
|
4669 |
fileName notNil ifTrue:[ |
|
6288 | 4670 |
lastSaveFileName := fileName. |
4671 |
self withCursor:(Cursor write) do:[ |
|
4672 |
changeNr to:(self numberOfChanges) do:[:changeNr | |
|
4673 |
changeListView setSelection:changeNr. |
|
4674 |
(self appendChange:changeNr toFile:fileName) ifFalse:[ |
|
4675 |
^ self |
|
4676 |
] |
|
4677 |
] |
|
4678 |
] |
|
202 | 4679 |
] |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
4680 |
|
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
4681 |
"Modified: 25.5.1996 / 12:26:41 / cg" |
51 | 4682 |
! |
4683 |
||
202 | 4684 |
doUpdate |
4685 |
"reread the changes-file" |
|
51 | 4686 |
|
202 | 4687 |
self readChangesFileInBackground:true. |
5178 | 4688 |
self newLabel:''. |
202 | 4689 |
realized ifTrue:[ |
6288 | 4690 |
self setChangeList. |
202 | 4691 |
] |
51 | 4692 |
! |
4693 |
||
202 | 4694 |
doWriteBack |
4695 |
"write back the list onto the changes file" |
|
51 | 4696 |
|
4697 |
anyChanges ifTrue:[ |
|
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4698 |
(self writeBackChanges) ifTrue:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4699 |
realized ifTrue:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4700 |
self readChangesFile. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4701 |
realized ifTrue:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4702 |
self setChangeList |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4703 |
] |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4704 |
] |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4705 |
] |
202 | 4706 |
] |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4707 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4708 |
"Modified: 5.9.1996 / 17:19:46 / cg" |
202 | 4709 |
! |
126 | 4710 |
|
1471 | 4711 |
doubleClickOnChange:lineNr |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4712 |
"action performed when a change-list entry is doubleClicked" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4713 |
|
1471 | 4714 |
self doBrowse |
4715 |
||
4716 |
"Created: / 6.2.1998 / 13:08:49 / cg" |
|
4717 |
! |
|
4718 |
||
1127 | 4719 |
findClass |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4720 |
"findClass menu action: let user enter a classes name, and select the next change for that class" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4721 |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4722 |
|current| |
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4723 |
|
1127 | 4724 |
changeNrShown notNil ifTrue:[ |
6288 | 4725 |
current := self classNameOfChange:changeNrShown. |
1127 | 4726 |
]. |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4727 |
|
6288 | 4728 |
self |
4729 |
askForSearch:'Class to search for:' |
|
4730 |
initialAnswer:current |
|
4731 |
thenSearchUsing:[:searchString :changeNr | |
|
4732 |
|thisClass| |
|
4733 |
||
4734 |
thisClass := self classNameOfChange:changeNr. |
|
4735 |
(thisClass = searchString |
|
4736 |
or:[searchString includesMatchCharacters and:[searchString match:thisClass]]) |
|
4737 |
] |
|
4738 |
onCancel:[^ self]. |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4739 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4740 |
lastSearchType := #class. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4741 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4742 |
! |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4743 |
|
7360 | 4744 |
findLastSnapshot |
4745 |
"findLastSnapshot menu action: select the last change which is for a snapShot-image save action" |
|
4746 |
||
7363 | 4747 |
"/ lastSearchType := #snapshot. |
7360 | 4748 |
|
4749 |
self |
|
4750 |
findPreviousForWhich: [:changeNr | self changeIsSnapShotInfo:changeNr ] |
|
4751 |
startingAt:(self numberOfChanges) |
|
4752 |
||
4753 |
"Created: / 06-10-2006 / 11:03:39 / cg" |
|
4754 |
! |
|
4755 |
||
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4756 |
findNext |
6288 | 4757 |
"findNext menu action: select the next change. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4758 |
Searches for what the last search was for; i.e. either same class or same selector" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4759 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4760 |
lastSearchType == #selector ifTrue:[ |
6288 | 4761 |
^ self findNextForSelector |
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4762 |
]. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4763 |
lastSearchType == #snapshot ifTrue:[ |
6288 | 4764 |
^ self findNextSnapshot |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4765 |
]. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4766 |
lastSearchType == #string ifTrue:[ |
6288 | 4767 |
^ self findNextForString |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4768 |
]. |
3534 | 4769 |
lastSearchType == #difference ifTrue:[ |
6288 | 4770 |
^ self findNextDifference |
3534 | 4771 |
]. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4772 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4773 |
^ self findNextForClass |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4774 |
|
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4775 |
"Created: / 18.6.1998 / 22:15:00 / cg" |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4776 |
"Modified: / 18.6.1998 / 22:15:25 / cg" |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4777 |
! |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4778 |
|
3534 | 4779 |
findNextDifference |
4780 |
lastSearchType := #difference. |
|
4781 |
changeNrShown isNil ifTrue:[^ self]. |
|
4782 |
||
6288 | 4783 |
self findNextForWhich:[:changeNr | |
4784 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
|
4785 |
"/ same |
|
4786 |
false |
|
4787 |
] ifFalse:[ |
|
4788 |
"/ different |
|
4789 |
true |
|
4790 |
] |
|
4791 |
] |
|
3534 | 4792 |
! |
4793 |
||
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4794 |
findNextForClass |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4795 |
"findNextForClass menu action: select the next change for the selected changes class" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4796 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4797 |
|cls| |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4798 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4799 |
lastSearchType := #class. |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4800 |
changeNrShown isNil ifTrue:[^ self]. |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4801 |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4802 |
cls := self classNameOfChange:changeNrShown. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4803 |
cls isNil ifTrue:[^ self]. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4804 |
|
6288 | 4805 |
self findNextForWhich:[:changeNr | |
4806 |
|thisClass| |
|
4807 |
||
4808 |
thisClass := self classNameOfChange:changeNr. |
|
4809 |
(thisClass = cls |
|
4810 |
or:[cls includesMatchCharacters and:[cls match:thisClass]]) |
|
4811 |
] |
|
3341
8f156ac559d5
fixed matching in find actions
Claus Gittinger <cg@exept.de>
parents:
3339
diff
changeset
|
4812 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4813 |
! |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4814 |
|
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4815 |
findNextForSelector |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4816 |
"findNextForSelector menu action: select the next change for the selected changes selector" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4817 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4818 |
|sel| |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4819 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4820 |
lastSearchType := #selector. |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4821 |
changeNrShown isNil ifTrue:[^ self]. |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4822 |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4823 |
sel := self selectorOfMethodChange:changeNrShown. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4824 |
sel isNil ifTrue:[^ self]. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4825 |
|
6288 | 4826 |
self findNextForWhich: [:changeNr | |
4827 |
|thisSelector| |
|
4828 |
||
4829 |
thisSelector := self selectorOfMethodChange:changeNr. |
|
4830 |
(thisSelector = sel or:[sel includesMatchCharacters and:[sel match:thisSelector]]) |
|
4831 |
] |
|
3341
8f156ac559d5
fixed matching in find actions
Claus Gittinger <cg@exept.de>
parents:
3339
diff
changeset
|
4832 |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4833 |
! |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4834 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4835 |
findNextForString |
4458 | 4836 |
lastSearchString isNil ifTrue:[ |
6288 | 4837 |
^ self findString |
4458 | 4838 |
]. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4839 |
self findNextWithString:lastSearchString |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4840 |
! |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4841 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4842 |
findNextForWhich:aBlock |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4843 |
"helper: select the next change for which aBlock evaluates to true" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4844 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4845 |
self withCursor:Cursor questionMark do:[ |
6288 | 4846 |
Object userInterruptSignal handle:[:ex | |
4847 |
self beep. |
|
4848 |
^ 0 |
|
4849 |
] do:[ |
|
4850 |
|lastNr nr| |
|
4851 |
||
4852 |
lastNr := self numberOfChanges. |
|
4853 |
nr := changeNrShown + 1. |
|
4854 |
[nr <= lastNr] whileTrue:[ |
|
4855 |
(aBlock value:nr) ifTrue:[ |
|
4856 |
changeListView setSelection:nr . |
|
4857 |
self changeSelection:nr. |
|
4858 |
^ nr |
|
4859 |
]. |
|
4860 |
nr := nr + 1. |
|
4861 |
]. |
|
4862 |
]. |
|
1127 | 4863 |
]. |
2132 | 4864 |
self showNotFound. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4865 |
self windowGroup sensor flushKeyboard. "/ avoid multiple beeps, in case of type ahead |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4866 |
^ 0 |
1127 | 4867 |
! |
4868 |
||
1848
61054ff3d470
added find prev/next snapshot to search menu
Claus Gittinger <cg@exept.de>
parents:
1833
diff
changeset
|
4869 |
findNextSnapshot |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4870 |
"findNextSnapshot menu action: select the next change which is for a snapShot-image save action" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4871 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4872 |
lastSearchType := #snapshot. |
1848
61054ff3d470
added find prev/next snapshot to search menu
Claus Gittinger <cg@exept.de>
parents:
1833
diff
changeset
|
4873 |
changeNrShown isNil ifTrue:[^ self]. |
61054ff3d470
added find prev/next snapshot to search menu
Claus Gittinger <cg@exept.de>
parents:
1833
diff
changeset
|
4874 |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4875 |
self findNextForWhich: [:changeNr | self changeIsSnapShotInfo:changeNr ] |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4876 |
! |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4877 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4878 |
findNextWithString:searchString |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4879 |
lastSearchType := #string. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4880 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4881 |
lastSearchString := searchString. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4882 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4883 |
changeNrShown isNil ifTrue:[ |
6288 | 4884 |
changeNrShown := 0. |
1848
61054ff3d470
added find prev/next snapshot to search menu
Claus Gittinger <cg@exept.de>
parents:
1833
diff
changeset
|
4885 |
]. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4886 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4887 |
self findNextForWhich: |
6288 | 4888 |
[:changeNr | |
4889 |
|s| |
|
4890 |
||
4891 |
s := self sourceOfMethodChange:changeNr. |
|
4892 |
s notNil and:[ |
|
4893 |
(searchString includesMatchCharacters not |
|
4894 |
and:[(s findString:searchString) ~~ 0]) |
|
4895 |
or:[ searchString includesMatchCharacters |
|
4896 |
and:[('*' , searchString , '*') match:s ]]] |
|
4897 |
]. |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4898 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4899 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4900 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4901 |
codeView setSearchPattern:searchString. |
6288 | 4902 |
codeView |
4903 |
searchFwd:searchString |
|
4904 |
ignoreCase:false |
|
4905 |
startingAtLine:1 col:0 |
|
4906 |
ifAbsent:nil. |
|
3341
8f156ac559d5
fixed matching in find actions
Claus Gittinger <cg@exept.de>
parents:
3339
diff
changeset
|
4907 |
|
1848
61054ff3d470
added find prev/next snapshot to search menu
Claus Gittinger <cg@exept.de>
parents:
1833
diff
changeset
|
4908 |
! |
61054ff3d470
added find prev/next snapshot to search menu
Claus Gittinger <cg@exept.de>
parents:
1833
diff
changeset
|
4909 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4910 |
findPrevious |
6288 | 4911 |
"findPrevious menu action: select the previous change. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4912 |
Searches for what the last search was for; i.e. either same class or same selector" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4913 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4914 |
lastSearchType == #selector ifTrue:[ |
6288 | 4915 |
^ self findPreviousForSelector |
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4916 |
]. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4917 |
lastSearchType == #snapshot ifTrue:[ |
6288 | 4918 |
^ self findPreviousSnapshot |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4919 |
]. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4920 |
lastSearchType == #string ifTrue:[ |
6288 | 4921 |
^ self findPreviousForString |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4922 |
]. |
3534 | 4923 |
lastSearchType == #difference ifTrue:[ |
6288 | 4924 |
^ self findPreviousDifference |
3534 | 4925 |
]. |
4926 |
||
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4927 |
^ self findPreviousForClass |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4928 |
|
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4929 |
"Created: / 18.6.1998 / 22:15:15 / cg" |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4930 |
! |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4931 |
|
3534 | 4932 |
findPreviousDifference |
4933 |
lastSearchType := #difference. |
|
4934 |
changeNrShown isNil ifTrue:[^ self]. |
|
4935 |
||
6288 | 4936 |
self findPreviousForWhich:[:changeNr | |
4937 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
|
4938 |
"/ same |
|
4939 |
false |
|
4940 |
] ifFalse:[ |
|
4941 |
"/ different |
|
4942 |
true |
|
4943 |
] |
|
4944 |
] |
|
3534 | 4945 |
! |
4946 |
||
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4947 |
findPreviousForClass |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4948 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4949 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4950 |
|cls| |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4951 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
4952 |
lastSearchType := #class. |
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
4953 |
changeNrShown isNil ifTrue:[^ self]. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
4954 |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4955 |
cls := self classNameOfChange:changeNrShown. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4956 |
cls isNil ifTrue:[^ self]. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4957 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4958 |
self findPreviousForWhich: |
6288 | 4959 |
[:changeNr | |
4960 |
|thisClass| |
|
4961 |
||
4962 |
thisClass := self classNameOfChange:changeNr. |
|
4963 |
(thisClass = cls |
|
4964 |
or:[cls includesMatchCharacters and:[cls match:thisClass]]) |
|
4965 |
] |
|
3341
8f156ac559d5
fixed matching in find actions
Claus Gittinger <cg@exept.de>
parents:
3339
diff
changeset
|
4966 |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4967 |
! |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4968 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4969 |
findPreviousForSelector |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4970 |
"findPreviousForSelector menu action: select the previous change for the selected changes selector" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4971 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4972 |
|sel| |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4973 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4974 |
lastSearchType := #selector. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4975 |
changeNrShown isNil ifTrue:[^ self]. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4976 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4977 |
sel := self selectorOfMethodChange:changeNrShown. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4978 |
sel isNil ifTrue:[^ self]. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4979 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4980 |
self findPreviousForWhich: |
6288 | 4981 |
[:changeNr | |
4982 |
|thisSelector| |
|
4983 |
||
4984 |
thisSelector := self selectorOfMethodChange:changeNr. |
|
4985 |
(thisSelector = sel |
|
4986 |
or:[sel includesMatchCharacters and:[sel match:thisSelector]]) |
|
4987 |
] |
|
3341
8f156ac559d5
fixed matching in find actions
Claus Gittinger <cg@exept.de>
parents:
3339
diff
changeset
|
4988 |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4989 |
! |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4990 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4991 |
findPreviousForString |
4458 | 4992 |
lastSearchString isNil ifTrue:[ |
6288 | 4993 |
^ self findString |
4458 | 4994 |
]. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4995 |
self findPreviousWithString:lastSearchString |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4996 |
! |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4997 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4998 |
findPreviousForWhich:aBlock |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4999 |
"helper: select the previous change for which aBlock evaluates to true" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5000 |
|
7360 | 5001 |
^ self findPreviousForWhich:aBlock startingAt:(changeNrShown - 1) |
5002 |
||
5003 |
"Modified: / 06-10-2006 / 11:01:38 / cg" |
|
5004 |
! |
|
5005 |
||
5006 |
findPreviousForWhich:aBlock startingAt:changeNrToStartSearch |
|
5007 |
"helper: select the previous change for which aBlock evaluates to true" |
|
5008 |
||
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
5009 |
self withCursor:Cursor questionMark do:[ |
7360 | 5010 |
Object userInterruptSignal handle:[:ex | |
5011 |
self beep. |
|
5012 |
^ 0 |
|
5013 |
] do:[ |
|
5014 |
|nr| |
|
5015 |
||
5016 |
nr := changeNrToStartSearch. |
|
5017 |
[nr >= 1] whileTrue:[ |
|
5018 |
(aBlock value:nr) ifTrue:[ |
|
5019 |
changeListView setSelection:nr. |
|
5020 |
self changeSelection:nr. |
|
5021 |
^ nr |
|
5022 |
]. |
|
5023 |
nr := nr - 1. |
|
5024 |
]. |
|
5025 |
] |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
5026 |
]. |
2132 | 5027 |
self showNotFound. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5028 |
self windowGroup sensor flushKeyboard. "/ avoid multiple beeps, in case of type ahead |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5029 |
^ 0 |
7360 | 5030 |
|
5031 |
"Created: / 06-10-2006 / 11:01:09 / cg" |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5032 |
! |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5033 |
|
1848
61054ff3d470
added find prev/next snapshot to search menu
Claus Gittinger <cg@exept.de>
parents:
1833
diff
changeset
|
5034 |
findPreviousSnapshot |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5035 |
"findPreviousSnapshot menu action: select the previous change which is for a snapShot-image save action" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5036 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5037 |
lastSearchType := #snapshot. |
1848
61054ff3d470
added find prev/next snapshot to search menu
Claus Gittinger <cg@exept.de>
parents:
1833
diff
changeset
|
5038 |
changeNrShown isNil ifTrue:[^ self]. |
61054ff3d470
added find prev/next snapshot to search menu
Claus Gittinger <cg@exept.de>
parents:
1833
diff
changeset
|
5039 |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5040 |
self findPreviousForWhich: [:changeNr | self changeIsSnapShotInfo:changeNr ] |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5041 |
! |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5042 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5043 |
findPreviousWithString:searchString |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5044 |
lastSearchType := #string. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5045 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5046 |
lastSearchString := searchString. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5047 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5048 |
changeNrShown isNil ifTrue:[ |
6288 | 5049 |
changeNrShown := 0. |
1848
61054ff3d470
added find prev/next snapshot to search menu
Claus Gittinger <cg@exept.de>
parents:
1833
diff
changeset
|
5050 |
]. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5051 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5052 |
self findPreviousForWhich: |
6288 | 5053 |
[:changeNr | |
5054 |
|s includesMatchCharacters| |
|
5055 |
||
5056 |
includesMatchCharacters := searchString includesMatchCharacters. |
|
5057 |
s := self sourceOfMethodChange:changeNr. |
|
5058 |
s notNil and:[ |
|
5059 |
(includesMatchCharacters not and:[(s findString:searchString) ~~ 0]) |
|
5060 |
or:[includesMatchCharacters and:[('*' , searchString , '*') match:s ]]] |
|
5061 |
]. |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5062 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5063 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5064 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5065 |
codeView setSearchPattern:searchString. |
6288 | 5066 |
codeView |
5067 |
searchFwd:searchString |
|
5068 |
ignoreCase:false |
|
5069 |
startingAtLine:1 col:0 |
|
5070 |
ifAbsent:nil. |
|
3341
8f156ac559d5
fixed matching in find actions
Claus Gittinger <cg@exept.de>
parents:
3339
diff
changeset
|
5071 |
|
1848
61054ff3d470
added find prev/next snapshot to search menu
Claus Gittinger <cg@exept.de>
parents:
1833
diff
changeset
|
5072 |
! |
61054ff3d470
added find prev/next snapshot to search menu
Claus Gittinger <cg@exept.de>
parents:
1833
diff
changeset
|
5073 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5074 |
findSelector |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5075 |
"findSelector menu action: let user enter a selector, and select the next change for that selector" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5076 |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5077 |
|current| |
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5078 |
|
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5079 |
changeNrShown notNil ifTrue:[ |
6288 | 5080 |
current := self selectorOfMethodChange:changeNrShown. |
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5081 |
]. |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5082 |
|
6288 | 5083 |
self |
5084 |
askForSearch:'Selector to search for:' |
|
5085 |
initialAnswer:current |
|
5086 |
thenSearchUsing:[:searchString :changeNr | |
|
5087 |
|thisSelector| |
|
5088 |
||
5089 |
thisSelector := self selectorOfMethodChange:changeNr. |
|
5090 |
(thisSelector = searchString |
|
5091 |
or:[searchString includesMatchCharacters and:[searchString match:thisSelector]]) |
|
5092 |
] |
|
5093 |
onCancel:[^ self]. |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5094 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5095 |
lastSearchType := #selector. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5096 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
5097 |
! |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
5098 |
|
2576
b5f0d32b09d3
added string search (in methods code)
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
5099 |
findString |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5100 |
|searchString directionHolder| |
2576
b5f0d32b09d3
added string search (in methods code)
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
5101 |
|
b5f0d32b09d3
added string search (in methods code)
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
5102 |
lastSearchType := #string. |
b5f0d32b09d3
added string search (in methods code)
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
5103 |
|
b5f0d32b09d3
added string search (in methods code)
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
5104 |
searchString := codeView selection. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5105 |
searchString size == 0 ifTrue:[searchString := lastSearchString]. |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5106 |
|
6288 | 5107 |
searchString := self |
5108 |
askForSearchString:'String to search for:' |
|
5109 |
initialAnswer:(searchString ? '') |
|
5110 |
directionInto:(directionHolder := ValueHolder new). |
|
3554 | 5111 |
|
5112 |
searchString size == 0 ifTrue:[ |
|
6288 | 5113 |
^ self |
2576
b5f0d32b09d3
added string search (in methods code)
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
5114 |
]. |
b5f0d32b09d3
added string search (in methods code)
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
5115 |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5116 |
directionHolder value == #backward ifTrue:[ |
6288 | 5117 |
self findPreviousWithString:searchString. |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5118 |
] ifFalse:[ |
6288 | 5119 |
self findNextWithString:searchString. |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5120 |
] |
2576
b5f0d32b09d3
added string search (in methods code)
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
5121 |
! |
b5f0d32b09d3
added string search (in methods code)
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
5122 |
|
202 | 5123 |
noChangesAllowed |
5124 |
"show a warning that changes cannot be changed" |
|
93 | 5125 |
|
3211 | 5126 |
self warn:'Changes are not allowed to be changed.' |
0 | 5127 |
! |
5128 |
||
202 | 5129 |
saveClass:aClassName from:startNr |
5130 |
"user wants changes from current to end to be appended to a file" |
|
51 | 5131 |
|
202 | 5132 |
|changeNr fileName| |
51 | 5133 |
|
202 | 5134 |
changeNr := changeListView selection. |
5135 |
changeNr notNil ifTrue:[ |
|
6288 | 5136 |
fileName := Dialog |
5137 |
requestFileName:'Append changes for class to:' |
|
5138 |
default:(lastSaveFileName ? '') |
|
5139 |
ok:'Append' |
|
5140 |
abort:'Abort' |
|
5141 |
pattern:'*.chg'. |
|
5142 |
||
5143 |
fileName notNil ifTrue:[ |
|
5144 |
lastSaveFileName := fileName. |
|
5145 |
self withCursor:(Cursor write) do:[ |
|
5146 |
startNr to:(self numberOfChanges) do:[:changeNr | |
|
5147 |
|thisClassName| |
|
5148 |
||
5149 |
thisClassName := self classNameOfChange:changeNr. |
|
5150 |
thisClassName = aClassName ifTrue:[ |
|
5151 |
self setSingleSelection:changeNr. |
|
5152 |
(self appendChange:changeNr toFile:fileName) ifFalse:[ |
|
5153 |
^ self |
|
5154 |
] |
|
5155 |
] |
|
5156 |
] |
|
5157 |
] |
|
5158 |
]. |
|
202 | 5159 |
] |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
5160 |
|
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
5161 |
"Modified: 25.5.1996 / 12:26:44 / cg" |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
5162 |
! |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
5163 |
|
3472 | 5164 |
setEnforcedNameSpace |
5165 |
|nsName listOfKnownNameSpaces| |
|
5166 |
||
5167 |
listOfKnownNameSpaces := Set new. |
|
6288 | 5168 |
NameSpace |
6682 | 5169 |
allNameSpaces |
5170 |
do:[:eachNameSpace | |
|
5171 |
listOfKnownNameSpaces add:eachNameSpace name |
|
5172 |
]. |
|
3472 | 5173 |
listOfKnownNameSpaces := listOfKnownNameSpaces asOrderedCollection sort. |
5174 |
||
6288 | 5175 |
nsName := Dialog |
6682 | 5176 |
request:'When applying, new classes are created in nameSpace:' |
5177 |
initialAnswer:(enforcedNameSpace ? Class nameSpaceQuerySignal query name) |
|
5178 |
list:listOfKnownNameSpaces. |
|
7096 | 5179 |
nsName isNil ifTrue:[^ self]. |
5180 |
||
5181 |
(nsName isEmpty or:[nsName = 'Smalltalk']) ifTrue:[ |
|
5182 |
applyInOriginalNameSpace value:true. |
|
5183 |
enforcedNameSpace := nil. |
|
5184 |
] ifFalse:[ |
|
5185 |
applyInOriginalNameSpace value:false. |
|
6682 | 5186 |
enforcedNameSpace := NameSpace name:nsName. |
5187 |
autoCompare value ifTrue:[ |
|
5188 |
self doUpdate |
|
5189 |
]. |
|
3472 | 5190 |
] |
7096 | 5191 |
|
5192 |
"Modified: / 07-09-2006 / 15:10:25 / cg" |
|
3472 | 5193 |
! |
5194 |
||
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
5195 |
setEnforcedPackage |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
5196 |
|pkg listOfKnownPackages| |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
5197 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
5198 |
listOfKnownPackages := Set new. |
6288 | 5199 |
Smalltalk allClassesDo:[:eachClass | |
5200 |
|package| |
|
5201 |
||
5202 |
package := eachClass package. |
|
5203 |
package size > 0 ifTrue:[ |
|
5204 |
listOfKnownPackages add:package |
|
5205 |
] |
|
5206 |
]. |
|
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
5207 |
listOfKnownPackages := listOfKnownPackages asOrderedCollection sort. |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
5208 |
|
6288 | 5209 |
pkg := Dialog |
5210 |
request:'When applying, changes go into package:' |
|
5211 |
initialAnswer:(enforcedPackage ? Class packageQuerySignal query) |
|
5212 |
list:listOfKnownPackages. |
|
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
5213 |
pkg size ~~ 0 ifTrue:[ |
6288 | 5214 |
enforcedPackage := pkg |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
5215 |
] |
202 | 5216 |
! ! |
0 | 5217 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5218 |
!ChangesBrowser::ChangeFileReader methodsFor:'accessing'! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5219 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5220 |
autoCompare:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5221 |
autoCompare := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5222 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5223 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5224 |
browser:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5225 |
browser := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5226 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5227 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5228 |
changeChunks |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5229 |
^ changeChunks |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5230 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5231 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5232 |
changeClassNames |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5233 |
^ changeClassNames |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5234 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5235 |
|
6516
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
5236 |
changeFileName |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
5237 |
^ changeFileName |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
5238 |
! |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
5239 |
|
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
5240 |
changeFileName:something |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
5241 |
changeFileName := something. |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
5242 |
! |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
5243 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5244 |
changeHeaderLines |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5245 |
^ changeHeaderLines |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5246 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5247 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5248 |
changeIsFollowupMethodChange |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5249 |
^ changeIsFollowupMethodChange |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5250 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5251 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5252 |
changePositions |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5253 |
^ changePositions |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5254 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5255 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5256 |
changeTimeStamps |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5257 |
^ changeTimeStamps |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5258 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5259 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5260 |
enforcedNameSpace:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5261 |
enforcedNameSpace := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5262 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5263 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5264 |
inStream:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5265 |
inStream := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5266 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5267 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5268 |
noColoring:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5269 |
noColoring := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5270 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5271 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5272 |
tabSpec:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5273 |
tabSpec := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5274 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5275 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5276 |
thisIsAClassSource |
7360 | 5277 |
^ thisIsAClassSource ? false |
5278 |
||
5279 |
"Modified: / 06-10-2006 / 11:18:49 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5280 |
! ! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5281 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5282 |
!ChangesBrowser::ChangeFileReader methodsFor:'private'! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5283 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5284 |
contractClass:className selector:selector to:maxLen |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5285 |
"contract a class>>selector string (for display in the changeList)." |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5286 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5287 |
|s l| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5288 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5289 |
s := className , ' ', selector. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5290 |
s size > maxLen ifTrue:[ |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5291 |
l := maxLen - 1 - selector size max:20. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5292 |
s := (className contractTo:l) , ' ' , selector. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5293 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5294 |
s size > maxLen ifTrue:[ |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5295 |
l := maxLen - 1 - className size max:20. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5296 |
s := className , ' ', (selector contractTo:l). |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5297 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5298 |
s size > maxLen ifTrue:[ |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5299 |
s := (className contractTo:(maxLen // 2 - 1)) , ' ' , (selector contractTo:maxLen // 2) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5300 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5301 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5302 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5303 |
^ s |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5304 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5305 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5306 |
extractClassAndClassNameFromParseTree:rec |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5307 |
|isUnaryMessage className changeClass| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5308 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5309 |
isUnaryMessage := rec isUnaryMessage. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5310 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5311 |
isUnaryMessage ifTrue:[ |
6843 | 5312 |
className := rec receiver name. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5313 |
] ifFalse:[ |
6843 | 5314 |
Error handle:[:ex | ^ '?' -> nil] |
5315 |
do:[ |
|
5316 |
className := rec name. |
|
5317 |
]. |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5318 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5319 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5320 |
enforcedNameSpace notNil ifTrue:[ |
6843 | 5321 |
changeClass := enforcedNameSpace classNamed:className. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5322 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5323 |
changeClass isNil ifTrue:[ |
6843 | 5324 |
changeClass := Smalltalk classNamed:className. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5325 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5326 |
isUnaryMessage ifTrue:[ |
6843 | 5327 |
changeClass notNil ifTrue:[ |
5328 |
changeClass := changeClass class. |
|
5329 |
]. |
|
5330 |
className := className , ' class'. |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5331 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5332 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5333 |
^ className -> changeClass |
6843 | 5334 |
|
5335 |
"Modified: / 03-08-2006 / 14:02:31 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5336 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5337 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5338 |
nameSpaceForApply |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5339 |
^ browser nameSpaceForApply |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5340 |
! ! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5341 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5342 |
!ChangesBrowser::ChangeFileReader methodsFor:'reading'! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5343 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5344 |
addHeaderLineForChangeType:changeType changeString:changeString changeDelta:changeDelta timeStampInfo:timeStampInfo |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5345 |
|entry| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5346 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5347 |
entry := MultiColListEntry new. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5348 |
entry tabulatorSpecification:tabSpec. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5349 |
entry colAt:1 put:changeDelta. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5350 |
entry colAt:2 put:changeString. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5351 |
entry colAt:3 put:changeType. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5352 |
timeStampInfo notNil ifTrue:[ |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5353 |
entry colAt:4 put:timeStampInfo. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5354 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5355 |
changeHeaderLines add:entry |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5356 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5357 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5358 |
processChunk |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5359 |
(chunkText startsWith:'''---- timestamp ') ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5360 |
timeStampInfo := (chunkText copyFrom:16 to:(chunkText size - 6)) withoutSpaces. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5361 |
^ self. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5362 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5363 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5364 |
changeChunks add:chunkText. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5365 |
changeClassNames add:nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5366 |
changePositions add:chunkPosition. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5367 |
changeTimeStamps add:timeStampInfo. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5368 |
changeIsFollowupMethodChange add:false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5369 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5370 |
headerLine := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5371 |
changeDelta := ' '. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5372 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5373 |
sawExcla ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5374 |
self processNonMethodChunk |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5375 |
] ifTrue:[ |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
5376 |
self processMethodChunkIfNone: |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
5377 |
[ |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
5378 |
changeChunks removeLast. |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
5379 |
changeClassNames removeLast. |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
5380 |
changePositions removeLast. |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
5381 |
changeTimeStamps removeLast. |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
5382 |
changeIsFollowupMethodChange removeLast. |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
5383 |
] |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5384 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5385 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5386 |
changeString notNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5387 |
self addHeaderLineForChangeType:changeType changeString:changeString changeDelta:changeDelta timeStampInfo:timeStampInfo. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5388 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5389 |
headerLine notNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5390 |
changeHeaderLines add:headerLine |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5391 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5392 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5393 |
! |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5394 |
|
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
5395 |
processMethodChunkIfNone:emptyBlock |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5396 |
"sawExcla" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5397 |
|
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
5398 |
|askedForEditingClassSource changeClass category anyMethod |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5399 |
sel cls p rec clsName done first text methodPos |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5400 |
singleJunkOnly methodChunks classCategoryChunks methodCategoryChunks singleInfo m currentText t1 t2 methodSelector nameAndClass| |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5401 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5402 |
singleJunkOnly := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5403 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5404 |
classCategoryChunks := methodCategoryChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5405 |
singleInfo := false. |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
5406 |
anyMethod := false. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5407 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5408 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5409 |
method definitions actually consist of |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5410 |
two (or more) chunks; skip next chunk(s) |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5411 |
up to an empty one. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5412 |
The system only writes one chunk, |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5413 |
and we cannot handle more in this ChangesBrowser .... |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5414 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5415 |
clsName := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5416 |
p := Parser parseExpression:chunkText inNameSpace:(self nameSpaceForApply). |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5417 |
|
6835
87e0844b7e12
Avoid debugger on timestamp information whenn doing autocompare
Stefan Vogel <sv@exept.de>
parents:
6820
diff
changeset
|
5418 |
(p notNil and:[p ~~ #Error and:[p isMessage]]) ifTrue:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5419 |
rec := p receiver. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5420 |
sel := p selector. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5421 |
(ChangesBrowser methodDefinitionSelectors includes:sel) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5422 |
methodChunks := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5423 |
nameAndClass := self extractClassAndClassNameFromParseTree:rec. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5424 |
clsName := nameAndClass key. changeClass := nameAndClass value. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5425 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5426 |
sel == #categoriesForClass ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5427 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5428 |
classCategoryChunks := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5429 |
changeType := '(class category change)'. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5430 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5431 |
sel == #categoriesFor: ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5432 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5433 |
methodCategoryChunks := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5434 |
changeType := '(category change)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5435 |
methodSelector := (p args at:1) evaluate. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5436 |
] ifFalse:[ |
6532 | 5437 |
(sel numArgs == 0) ifTrue:[ |
5438 |
category := '* As yet uncategorized *'. |
|
5439 |
category := sel. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5440 |
] ifFalse:[ |
6532 | 5441 |
category := (p args at:1) evaluate. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5442 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5443 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5444 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5445 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5446 |
sel == #'methodsFor:stamp:' ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5447 |
"/ Squeak timeStamp |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5448 |
timeStampInfo := (p args at:2) evaluate. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5449 |
singleInfo := true |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5450 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5451 |
sel == #'commentStamp:prior:' ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5452 |
singleJunkOnly := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5453 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5454 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5455 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5456 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5457 |
sel == #reorganize ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5458 |
singleJunkOnly := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5459 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5460 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5461 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5462 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5463 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5464 |
done := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5465 |
first := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5466 |
[done] whileFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5467 |
changeDelta := ' '. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5468 |
methodPos := inStream position1Based. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5469 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5470 |
text := inStream nextChunk. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5471 |
done := text isEmptyOrNil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5472 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5473 |
done ifFalse:[ |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
5474 |
anyMethod := true. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5475 |
first ifFalse:[ |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5476 |
changeChunks add:chunkText. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5477 |
changeClassNames add:clsName. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5478 |
changePositions add:methodPos. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5479 |
changeTimeStamps add:timeStampInfo. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5480 |
changeIsFollowupMethodChange add:true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5481 |
askedForEditingClassSource ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5482 |
thisIsAClassSource := (changeFileName asFilename hasSuffix:'st'). |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5483 |
askedForEditingClassSource := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5484 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5485 |
] ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5486 |
changeClassNames at:changeClassNames size put:clsName. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5487 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5488 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5489 |
first := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5490 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5491 |
(classCategoryChunks or:[methodCategoryChunks]) ifTrue:[ |
6639 | 5492 |
text := text firstLine. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5493 |
classCategoryChunks ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5494 |
changeClass isNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5495 |
changeDelta := '?'. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5496 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5497 |
changeClass category = text ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5498 |
changeDelta := '='. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5499 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5500 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5501 |
changeString := clsName , ' category: ' , text storeString. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5502 |
]ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5503 |
changeString := '(' , clsName , ' compiledMethodAt:' , methodSelector storeString , ') category: ' , text storeString. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5504 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5505 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5506 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5507 |
try to find the selector |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5508 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5509 |
methodSelector := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5510 |
clsName notNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5511 |
methodChunks ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5512 |
p := Parser |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5513 |
parseMethodSpecification:text |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5514 |
in:nil |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5515 |
ignoreErrors:true |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5516 |
ignoreWarnings:true. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5517 |
(p notNil and:[p ~~ #Error]) ifTrue:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5518 |
methodSelector := p selector. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5519 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5520 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5521 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5522 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5523 |
methodSelector isNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5524 |
changeString := (chunkText contractTo:maxLen). |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5525 |
changeType := '(change)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5526 |
headerLine := chunkText , ' (change)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5527 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5528 |
changeString := self contractClass:clsName selector:methodSelector to:maxLen. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5529 |
changeType := '{ ' , category , ' }'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5530 |
headerLine := clsName , ' ' , methodSelector , ' ' , '(change category: ''' , category , ''')'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5531 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5532 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5533 |
autoCompare value ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5534 |
changeClass isNil ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5535 |
cls := changeClass theNonMetaclass |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5536 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5537 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5538 |
(changeClass isNil or:[methodSelector isNil or:[cls isLoaded not]]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5539 |
changeClass isNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5540 |
changeDelta := '+' |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5541 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5542 |
changeDelta := '?' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5543 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5544 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5545 |
(changeClass includesSelector:methodSelector asSymbol) ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5546 |
changeDelta := '+'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5547 |
] ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5548 |
m := changeClass compiledMethodAt:methodSelector asSymbol. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5549 |
currentText := m source. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5550 |
currentText notNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5551 |
text asString string withoutTrailingSeparators = currentText asString string withoutTrailingSeparators ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5552 |
changeDelta := '=' |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5553 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5554 |
t1 := currentText asCollectionOfLines collect:[:s | s withTabsExpanded]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5555 |
t2 := text asCollectionOfLines collect:[:s | s withTabsExpanded]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5556 |
t1 = t2 ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5557 |
changeDelta := '=' |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5558 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5559 |
|tree1 tree2| |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5560 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5561 |
RBParser notNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5562 |
tree1 := RBParser parseMethod:currentText onError:[:aString :pos | ^ nil]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5563 |
tree2 := RBParser parseMethod:text onError:[:aString :pos | ^ nil]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5564 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5565 |
tree1 = tree2 ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5566 |
changeDelta := '~' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5567 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5568 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5569 |
]. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5570 |
] |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5571 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5572 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5573 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5574 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5575 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5576 |
self addHeaderLineForChangeType:changeType changeString:changeString changeDelta:changeDelta timeStampInfo:timeStampInfo. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5577 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5578 |
changeString := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5579 |
headerLine := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5580 |
singleJunkOnly ifTrue:[done := true] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5581 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5582 |
singleInfo ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5583 |
timeStampInfo := nil |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5584 |
]. |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
5585 |
anyMethod ifFalse:[ |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
5586 |
emptyBlock value |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
5587 |
]. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5588 |
! |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5589 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5590 |
processNonMethodChunk |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5591 |
|s changeClass sel cls p rec clsName ownerTree ownerName |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5592 |
m nameAndClass| |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5593 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5594 |
(chunkText startsWith:'''---- snap') ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5595 |
self processSnapshotChunk. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5596 |
^ self |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5597 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5598 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5599 |
headerLine := chunkText , ' (doIt)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5600 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5601 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5602 |
first, assume doIt - then lets have a more detailed look ... |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5603 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5604 |
((chunkText startsWith:'''---- file') |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5605 |
or:[(chunkText startsWith:'''---- check')]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5606 |
changeType := ''. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5607 |
timeStampInfo := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5608 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5609 |
changeType := '(doIt)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5610 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5611 |
changeString := (chunkText contractTo:maxLen) withoutSeparators. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5612 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5613 |
p := Parser parseExpression:fullChunkText inNameSpace:Smalltalk. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5614 |
(p notNil and:[p ~~ #Error]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5615 |
p isMessage ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5616 |
sel := p selector. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5617 |
rec := p receiver. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5618 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5619 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5620 |
sel := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5621 |
(Scanner new scanTokens:fullChunkText) size == 0 ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5622 |
"/ a comment only |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5623 |
changeType := '(comment)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5624 |
NoColoring ~~ true ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5625 |
changeType := changeType allItalic. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5626 |
"/ changeString := changeString allItalic. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5627 |
changeType emphasisAllAdd:(#color -> UserPreferences current commentColor). |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5628 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5629 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5630 |
changeType := '(???)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5631 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5632 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5633 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5634 |
(sel == #comment:) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5635 |
changeType := '(comment)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5636 |
clsName := rec name. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5637 |
changeClass := (self nameSpaceForApply) classNamed:clsName. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5638 |
changeClassNames at:changeClassNames size put:clsName. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5639 |
NoColoring ~~ true ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5640 |
changeType := changeType allItalic. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5641 |
changeType emphasisAllAdd:(#color -> UserPreferences current commentColor). |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5642 |
"/ changeString := clsName allItalic. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5643 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5644 |
autoCompare value ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5645 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5646 |
changeDelta := '?' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5647 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5648 |
(changeClass comment = (p args at:1) evaluate) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5649 |
changeDelta := '='. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5650 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5651 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5652 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5653 |
sel := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5654 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5655 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5656 |
(sel == #removeSelector:) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5657 |
nameAndClass := self extractClassAndClassNameFromParseTree:rec. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5658 |
clsName := nameAndClass key. changeClass := nameAndClass value. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5659 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5660 |
sel := (p args at:1) evaluate. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5661 |
changeClassNames at:changeClassNames size put:clsName. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5662 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5663 |
autoCompare value ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5664 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5665 |
changeDelta := '?' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5666 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5667 |
(changeClass includesSelector:sel asSymbol) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5668 |
changeDelta := '-'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5669 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5670 |
changeDelta := '='. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5671 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5672 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5673 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5674 |
changeType := '(remove)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5675 |
changeString := self contractClass:clsName selector:sel to:maxLen. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5676 |
sel := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5677 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5678 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5679 |
(p notNil |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5680 |
and:[p ~~ #Error |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5681 |
and:[p isMessage |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5682 |
and:[rec isMessage |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5683 |
and:[rec selector == #compiledMethodAt:]]]]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5684 |
nameAndClass := self extractClassAndClassNameFromParseTree:rec receiver. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5685 |
clsName := nameAndClass key. changeClass := nameAndClass value. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5686 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5687 |
(sel == #category:) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5688 |
sel := (rec args at:1) evaluate. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5689 |
changeType := '(category change)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5690 |
changeString := self contractClass:clsName selector:sel to:maxLen. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5691 |
changeClassNames at:changeClassNames size put:clsName. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5692 |
changeClass notNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5693 |
m := changeClass compiledMethodAt:sel asSymbol. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5694 |
m notNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5695 |
m category = (p args at:1) evaluate ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5696 |
changeDelta := '='. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5697 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5698 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5699 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5700 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5701 |
(sel == #privacy:) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5702 |
sel := (rec args at:1) evaluate. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5703 |
changeType := '(privacy change)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5704 |
changeString := self contractClass:clsName selector:sel to:maxLen. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5705 |
changeClassNames at:changeClassNames size put:clsName. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5706 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5707 |
sel := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5708 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5709 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5710 |
(Class definitionSelectors includes:sel) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5711 |
changeType := '(class definition)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5712 |
clsName := (p args at:1) evaluate. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5713 |
changeClassNames at:changeClassNames size put:clsName. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5714 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5715 |
"/ is it a private-class ? |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5716 |
('*privateIn:' match:sel) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5717 |
ownerTree := p args last. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5718 |
ownerName := ownerTree name asString. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5719 |
clsName := ownerName , '::' , clsName |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5720 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5721 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5722 |
changeString := clsName. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5723 |
NoColoring ~~ true ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5724 |
changeType := changeType allBold. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5725 |
changeString := changeString allBold. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5726 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5727 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5728 |
autoCompare value ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5729 |
cls := (self nameSpaceForApply) at:clsName asSymbol ifAbsent:nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5730 |
cls isNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5731 |
changeDelta := '+'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5732 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5733 |
(cls definitionSelector = sel |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5734 |
or:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5735 |
"/ could be an ST/V, VAge or Dolphin definition |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5736 |
cls definitionSelector = (sel , 'category:') |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5737 |
]) |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5738 |
ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5739 |
((cls superclass isNil |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5740 |
and:[p receiver isConstant |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5741 |
and:[p receiver evaluate isNil]]) |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5742 |
or:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5743 |
cls superclass notNil |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5744 |
and:[p receiver isConstant not |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5745 |
and:[cls superclass name = p receiver name]] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5746 |
]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5747 |
cls instanceVariableString asCollectionOfWords = (p args at:2) evaluate asCollectionOfWords ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5748 |
cls classVariableString asCollectionOfWords = (p args at:3) evaluate asCollectionOfWords ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5749 |
(p args at:4) evaluate isEmpty ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5750 |
cls definitionSelector = (sel , 'category:') |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5751 |
ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5752 |
"/ ST/V, VAge or Dolphin definition |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5753 |
changeDelta := '='. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5754 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5755 |
cls category = (p args at:5) evaluate ifTrue:[ |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5756 |
changeDelta := '='. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5757 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5758 |
changeType := '(class category change)'. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5759 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5760 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5761 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5762 |
] |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5763 |
] |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5764 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5765 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5766 |
] |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5767 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5768 |
sel := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5769 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5770 |
(#( |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5771 |
#'primitiveDefinitions:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5772 |
#'primitiveFunctions:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5773 |
#'primitiveVariables:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5774 |
) includes:sel) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5775 |
changeType := '(class definition)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5776 |
clsName := rec evaluate. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5777 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5778 |
((sel == #instanceVariableNames:) |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5779 |
and:[rec isMessage |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5780 |
and:[rec selector == #class]]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5781 |
clsName := rec receiver name. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5782 |
changeClass := (self nameSpaceForApply) classNamed:clsName. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5783 |
changeType := '(class definition)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5784 |
changeClassNames at:changeClassNames size put:clsName. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5785 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5786 |
autoCompare value ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5787 |
changeClass isNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5788 |
changeDelta := '?'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5789 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5790 |
s := (p args at:1) evaluate. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5791 |
s = changeClass class instanceVariableString ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5792 |
changeDelta := '='. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5793 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5794 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5795 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5796 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5797 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5798 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5799 |
! |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5800 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5801 |
processSnapshotChunk |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5802 |
changeType := ''. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5803 |
headerLine := chunkText. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5804 |
changeString := (chunkText contractTo:maxLen) withoutSeparators. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5805 |
timeStampInfo := nil. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5806 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5807 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5808 |
readChangesFile |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5809 |
"read the changes file, create a list of header-lines (changeChunks) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5810 |
and a list of chunk-positions (changePositions). |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5811 |
Starting with 2.10.3, the entries are multi-col entries; |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5812 |
the cols are: |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5813 |
1 delta (only if comparing) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5814 |
'+' -> new method (w.r.t. current state) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5815 |
'-' -> removed method (w.r.t. current state) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5816 |
'?' -> class does not exist currently |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5817 |
'=' -> change is the same as current methods source |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5818 |
'~' -> change is almost the same as current methods source |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5819 |
2 class/selector |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5820 |
3 type of change |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5821 |
doit |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5822 |
method |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5823 |
category change |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5824 |
4 timestamp |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5825 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5826 |
since comparing slows down startup time, it is now disabled by |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5827 |
default and can be enabled via a toggle." |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5828 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5829 |
|excla| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5830 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5831 |
changeChunks := OrderedCollection new. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5832 |
changeClassNames := OrderedCollection new. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5833 |
changeHeaderLines := OrderedCollection new. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5834 |
changePositions := OrderedCollection new. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5835 |
changeTimeStamps := OrderedCollection new. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5836 |
changeIsFollowupMethodChange := OrderedCollection new. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5837 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5838 |
excla := inStream class chunkSeparator. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5839 |
maxLen := 60. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5840 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5841 |
[inStream atEnd] whileFalse:[ |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5842 |
" |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5843 |
get a chunk (separated by excla) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5844 |
" |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5845 |
inStream skipSeparators. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5846 |
chunkPosition := inStream position1Based. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5847 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5848 |
sawExcla := inStream peekFor:excla. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5849 |
chunkText := fullChunkText := inStream nextChunk. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5850 |
chunkText notNil ifTrue:[ |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5851 |
self processChunk. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5852 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5853 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5854 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5855 |
"Modified: / 27.8.1995 / 23:06:55 / claus" |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5856 |
"Modified: / 9.11.2001 / 02:24:46 / cg" |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5857 |
! ! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
5858 |
|
761 | 5859 |
!ChangesBrowser class methodsFor:'documentation'! |
202 | 5860 |
|
5861 |
version |
|
7507 | 5862 |
^ '$Header: /cvs/stx/stx/libtool/ChangesBrowser.st,v 1.360 2006-11-13 12:05:19 cg Exp $' |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
5863 |
! ! |