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