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