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