author | Claus Gittinger <cg@exept.de> |
Fri, 15 Jun 2018 04:00:37 +0200 | |
changeset 18220 | d1ebaddf1100 |
parent 18186 | 445d04aafe6f |
child 18232 | 56fa2d552804 |
permissions | -rw-r--r-- |
18136 | 1 |
"{ Encoding: utf8 }" |
2 |
||
0 | 3 |
" |
4 | 4 |
COPYRIGHT (c) 1990 by Claus Gittinger |
6288 | 5 |
All Rights Reserved |
0 | 6 |
|
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
2664
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
14 |
"{ Package: 'stx:libtool' }" |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
15 |
|
15082 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
0 | 18 |
StandardSystemView subclass:#ChangesBrowser |
16372 | 19 |
instanceVariableNames:'changesReader changeInfoList changeListView codeView diffView |
20 |
changeFileName anyChanges changeNrShown changeNrProcessed |
|
21 |
multipleApply autoCompare changeFileSize changeFileTimestamp |
|
22 |
checkBlock tabSpec autoUpdate editingClassSource lastSearchType |
|
4489 | 23 |
lastSearchString applyInOriginalNameSpace lastSaveFileName |
24 |
readOnly enforcedPackage enforcedNameSpace updateChangeSet |
|
8026
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
25 |
showingDiffs diffViewBox autoloadAsRequired |
10719 | 26 |
classesNotToBeAutoloaded encodingIfKnown |
11244 | 27 |
ignorePublicPrivateCategories changeListSelectionHolder |
17848 | 28 |
defaultApplicationForVAGEClasses infoHolder leftCodeLabelHolder |
29 |
rightCodeLabelHolder' |
|
30 |
classVariableNames:'CompressSnapshotInfo DefaultAutoCompare DefaultShowingDiffs |
|
31 |
KeepEnforcedNameSpace LastEnforcedNameSpace NoColoring |
|
32 |
ShowWarningDialogs' |
|
4489 | 33 |
poolDictionaries:'' |
34 |
category:'Interface-Browsers' |
|
0 | 35 |
! |
36 |
||
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
37 |
Object subclass:#ChangeFileReader |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
38 |
instanceVariableNames:'browser enforcedNameSpace changeFileName changeFileSize |
16372 | 39 |
changeFileTimestamp changeInfo changeChunks changeClassNames |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
40 |
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
|
41 |
changeIsFollowupMethodChange autoCompare autoloadAsRequired |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
42 |
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
|
43 |
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
|
44 |
changeString changeType changeDelta headerLine maxLen' |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
45 |
classVariableNames:'NoColoring' |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
46 |
poolDictionaries:'' |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
47 |
privateIn:ChangesBrowser |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
48 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
49 |
|
16372 | 50 |
Object subclass:#ChangeInfo |
51 |
instanceVariableNames:'position chunk className selector headerLine timestamp |
|
18059 | 52 |
isFollowupChange categoryIfCategoryChange' |
16372 | 53 |
classVariableNames:'' |
54 |
poolDictionaries:'' |
|
55 |
privateIn:ChangesBrowser |
|
56 |
! |
|
57 |
||
761 | 58 |
!ChangesBrowser class methodsFor:'documentation'! |
29 | 59 |
|
60 |
copyright |
|
61 |
" |
|
62 |
COPYRIGHT (c) 1990 by Claus Gittinger |
|
6288 | 63 |
All Rights Reserved |
0 | 64 |
|
29 | 65 |
This software is furnished under a license and may be used |
66 |
only in accordance with the terms of that license and with the |
|
67 |
inclusion of the above copyright notice. This software may not |
|
68 |
be provided or otherwise made available to, or used by, any |
|
69 |
other person. No title to or ownership of the software is |
|
70 |
hereby transferred. |
|
71 |
" |
|
72 |
! |
|
73 |
||
74 |
documentation |
|
75 |
" |
|
11397 | 76 |
this implements a browser for the changes-file |
77 |
(actually, it can display any sourceFile's contents). |
|
29 | 78 |
See the extra document 'doc/misc/cbrowser.doc' for how to use this browser. |
79 |
||
80 |
written jan 90 by claus |
|
51 | 81 |
|
11397 | 82 |
This is a very old leftover class (it was one of the very first apps in ST/X |
83 |
and the Merovingian has not yet detected this one ;-) |
|
18059 | 84 |
|
85 |
At the time this was originally written, I had a 2Mb machine, and every memory byte was a very valuable. |
|
86 |
Therefore, the original did not keep any infos in memory, but instead kept a list of change-chunk file offsets, |
|
87 |
and parsed the chunks over and over (eg. when searching for classname/selector etc.) |
|
88 |
Later, when bigger memories became available, more and more infos where cached in additional arrays (classname, |
|
89 |
selector, etc.) and those where finally condensed into a single changeInfo object. |
|
90 |
However, now that really enough memory is avail, this is really no longer useful, and we should keep |
|
91 |
changeSet entries instead (which hold the same info plus more). |
|
92 |
The ChangeSetBrowser does exactly this, but does not support all of the fancy compress/delete etc. |
|
93 |
operations of the ChangesBrowser, to which we got used so much. |
|
94 |
Thus, this one kept on living its zombie life and gets occasional features added (sigh)... |
|
95 |
(Well, like many workhorses, they become ugly when aged, but still do their duty) |
|
96 |
||
97 |
It MUST eventually be completely replaced by the ChangeSetBrowser class in the near future. |
|
5703 | 98 |
|
99 |
||
508 | 100 |
[Class variables:] |
11397 | 101 |
CompressSnapshotInfo if true (the default), snapshot entries |
102 |
are also compressed in the compress function. |
|
103 |
Some users prefer them to be not compressed. |
|
104 |
Set it to false for this. |
|
58 | 105 |
|
51 | 106 |
Notice: |
11397 | 107 |
this needs a total rewrite, to build up a changeSet from the file |
108 |
(which did not exist when the ChangesBrowser was originally written) |
|
109 |
and manipulate that changeSet. |
|
110 |
||
111 |
This way, we get a browser for any upcoming incore changeSets for |
|
112 |
free. Also, this will put the chunk analysation code into Change and |
|
113 |
subclasses (where it belongs) and give a better encapsulation and |
|
114 |
overall structure. Do not take this as an example for good style ;-) |
|
115 |
||
116 |
The Change hierarchy is currently been completed, and the changes browser |
|
17047 | 117 |
should be adapted soon. |
508 | 118 |
|
119 |
[author:] |
|
11397 | 120 |
Claus Gittinger |
508 | 121 |
|
122 |
[start with:] |
|
11397 | 123 |
ChangesBrowser open |
1359 | 124 |
|
125 |
[see also:] |
|
11397 | 126 |
( Using the ChangesBrowser :html: tools/cbrowser/TOP.html ) |
6288 | 127 |
|
29 | 128 |
" |
129 |
! ! |
|
0 | 130 |
|
761 | 131 |
!ChangesBrowser class methodsFor:'instance creation'! |
45 | 132 |
|
8379 | 133 |
openOn:aFilename |
9525 | 134 |
"create & open a changes browser on a change file" |
5696 | 135 |
|
8379 | 136 |
|fileName browser| |
137 |
||
138 |
fileName := aFilename asFilename pathName. |
|
139 |
||
140 |
(self isXMLFile:fileName) ifTrue:[ |
|
141 |
browser := ChangeSetBrowser new |
|
5696 | 142 |
] ifFalse:[ |
8379 | 143 |
browser := self new |
144 |
]. |
|
145 |
||
146 |
browser label:(self defaultLabel , ': ', fileName). |
|
147 |
browser changeFileName:fileName. |
|
5696 | 148 |
browser open. |
149 |
^ browser |
|
9525 | 150 |
|
151 |
"Modified: / 18-07-2010 / 10:32:18 / cg" |
|
45 | 152 |
! ! |
153 |
||
761 | 154 |
!ChangesBrowser class methodsFor:'behavior'! |
0 | 155 |
|
156 |
autoSelectNext |
|
157 |
"returning true here, makes a Delete operation automatically |
|
158 |
select the next change" |
|
159 |
||
160 |
^ true |
|
161 |
! ! |
|
162 |
||
761 | 163 |
!ChangesBrowser class methodsFor:'defaults'! |
0 | 164 |
|
489 | 165 |
defaultIcon |
1153 | 166 |
"return the browsers default window icon" |
167 |
||
7631
258e8ad34edf
defaultIcon no longer uses a class variable
Stefan Vogel <sv@exept.de>
parents:
7625
diff
changeset
|
168 |
<resource: #programImage> |
258e8ad34edf
defaultIcon no longer uses a class variable
Stefan Vogel <sv@exept.de>
parents:
7625
diff
changeset
|
169 |
|
258e8ad34edf
defaultIcon no longer uses a class variable
Stefan Vogel <sv@exept.de>
parents:
7625
diff
changeset
|
170 |
^ ToolbarIconLibrary startChangesBrowserIcon |
489 | 171 |
! |
172 |
||
73 | 173 |
defaultLabel |
5527 | 174 |
^ self classResources string:'Changes Browser' |
2417 | 175 |
! |
176 |
||
177 |
isVisualStartable |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
178 |
"return true, if this application can be started via #open. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
179 |
(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
|
180 |
|
2417 | 181 |
^ true |
182 |
||
183 |
"Created: / 27.9.1999 / 12:28:27 / cg" |
|
28 | 184 |
! ! |
185 |
||
16022 | 186 |
!ChangesBrowser class methodsFor:'help specs'! |
3202 | 187 |
|
17899 | 188 |
helpSpec |
16022 | 189 |
<resource: #help> |
190 |
||
191 |
^ Dictionary new |
|
192 |
addPairsFrom:#( |
|
193 |
||
194 |
#applyChange |
|
195 |
'Apply (install) the selected change' |
|
196 |
||
197 |
deleteAllForClass |
|
198 |
'Delete all changes for the selected change''s class' |
|
199 |
||
200 |
deleteForClassFromBegin |
|
17597 | 201 |
'Delete this and all previous changes for the selected change''s class' |
16022 | 202 |
|
203 |
deleteForClassToEnd |
|
204 |
'Delete this and all following changes for the selected change''s class' |
|
17565 | 205 |
|
206 |
deleteClassSelectorAll |
|
207 |
'Delete all changes for the selected method' |
|
208 |
||
209 |
deleteClassSelectorOlder |
|
17597 | 210 |
'Delete this and all previous changes for the selected method' |
16022 | 211 |
) |
17565 | 212 |
|
17597 | 213 |
"Modified: / 25-07-2017 / 10:55:55 / cg" |
16022 | 214 |
! ! |
215 |
||
216 |
!ChangesBrowser class methodsFor:'menu specs'! |
|
10681 | 217 |
|
3202 | 218 |
menuSpec |
219 |
"This resource specification was automatically generated |
|
220 |
by the MenuEditor of ST/X." |
|
221 |
||
222 |
"Do not manually edit this!! If it is corrupted, |
|
223 |
the MenuEditor may not be able to read the specification." |
|
224 |
||
10719 | 225 |
|
3202 | 226 |
" |
227 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#menuSpec |
|
228 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser menuSpec)) startUp |
|
229 |
" |
|
230 |
||
231 |
<resource: #menu> |
|
232 |
||
7360 | 233 |
^ |
6216 | 234 |
#(Menu |
7096 | 235 |
( |
236 |
(MenuItem |
|
237 |
label: 'File' |
|
17093 | 238 |
submenuChannel: menuSpecFile |
7096 | 239 |
) |
240 |
(MenuItem |
|
17096 | 241 |
label: 'CHANGE' |
17093 | 242 |
submenuChannel: menuSpecChange |
7096 | 243 |
) |
244 |
(MenuItem |
|
245 |
label: 'Search' |
|
17093 | 246 |
submenuChannel: menuSpecSearch |
7096 | 247 |
) |
248 |
(MenuItem |
|
249 |
label: 'Browse' |
|
17093 | 250 |
submenuChannel: menuSpecBrowse |
7096 | 251 |
) |
252 |
(MenuItem |
|
253 |
label: 'Settings' |
|
17093 | 254 |
submenuChannel: menuSpecSettings |
7096 | 255 |
) |
256 |
(MenuItem |
|
7463
e8e74bdbfbda
support '?' as help (for now: controlled by resources)
Claus Gittinger <cg@exept.de>
parents:
7415
diff
changeset
|
257 |
label: 'MENU_Help' |
17093 | 258 |
submenuChannel: menuSpecHelp |
259 |
) |
|
260 |
) |
|
261 |
nil |
|
262 |
nil |
|
263 |
) |
|
17096 | 264 |
|
265 |
"Modified: / 21-11-2016 / 23:46:22 / cg" |
|
17093 | 266 |
! |
267 |
||
268 |
menuSpecBrowse |
|
269 |
"This resource specification was automatically generated |
|
270 |
by the MenuEditor of ST/X." |
|
271 |
||
272 |
"Do not manually edit this!! If it is corrupted, |
|
273 |
the MenuEditor may not be able to read the specification." |
|
274 |
||
275 |
||
276 |
" |
|
277 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#menuSpecBrowse |
|
278 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser menuSpecBrowse)) startUp |
|
279 |
" |
|
280 |
||
281 |
<resource: #menu> |
|
282 |
||
283 |
^ |
|
284 |
#(Menu |
|
285 |
( |
|
286 |
(MenuItem |
|
287 |
enabled: hasSingleSelection |
|
288 |
label: 'Class' |
|
289 |
itemValue: doBrowse |
|
290 |
) |
|
291 |
(MenuItem |
|
292 |
label: '-' |
|
293 |
) |
|
294 |
(MenuItem |
|
295 |
label: 'Senders...' |
|
296 |
itemValue: doBrowseSenders |
|
297 |
) |
|
298 |
(MenuItem |
|
299 |
label: 'Implementors...' |
|
300 |
itemValue: doBrowseImplementors |
|
301 |
) |
|
302 |
) |
|
303 |
nil |
|
304 |
nil |
|
305 |
) |
|
306 |
! |
|
307 |
||
308 |
menuSpecChange |
|
309 |
"This resource specification was automatically generated |
|
310 |
by the MenuEditor of ST/X." |
|
311 |
||
312 |
"Do not manually edit this!! If it is corrupted, |
|
313 |
the MenuEditor may not be able to read the specification." |
|
314 |
||
315 |
||
316 |
" |
|
317 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#menuSpecChange |
|
318 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser menuSpecChange)) startUp |
|
319 |
" |
|
320 |
||
321 |
<resource: #menu> |
|
322 |
||
323 |
^ |
|
324 |
#(Menu |
|
325 |
( |
|
326 |
(MenuItem |
|
327 |
enabled: hasSelection |
|
328 |
label: 'Apply' |
|
329 |
itemValue: doApply |
|
330 |
) |
|
331 |
(MenuItem |
|
332 |
enabled: hasSingleSelection |
|
333 |
label: 'Apply to End' |
|
334 |
itemValue: doApplyRest |
|
335 |
) |
|
336 |
(MenuItem |
|
337 |
enabled: hasSingleSelection |
|
338 |
label: 'Apply from Begin' |
|
339 |
itemValue: doApplyFromBeginning |
|
340 |
) |
|
341 |
(MenuItem |
|
342 |
enabled: hasSingleSelection |
|
343 |
label: 'Apply for Class to End' |
|
344 |
itemValue: doApplyClassRest |
|
345 |
) |
|
346 |
(MenuItem |
|
347 |
enabled: hasSingleSelection |
|
348 |
label: 'Apply for Class from Begin' |
|
349 |
itemValue: doApplyClassFromBeginning |
|
350 |
) |
|
351 |
(MenuItem |
|
352 |
enabled: hasNoSelection |
|
353 |
label: 'Apply All' |
|
354 |
itemValue: doApplyAll |
|
355 |
) |
|
356 |
(MenuItem |
|
357 |
enabled: hasSingleSelection |
|
358 |
label: 'Apply to Conflict or End' |
|
359 |
itemValue: doApplyToConflictOrEnd |
|
360 |
) |
|
361 |
(MenuItem |
|
362 |
label: '-' |
|
363 |
) |
|
364 |
(MenuItem |
|
365 |
enabled: hasSelection |
|
366 |
label: 'Delete' |
|
367 |
itemValue: doDelete |
|
368 |
) |
|
369 |
(MenuItem |
|
370 |
enabled: hasSingleSelection |
|
371 |
label: 'Delete to End' |
|
372 |
itemValue: doDeleteRest |
|
373 |
) |
|
374 |
(MenuItem |
|
375 |
enabled: hasSingleSelection |
|
376 |
label: 'Delete from Begin' |
|
377 |
itemValue: doDeleteFromBeginning |
|
378 |
) |
|
379 |
(MenuItem |
|
380 |
enabled: hasSingleSelection |
|
381 |
label: 'Delete for Class to End' |
|
382 |
itemValue: doDeleteClassRest |
|
383 |
) |
|
384 |
(MenuItem |
|
385 |
enabled: hasSingleSelection |
|
386 |
label: 'Delete for Class from Begin' |
|
387 |
itemValue: doDeleteClassFromBeginning |
|
388 |
) |
|
389 |
(MenuItem |
|
390 |
enabled: hasSelection |
|
391 |
label: 'Delete all for Class' |
|
392 |
itemValue: doDeleteClassAll |
|
393 |
isVisible: hasNoMultiSelection |
|
394 |
) |
|
395 |
(MenuItem |
|
396 |
enabled: hasSelection |
|
397 |
label: 'Delete all for Class && its Private Classes' |
|
398 |
itemValue: doDeleteClassAndPrivateClassesAll |
|
399 |
isVisible: hasNoMultiSelection |
|
400 |
) |
|
401 |
(MenuItem |
|
402 |
enabled: hasSelection |
|
403 |
label: 'Delete all for Namespace' |
|
404 |
itemValue: doDeleteAllForNamespace |
|
405 |
) |
|
406 |
(MenuItem |
|
407 |
enabled: hasSelection |
|
408 |
label: 'Delete all for Classes' |
|
409 |
itemValue: doDeleteClassAll |
|
410 |
isVisible: hasMultiSelection |
|
411 |
) |
|
412 |
(MenuItem |
|
413 |
enabled: hasSelection |
|
414 |
label: 'Delete all for Classes && their Private Classes' |
|
415 |
itemValue: doDeleteClassAndPrivateClassesAll |
|
416 |
isVisible: hasMultiSelection |
|
417 |
) |
|
418 |
(MenuItem |
|
419 |
label: '-' |
|
420 |
) |
|
421 |
(MenuItem |
|
422 |
enabled: hasSelection |
|
423 |
label: 'Delete older Versions of Selected Method' |
|
424 |
itemValue: doDeleteClassSelectorOlder |
|
425 |
isVisible: hasNoMultiSelectionHolder |
|
426 |
) |
|
427 |
(MenuItem |
|
428 |
enabled: hasSelection |
|
429 |
label: 'Delete older Versions of all Selected Methods' |
|
430 |
itemValue: doDeleteClassSelectorOlder |
|
431 |
isVisible: hasMultiSelectionHolder |
|
432 |
) |
|
433 |
(MenuItem |
|
434 |
enabled: hasSelection |
|
435 |
label: 'Delete all Versions of Selected Method' |
|
436 |
itemValue: doDeleteClassSelectorAll |
|
437 |
isVisible: hasNoMultiSelectionHolder |
|
438 |
) |
|
439 |
(MenuItem |
|
440 |
enabled: hasSelection |
|
441 |
label: 'Delete all Versions of all Selected Methods' |
|
442 |
itemValue: doDeleteClassSelectorAll |
|
443 |
isVisible: hasMultiSelectionHolder |
|
444 |
) |
|
445 |
(MenuItem |
|
446 |
label: '-' |
|
447 |
) |
|
448 |
(MenuItem |
|
449 |
enabled: hasSingleSelection |
|
450 |
label: 'Compare with Current' |
|
451 |
itemValue: doCompare |
|
452 |
) |
|
453 |
(MenuItem |
|
17096 | 454 |
enabled: hasSingleSelection |
455 |
label: 'Copy to Clipboard' |
|
456 |
itemValue: doCopyToClipboard |
|
457 |
) |
|
458 |
(MenuItem |
|
17093 | 459 |
label: '-' |
460 |
) |
|
461 |
(MenuItem |
|
462 |
enabled: hasSelection |
|
463 |
label: 'Make Change a Patch' |
|
464 |
itemValue: doMakePatch |
|
465 |
) |
|
466 |
) |
|
467 |
nil |
|
468 |
nil |
|
469 |
) |
|
17096 | 470 |
|
471 |
"Modified: / 21-11-2016 / 23:46:42 / cg" |
|
17093 | 472 |
! |
473 |
||
474 |
menuSpecFile |
|
475 |
"This resource specification was automatically generated |
|
476 |
by the MenuEditor of ST/X." |
|
477 |
||
478 |
"Do not manually edit this!! If it is corrupted, |
|
479 |
the MenuEditor may not be able to read the specification." |
|
480 |
||
481 |
||
482 |
" |
|
483 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#menuSpecFile |
|
484 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser menuSpecFile)) startUp |
|
485 |
" |
|
486 |
||
487 |
<resource: #menu> |
|
488 |
||
489 |
^ |
|
490 |
#(Menu |
|
491 |
( |
|
492 |
(MenuItem |
|
493 |
label: 'Compress' |
|
494 |
itemValue: doCompress |
|
495 |
isVisible: notEditingClassSource |
|
496 |
) |
|
497 |
(MenuItem |
|
498 |
enabled: hasSingleSelection |
|
499 |
label: 'Compress for Class' |
|
500 |
itemValue: doCompressClass |
|
501 |
isVisible: notEditingClassSource |
|
502 |
) |
|
503 |
(MenuItem |
|
504 |
enabled: hasSingleSelection |
|
505 |
label: 'Compress for Class && Selector' |
|
506 |
itemValue: doCompressSelector |
|
507 |
isVisible: notEditingClassSource |
|
508 |
) |
|
509 |
(MenuItem |
|
510 |
label: 'Compare and Compress' |
|
511 |
itemValue: doCompareAndCompress |
|
512 |
isVisible: notEditingClassSource |
|
513 |
) |
|
514 |
(MenuItem |
|
515 |
label: '-' |
|
516 |
isVisible: notEditingClassSource |
|
517 |
) |
|
518 |
(MenuItem |
|
18059 | 519 |
label: 'Cleanup' |
520 |
itemValue: doCleanup |
|
521 |
isVisible: notEditingClassSource |
|
522 |
) |
|
523 |
(MenuItem |
|
524 |
label: '-' |
|
525 |
isVisible: notEditingClassSource |
|
526 |
) |
|
527 |
(MenuItem |
|
17093 | 528 |
enabled: hasSingleSelection |
529 |
label: 'Fileout && Delete all Changes for Class' |
|
530 |
itemValue: doFileoutAndDeleteClassAll |
|
531 |
isVisible: notEditingClassSource |
|
532 |
) |
|
533 |
(MenuItem |
|
534 |
enabled: hasSelection |
|
535 |
label: 'CheckIn && Delete all Changes for Class' |
|
536 |
itemValue: doCheckinAndDeleteClassAll |
|
537 |
isVisible: notEditingClassSource |
|
538 |
) |
|
539 |
(MenuItem |
|
540 |
label: '-' |
|
541 |
isVisible: notEditingClassSource |
|
542 |
) |
|
543 |
(MenuItem |
|
544 |
enabled: hasSelection |
|
545 |
label: 'Save In...' |
|
546 |
itemValue: doSave |
|
547 |
) |
|
548 |
(MenuItem |
|
549 |
enabled: hasSingleSelection |
|
550 |
label: 'Save to End In...' |
|
551 |
itemValue: doSaveRest |
|
552 |
) |
|
553 |
(MenuItem |
|
554 |
enabled: hasSingleSelection |
|
555 |
label: 'Save for Class to End In...' |
|
556 |
itemValue: doSaveClassRest |
|
557 |
) |
|
558 |
(MenuItem |
|
559 |
enabled: hasSingleSelection |
|
560 |
label: 'Save all for Class In...' |
|
561 |
itemValue: doSaveClassAll |
|
562 |
) |
|
563 |
(MenuItem |
|
564 |
label: '-' |
|
565 |
) |
|
566 |
(MenuItem |
|
567 |
label: 'Writeback ClassFile' |
|
568 |
itemValue: doWriteBack |
|
569 |
isVisible: editingClassSource |
|
570 |
) |
|
571 |
(MenuItem |
|
572 |
label: 'Writeback ChangeFile' |
|
573 |
itemValue: doWriteBack |
|
574 |
isVisible: notEditingClassSource |
|
575 |
) |
|
576 |
(MenuItem |
|
577 |
label: '-' |
|
578 |
) |
|
579 |
(MenuItem |
|
580 |
label: 'Update' |
|
581 |
itemValue: doUpdate |
|
582 |
) |
|
583 |
(MenuItem |
|
584 |
label: '-' |
|
585 |
) |
|
586 |
(MenuItem |
|
587 |
label: 'Exit' |
|
588 |
itemValue: menuExit |
|
589 |
) |
|
590 |
) |
|
591 |
nil |
|
592 |
nil |
|
593 |
) |
|
594 |
! |
|
595 |
||
596 |
menuSpecHelp |
|
597 |
"This resource specification was automatically generated |
|
598 |
by the MenuEditor of ST/X." |
|
599 |
||
600 |
"Do not manually edit this!! If it is corrupted, |
|
601 |
the MenuEditor may not be able to read the specification." |
|
602 |
||
603 |
||
604 |
" |
|
605 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#menuSpecHelp |
|
606 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser menuSpecHelp)) startUp |
|
607 |
" |
|
608 |
||
609 |
<resource: #menu> |
|
610 |
||
611 |
^ |
|
612 |
#(Menu |
|
613 |
( |
|
614 |
(MenuItem |
|
615 |
label: 'ChangesBrowser Documentation' |
|
616 |
itemValue: openHTMLDocument: |
|
617 |
argument: 'tools/cbrowser/TOP.html' |
|
618 |
) |
|
619 |
(MenuItem |
|
620 |
label: '-' |
|
621 |
) |
|
622 |
(MenuItem |
|
623 |
label: 'About ChangesBrowser...' |
|
624 |
itemValue: openAboutThisApplication |
|
625 |
) |
|
626 |
) |
|
627 |
nil |
|
628 |
nil |
|
629 |
) |
|
630 |
! |
|
631 |
||
632 |
menuSpecSearch |
|
633 |
"This resource specification was automatically generated |
|
634 |
by the MenuEditor of ST/X." |
|
635 |
||
636 |
"Do not manually edit this!! If it is corrupted, |
|
637 |
the MenuEditor may not be able to read the specification." |
|
638 |
||
639 |
||
640 |
" |
|
641 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#menuSpecSearch |
|
642 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser menuSpecSearch)) startUp |
|
643 |
" |
|
644 |
||
645 |
<resource: #menu> |
|
646 |
||
647 |
^ |
|
648 |
#(Menu |
|
649 |
( |
|
650 |
(MenuItem |
|
651 |
label: 'Class...' |
|
652 |
itemValue: findClass |
|
653 |
) |
|
654 |
(MenuItem |
|
655 |
enabled: hasSelection |
|
656 |
label: 'First for Class' |
|
657 |
itemValue: findFirstForClass |
|
658 |
) |
|
659 |
(MenuItem |
|
660 |
enabled: hasSelection |
|
661 |
label: 'Previous for Class' |
|
662 |
itemValue: findPreviousForClass |
|
663 |
) |
|
664 |
(MenuItem |
|
665 |
enabled: hasSelection |
|
666 |
label: 'Next for Class' |
|
667 |
itemValue: findNextForClass |
|
668 |
) |
|
669 |
(MenuItem |
|
670 |
enabled: hasSelection |
|
671 |
label: 'Last for Class' |
|
672 |
itemValue: findLastForClass |
|
673 |
) |
|
674 |
(MenuItem |
|
675 |
label: '-' |
|
676 |
) |
|
677 |
(MenuItem |
|
678 |
label: 'Selector...' |
|
679 |
itemValue: findSelector |
|
680 |
) |
|
681 |
(MenuItem |
|
682 |
enabled: hasSelection |
|
683 |
label: 'Previous for Selector' |
|
684 |
itemValue: findPreviousForSelector |
|
685 |
) |
|
686 |
(MenuItem |
|
687 |
enabled: hasSelection |
|
688 |
label: 'Next for Selector' |
|
689 |
itemValue: findNextForSelector |
|
690 |
) |
|
691 |
(MenuItem |
|
692 |
label: '-' |
|
693 |
) |
|
694 |
(MenuItem |
|
695 |
label: 'String...' |
|
696 |
itemValue: findString |
|
697 |
) |
|
698 |
(MenuItem |
|
699 |
enabled: hasSelection |
|
700 |
label: 'Previous with String' |
|
701 |
itemValue: findPreviousForString |
|
702 |
) |
|
703 |
(MenuItem |
|
704 |
enabled: hasSelection |
|
705 |
label: 'Next with String' |
|
706 |
itemValue: findNextForString |
|
707 |
) |
|
708 |
(MenuItem |
|
709 |
label: '-' |
|
710 |
) |
|
711 |
(MenuItem |
|
712 |
enabled: hasSelection |
|
713 |
label: 'Previous Difference' |
|
714 |
itemValue: findPreviousDifference |
|
715 |
) |
|
716 |
(MenuItem |
|
717 |
enabled: hasSelection |
|
718 |
label: 'Next Difference' |
|
719 |
itemValue: findNextDifference |
|
720 |
) |
|
721 |
(MenuItem |
|
722 |
label: '-' |
|
723 |
) |
|
724 |
(MenuItem |
|
725 |
enabled: hasSelection |
|
726 |
label: 'Previous Snapshot' |
|
727 |
itemValue: findPreviousSnapshot |
|
728 |
) |
|
729 |
(MenuItem |
|
730 |
enabled: hasSelection |
|
731 |
label: 'Next Snapshot' |
|
732 |
itemValue: findNextSnapshot |
|
733 |
) |
|
734 |
(MenuItem |
|
735 |
label: 'Last Snapshot' |
|
736 |
itemValue: findLastSnapshot |
|
737 |
) |
|
738 |
) |
|
739 |
nil |
|
740 |
nil |
|
741 |
) |
|
742 |
! |
|
743 |
||
744 |
menuSpecSettings |
|
745 |
"This resource specification was automatically generated |
|
746 |
by the MenuEditor of ST/X." |
|
747 |
||
748 |
"Do not manually edit this!! If it is corrupted, |
|
749 |
the MenuEditor may not be able to read the specification." |
|
750 |
||
751 |
||
752 |
" |
|
753 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#menuSpecSettings |
|
754 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser menuSpecSettings)) startUp |
|
755 |
" |
|
756 |
||
757 |
<resource: #menu> |
|
758 |
||
759 |
^ |
|
760 |
#(Menu |
|
761 |
( |
|
762 |
(MenuItem |
|
763 |
label: 'Auto Compare' |
|
764 |
indication: autoCompare |
|
765 |
) |
|
766 |
(MenuItem |
|
767 |
label: 'Autoload As Required' |
|
768 |
indication: autoloadAsRequired |
|
769 |
) |
|
770 |
(MenuItem |
|
771 |
label: 'Show Diffs' |
|
772 |
indication: showingDiffs |
|
773 |
) |
|
774 |
(MenuItem |
|
775 |
label: 'Auto Update' |
|
776 |
indication: autoUpdate |
|
777 |
) |
|
778 |
(MenuItem |
|
779 |
label: '-' |
|
780 |
) |
|
781 |
(MenuItem |
|
782 |
label: 'Add to ChangeSet when Applying' |
|
783 |
indication: updateChangeSet |
|
784 |
) |
|
785 |
(MenuItem |
|
786 |
label: 'Ignore Public/Private in Categories (Dolphin code)' |
|
787 |
itemValue: ignorePublicPrivateCategories: |
|
788 |
isVisible: false |
|
789 |
indication: ignorePublicPrivateCategories |
|
790 |
) |
|
791 |
(MenuItem |
|
792 |
label: '-' |
|
793 |
) |
|
794 |
(MenuItem |
|
795 |
label: 'Apply into Package...' |
|
796 |
itemValue: setEnforcedPackage |
|
797 |
) |
|
798 |
(MenuItem |
|
799 |
label: 'Apply into NameSpace...' |
|
800 |
itemValue: setEnforcedNameSpace |
|
801 |
) |
|
802 |
(MenuItem |
|
803 |
label: '-' |
|
804 |
) |
|
805 |
(MenuItem |
|
806 |
label: 'Settings...' |
|
807 |
itemValue: openSettingsDialog |
|
7096 | 808 |
) |
809 |
) |
|
810 |
nil |
|
811 |
nil |
|
3202 | 812 |
) |
10681 | 813 |
! |
814 |
||
815 |
toolbarMenuSpec |
|
816 |
"This resource specification was automatically generated |
|
817 |
by the MenuEditor of ST/X." |
|
818 |
||
819 |
"Do not manually edit this!! If it is corrupted, |
|
820 |
the MenuEditor may not be able to read the specification." |
|
821 |
||
822 |
||
823 |
" |
|
824 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#toolbarMenuSpec |
|
825 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser toolbarMenuSpec)) startUp |
|
826 |
" |
|
827 |
||
828 |
<resource: #menu> |
|
829 |
||
830 |
^ |
|
831 |
#(Menu |
|
832 |
( |
|
833 |
(MenuItem |
|
834 |
activeHelpKey: applyChange |
|
835 |
enabled: hasSelectionHolder |
|
836 |
label: 'Apply' |
|
837 |
itemValue: doApply |
|
838 |
translateLabel: true |
|
839 |
isButton: true |
|
840 |
labelImage: (ResourceRetriever ToolbarIconLibrary executeMethod20x20Icon) |
|
841 |
) |
|
842 |
(MenuItem |
|
843 |
label: '-' |
|
844 |
) |
|
845 |
(MenuItem |
|
846 |
activeHelpKey: deleteAllForClass |
|
847 |
enabled: hasSelectionHolder |
|
15016 | 848 |
isVisible: canDeleteChanges |
10681 | 849 |
label: 'Delete all for Class' |
850 |
itemValue: doDeleteClassAll |
|
851 |
translateLabel: true |
|
852 |
isButton: true |
|
853 |
labelImage: (ResourceRetriever ToolbarIconLibrary deleteClass24x24Icon) |
|
854 |
) |
|
13991 | 855 |
(MenuItem |
16022 | 856 |
activeHelpKey: deleteForClassFromBegin |
857 |
enabled: hasSelectionHolder |
|
858 |
isVisible: canDeleteChanges |
|
859 |
label: 'Delete for Class from Beginning' |
|
860 |
itemValue: doDeleteClassFromBeginning |
|
861 |
translateLabel: true |
|
862 |
isButton: true |
|
863 |
labelImage: (ResourceRetriever ToolbarIconLibrary deleteClassFromStart24x24Icon) |
|
864 |
) |
|
865 |
(MenuItem |
|
13991 | 866 |
activeHelpKey: deleteForClassToEnd |
867 |
enabled: hasSelectionHolder |
|
15016 | 868 |
isVisible: canDeleteChanges |
13991 | 869 |
label: 'Delete for Class to End' |
870 |
itemValue: doDeleteClassRest |
|
871 |
translateLabel: true |
|
872 |
isButton: true |
|
873 |
labelImage: (ResourceRetriever ToolbarIconLibrary deleteClassToEnd24x24Icon) |
|
874 |
) |
|
17565 | 875 |
(MenuItem |
876 |
label: '-' |
|
877 |
) |
|
878 |
(MenuItem |
|
879 |
activeHelpKey: deleteClassSelectorAll |
|
880 |
enabled: hasSelectionHolder |
|
881 |
isVisible: canDeleteChanges |
|
882 |
label: 'Delete all Versions of this Method' |
|
883 |
itemValue: doDeleteClassSelectorAll |
|
884 |
translateLabel: true |
|
885 |
isButton: true |
|
886 |
labelImage: (ResourceRetriever ToolbarIconLibrary deleteMethod24x24Icon) |
|
887 |
) |
|
888 |
(MenuItem |
|
889 |
activeHelpKey: deleteClassSelectorOlder |
|
890 |
enabled: hasSelectionHolder |
|
891 |
isVisible: canDeleteChanges |
|
892 |
label: 'Delete older Versions of this Method' |
|
893 |
itemValue: doDeleteClassSelectorOlder |
|
894 |
translateLabel: true |
|
895 |
isButton: true |
|
896 |
labelImage: (ResourceRetriever ToolbarIconLibrary deleteMethodFromStart24x24Icon) |
|
897 |
) |
|
10681 | 898 |
) |
899 |
nil |
|
900 |
nil |
|
901 |
) |
|
17565 | 902 |
|
903 |
"Modified: / 07-07-2017 / 12:52:28 / cg" |
|
3202 | 904 |
! ! |
905 |
||
3674 | 906 |
!ChangesBrowser class methodsFor:'private-changeFile access'! |
907 |
||
908 |
readXMLChangesFrom:aStream inBackground:inBackground |
|
909 |
"read an XML source file (format as in campSmalltalk DTD)" |
|
910 |
||
911 |
|changeSet| |
|
912 |
||
913 |
(XML isNil or:[XML::SourceNodeBuilder isNil or:[XML::XMLParser isNil]]) ifTrue:[ |
|
6288 | 914 |
Smalltalk loadPackage:'stx:goodies/xml/vw'. |
915 |
(XML isNil or:[XML::SourceNodeBuilder isNil or:[XML::XMLParser isNil]]) ifTrue:[ |
|
916 |
self error:'Could not load XML package(s) from ''stx:goodies/xml/vw'''. |
|
917 |
] |
|
3674 | 918 |
]. |
919 |
||
920 |
changeSet := ChangeSet new. |
|
6288 | 921 |
XML::SourceScannerNodeBuilder new |
922 |
scanFile:aStream |
|
923 |
do:[:eachChange | |
|
924 |
changeSet addChange:eachChange. |
|
925 |
]. |
|
3674 | 926 |
^ changeSet |
927 |
||
928 |
"/ builder := XML::SourceScannerNodeBuilder new. |
|
929 |
"/ parser := XML::XMLParser on:aStream. |
|
930 |
"/ parser builder:builder. |
|
931 |
"/ parser validate:false. |
|
932 |
"/ parser scanDocument. |
|
933 |
! |
|
934 |
||
935 |
readXMLChangesFromFile:changeFileName inBackground:inBackground |
|
14011 | 936 |
|set| |
937 |
||
938 |
changeFileName asFilename readingFileDo:[:s| |
|
939 |
set := self readXMLChangesFrom:s inBackground:false. |
|
940 |
]. |
|
3674 | 941 |
^ set. |
942 |
! ! |
|
943 |
||
944 |
!ChangesBrowser class methodsFor:'utilities'! |
|
945 |
||
946 |
isXMLFile:aFilename |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
947 |
|stream first| |
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
948 |
|
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
949 |
stream := aFilename asFilename readStreamOrNil. |
3674 | 950 |
stream isNil ifTrue:[^ false]. |
951 |
||
952 |
stream skipSeparators. |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
953 |
first := stream peek. |
3674 | 954 |
stream close. |
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
955 |
^ first == $< |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
956 |
! |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
957 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
958 |
methodDefinitionSelectors |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
959 |
^ #( |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
960 |
#'methodsFor:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
961 |
#'privateMethodsFor:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
962 |
#'publicMethodsFor:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
963 |
#'ignoredMethodsFor:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
964 |
#'protectedMethodsFor:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
965 |
#'methodsFor:stamp:' "/ Squeak support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
966 |
#'commentStamp:prior:' "/ Squeak support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
967 |
#methodsFor "/ Dolphin support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
968 |
#categoriesForClass "/ Dolphin support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
969 |
#'categoriesFor:' "/ Dolphin support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
970 |
#methods "/ STV support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
971 |
#publicMethods "/ STV / V'Age support |
6532 | 972 |
#privateMethods "/ STV / V'Age support |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
973 |
#'methodsForUndefined:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
974 |
) |
3674 | 975 |
! ! |
976 |
||
3202 | 977 |
!ChangesBrowser methodsFor:'aspects'! |
978 |
||
979 |
applyInOriginalNameSpace |
|
980 |
^ applyInOriginalNameSpace |
|
981 |
! |
|
982 |
||
3472 | 983 |
applyNotInOriginalNameSpace |
6288 | 984 |
^ BlockValue forLogicalNot:self applyInOriginalNameSpace |
3472 | 985 |
! |
986 |
||
3202 | 987 |
autoCompare |
988 |
^ autoCompare |
|
989 |
! |
|
990 |
||
991 |
autoUpdate |
|
992 |
"enabled/disable automatic update from the change-file (for monitoring)" |
|
993 |
||
994 |
^ autoUpdate |
|
995 |
||
996 |
"Created: 3.12.1995 / 14:14:24 / cg" |
|
997 |
"Modified: 3.12.1995 / 14:20:45 / cg" |
|
998 |
! |
|
999 |
||
6216 | 1000 |
autoloadAsRequired |
1001 |
^ autoloadAsRequired |
|
1002 |
! |
|
1003 |
||
15016 | 1004 |
canDeleteChanges |
1005 |
"makes the delete buttons in the toolbar visible" |
|
1006 |
||
1007 |
^ true. |
|
1008 |
! |
|
1009 |
||
11048 | 1010 |
changeListSelectionHolder |
1011 |
changeListSelectionHolder isNil ifTrue:[ |
|
1012 |
changeListSelectionHolder := nil asValue. |
|
1013 |
]. |
|
1014 |
^ changeListSelectionHolder |
|
1015 |
||
1016 |
"Created: / 03-01-2012 / 15:19:25 / cg" |
|
1017 |
! |
|
1018 |
||
3202 | 1019 |
editingClassSource |
3203 | 1020 |
^ editingClassSource ? false |
3202 | 1021 |
! |
1022 |
||
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1023 |
hasMultiSelection |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1024 |
^ self hasSelection and:[self hasSingleSelection not] |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1025 |
! |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1026 |
|
11028 | 1027 |
hasMultiSelectionHolder |
1028 |
^ [ self hasMultiSelection ] |
|
1029 |
||
1030 |
"Created: / 25-12-2011 / 11:21:52 / cg" |
|
1031 |
! |
|
1032 |
||
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1033 |
hasNoMultiSelection |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1034 |
^ self hasMultiSelection not |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1035 |
! |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1036 |
|
11028 | 1037 |
hasNoMultiSelectionHolder |
1038 |
^ [ self hasNoMultiSelection ] |
|
1039 |
||
1040 |
"Created: / 25-12-2011 / 11:21:20 / cg" |
|
1041 |
! |
|
1042 |
||
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1043 |
hasNoSelection |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1044 |
^ self hasSelection not |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1045 |
! |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1046 |
|
3202 | 1047 |
hasSelection |
17924 | 1048 |
"true if a change is selected" |
1049 |
||
6288 | 1050 |
^ changeListView hasSelection |
3202 | 1051 |
! |
1052 |
||
11048 | 1053 |
hasSelectionHolder |
1054 |
^ BlockValue |
|
1055 |
with:[:v | v notEmptyOrNil ] |
|
1056 |
argument:(self changeListSelectionHolder) |
|
1057 |
||
1058 |
"Created: / 03-01-2012 / 15:15:47 / cg" |
|
1059 |
! |
|
1060 |
||
3211 | 1061 |
hasSingleSelection |
1062 |
changeListView multipleSelectOk ifTrue:[ |
|
6288 | 1063 |
^ changeListView selection size == 1 |
3211 | 1064 |
]. |
1065 |
^ changeListView hasSelection |
|
1066 |
! |
|
1067 |
||
10719 | 1068 |
ignorePublicPrivateCategories |
1069 |
^ ignorePublicPrivateCategories |
|
1070 |
||
1071 |
"Created: / 23-09-2011 / 19:42:46 / cg" |
|
1072 |
! |
|
1073 |
||
18136 | 1074 |
leftCodeLabel:aString |
1075 |
"change the string shown above the left codeView (defaults to: 'Current')" |
|
1076 |
||
1077 |
self leftCodeLabelHolder value:aString |
|
1078 |
||
1079 |
"Created: / 07-12-2017 / 12:28:37 / cg" |
|
1080 |
! |
|
1081 |
||
17848 | 1082 |
leftCodeLabelHolder |
1083 |
"holds the string shown above the left codeView (defaults to: 'Current')" |
|
1084 |
||
1085 |
^ leftCodeLabelHolder |
|
1086 |
||
1087 |
"Created: / 07-12-2017 / 12:28:31 / cg" |
|
1088 |
! |
|
1089 |
||
3202 | 1090 |
notEditingClassSource |
1091 |
^ self editingClassSource not |
|
3211 | 1092 |
! |
1093 |
||
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1094 |
notEditingClassSourceAndNotReadOnly |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1095 |
^ (self editingClassSource or:[readOnly == true]) not |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1096 |
! |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1097 |
|
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1098 |
notReadOnly |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1099 |
^ (readOnly ~~ true) |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1100 |
! |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1101 |
|
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1102 |
readOnly:aBoolean |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1103 |
readOnly := aBoolean |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1104 |
! |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1105 |
|
18136 | 1106 |
rightCodeLabel:aString |
1107 |
"change the string shown above the right codeView (defaults to: 'Change')" |
|
1108 |
||
1109 |
self rightCodeLabelHolder value:aString |
|
1110 |
||
1111 |
"Created: / 07-12-2017 / 12:28:37 / cg" |
|
1112 |
! |
|
1113 |
||
17848 | 1114 |
rightCodeLabelHolder |
1115 |
"holds the string shown above the right codeView (defaults to: 'Change')" |
|
1116 |
||
1117 |
^ rightCodeLabelHolder |
|
1118 |
||
1119 |
"Created: / 07-12-2017 / 12:28:37 / cg" |
|
1120 |
! |
|
1121 |
||
4487 | 1122 |
showingDiffs |
1123 |
showingDiffs isNil ifTrue:[ |
|
6288 | 1124 |
showingDiffs := self showingDiffsDefault asValue. |
1125 |
showingDiffs |
|
1126 |
onChangeEvaluate:[ |
|
1127 |
showingDiffs value ifTrue:[ |
|
1128 |
self updateDiffView. |
|
1129 |
self makeDiffViewVisible |
|
1130 |
] ifFalse:[ |
|
1131 |
self makeDiffViewInvisible |
|
1132 |
]. |
|
1133 |
DefaultShowingDiffs := showingDiffs value. |
|
1134 |
] |
|
4487 | 1135 |
]. |
1136 |
^ showingDiffs |
|
1137 |
! |
|
1138 |
||
4943 | 1139 |
showingDiffsDefault |
1140 |
^ (DefaultShowingDiffs ? true) |
|
1141 |
! |
|
1142 |
||
3211 | 1143 |
theSingleSelection |
1144 |
|sel| |
|
1145 |
||
1146 |
sel := changeListView selection. |
|
1147 |
changeListView multipleSelectOk ifTrue:[ |
|
6288 | 1148 |
sel size == 1 ifTrue:[ |
1149 |
^ sel first |
|
1150 |
]. |
|
1151 |
^ nil |
|
3211 | 1152 |
]. |
1153 |
^ sel. |
|
3319 | 1154 |
! |
1155 |
||
1156 |
updateChangeSet |
|
1157 |
^ updateChangeSet |
|
3202 | 1158 |
! ! |
1159 |
||
202 | 1160 |
!ChangesBrowser methodsFor:'compiler interface'! |
1161 |
||
1162 |
wantChangeLog |
|
1163 |
"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
|
1164 |
be written when compiling. Return false here." |
202 | 1165 |
|
1166 |
^ false |
|
1167 |
! ! |
|
1168 |
||
4869 | 1169 |
!ChangesBrowser methodsFor:'compiler interface-error handling'! |
202 | 1170 |
|
1171 |
correctableError:aString position:relPos to:relEndPos from:aCompiler |
|
12656 | 1172 |
"compiler notifies us of an error - this should really not happen since |
202 | 1173 |
changes ought to be correct (did someone edit the changes file ??). |
1174 |
Show the bad change in the codeView and let codeView hilight the error; |
|
1175 |
no corrections allowed here therefore return false" |
|
1176 |
||
2293 | 1177 |
ShowWarningDialogs == true ifTrue:[ |
12656 | 1178 |
self error:aString position:relPos to:relEndPos from:aCompiler. |
2293 | 1179 |
] ifFalse:[ |
12656 | 1180 |
Transcript showCR:aString. |
2293 | 1181 |
]. |
202 | 1182 |
^ false |
1183 |
! |
|
1184 |
||
2555 | 1185 |
correctableSelectorWarning:aString position:relPos to:relEndPos from:aCompiler |
12656 | 1186 |
"compiler notifies us of a warning" |
2555 | 1187 |
|
1188 |
^ false |
|
1189 |
||
1190 |
"Modified: / 19.1.2000 / 16:25:31 / cg" |
|
1191 |
"Created: / 19.1.2000 / 16:27:23 / cg" |
|
1192 |
! |
|
1193 |
||
9621
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1194 |
correctableWarning:aString position:relPos to:relEndPos from:aCompiler |
12656 | 1195 |
"compiler notifies us of an error - this should really not happen since |
9621
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1196 |
changes ought to be correct (did someone edit the changes file ??). |
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1197 |
Show the bad change in the codeView and let codeView hilight the error; |
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1198 |
no corrections allowed here therefore return false" |
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1199 |
|
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1200 |
^ self correctableError:aString position:relPos to:relEndPos from:aCompiler |
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1201 |
|
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1202 |
"Created: / 02-11-2010 / 13:29:52 / cg" |
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1203 |
! |
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1204 |
|
202 | 1205 |
error:aString position:relPos to:relEndPos from:aCompiler |
12656 | 1206 |
"compiler notifies us of an error - this should really not happen since |
202 | 1207 |
changes ought to be correct (did someone edit the changes file ??). |
1208 |
Show the bad change in the codeView and let codeView hilight the error" |
|
1209 |
||
1210 |
|action| |
|
1211 |
||
1212 |
(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
|
1213 |
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
|
1214 |
]. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1215 |
|
12973 | 1216 |
"if more than a single change is applied, |
7783
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1217 |
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
|
1218 |
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
|
1219 |
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
|
1220 |
|box| |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1221 |
|
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1222 |
" |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1223 |
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
|
1224 |
" |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1225 |
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
|
1226 |
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
|
1227 |
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
|
1228 |
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
|
1229 |
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
|
1230 |
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
|
1231 |
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
|
1232 |
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
|
1233 |
]. |
2293 | 1234 |
|
1235 |
"/ action == #shutUp ifTrue:[ |
|
1236 |
"/ aCompiler ignoreWarnings. |
|
6288 | 1237 |
"/ ^ false |
2293 | 1238 |
"/ ]. |
1239 |
||
7783
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1240 |
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
|
1241 |
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
|
1242 |
^ false |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1243 |
]. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1244 |
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
|
1245 |
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
|
1246 |
^ false |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1247 |
]. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1248 |
^ false |
202 | 1249 |
]. |
1250 |
^ codeView error:aString position:relPos to:relEndPos from:aCompiler |
|
373 | 1251 |
|
3436
c4fe19deba58
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3406
diff
changeset
|
1252 |
"Modified: / 16.11.2001 / 17:38:10 / cg" |
202 | 1253 |
! |
1254 |
||
3064 | 1255 |
unusedVariableWarning:aString position:relPos to:relEndPos from:aCompiler |
1256 |
"compiler notifies us of a (or some) unused variables; |
|
1257 |
hilight the error (relPos to relEndPos) and show a Box asking for continue/correct/abort; |
|
1258 |
this method should return true to the compiler if user wants the error |
|
1259 |
to be corrected; false otherwise" |
|
1260 |
||
1261 |
^ false |
|
1262 |
! |
|
1263 |
||
202 | 1264 |
warning:aString position:relPos to:relEndPos from:aCompiler |
12656 | 1265 |
"compiler notifies us of a warning - ignore it" |
202 | 1266 |
|
1267 |
^ self |
|
1268 |
! ! |
|
1269 |
||
2604 | 1270 |
!ChangesBrowser methodsFor:'event handling'! |
202 | 1271 |
|
1272 |
handlesKeyPress:key inView:view |
|
1273 |
"this method is reached via delegation: are we prepared to handle |
|
1274 |
a keyPress in some other view ?" |
|
1275 |
||
1127 | 1276 |
<resource: #keyboard (#Delete #BackSpace #Accept #Find #FindPrev #FindNext)> |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
1277 |
|
202 | 1278 |
view == changeListView ifTrue:[ |
6288 | 1279 |
(key == #Delete |
1280 |
or:[key == #BackSpace |
|
1281 |
or:[key == #Accept |
|
1282 |
or:[key == #Find |
|
1283 |
or:[key == #FindPrev |
|
1284 |
or:[key == #FindNext]]]]]) ifTrue:[^ true]. |
|
202 | 1285 |
]. |
1286 |
^ false |
|
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
1287 |
|
1127 | 1288 |
"Modified: 8.4.1997 / 11:01:42 / cg" |
0 | 1289 |
! |
1290 |
||
202 | 1291 |
keyPress:key x:x y:y view:view |
1292 |
"this method is reached via delegation from the changeListView" |
|
1293 |
||
1127 | 1294 |
<resource: #keyboard (#Delete #BackSpace #Accept #Find #FindPrev #FindNext)> |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
1295 |
|
3249 | 1296 |
(key == #Delete) ifTrue:[ |
13078 | 1297 |
self sensor shiftDown ifTrue:[ |
1298 |
self doDeleteAndSelectPrevious. |
|
1299 |
] ifFalse:[ |
|
1300 |
self doDelete. |
|
1301 |
]. |
|
1302 |
^ self |
|
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
1303 |
]. |
3249 | 1304 |
(key == #BackSpace) ifTrue:[ |
13078 | 1305 |
self doDelete. "/ doDeleteAndSelectPrevious. |
1306 |
^ self |
|
3249 | 1307 |
]. |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
1308 |
(key == #Accept) ifTrue:[ |
13078 | 1309 |
self doApply. |
1310 |
^ self |
|
202 | 1311 |
]. |
1127 | 1312 |
(key == #Find) ifTrue:[ |
13078 | 1313 |
self findClass. |
1314 |
^ self |
|
1127 | 1315 |
]. |
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1316 |
(key == #FindPrev) ifTrue:[ |
13078 | 1317 |
self findPrevious. |
1318 |
^ self |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1319 |
]. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1320 |
(key == #FindNext) ifTrue:[ |
13078 | 1321 |
self findNext. |
1322 |
^ self |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1323 |
]. |
202 | 1324 |
changeListView keyPress:key x:x y:y |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
1325 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
1326 |
"Modified: / 18.6.1998 / 22:15:36 / cg" |
202 | 1327 |
! ! |
1328 |
||
3327 | 1329 |
!ChangesBrowser methodsFor:'help'! |
202 | 1330 |
|
394 | 1331 |
showActivity:someMessage |
502 | 1332 |
"some activityNotification to be forwarded to the user; |
1333 |
show it in the windows title area here." |
|
1334 |
||
11346 | 1335 |
someMessage isNil ifTrue:[ |
1336 |
self newLabel:'' |
|
11347 | 1337 |
] ifFalse:[ |
1338 |
self label:someMessage |
|
1339 |
]. |
|
394 | 1340 |
|
1341 |
"Created: 24.2.1996 / 19:35:42 / cg" |
|
502 | 1342 |
"Modified: 23.4.1996 / 21:39:36 / cg" |
202 | 1343 |
! ! |
1344 |
||
4868 | 1345 |
!ChangesBrowser methodsFor:'initialization & release'! |
202 | 1346 |
|
3202 | 1347 |
autoCompareChanged |
1348 |
"sent from the compare-toggle" |
|
1349 |
||
3534 | 1350 |
|doCompare| |
1351 |
||
13373 | 1352 |
self askIfChangesAreToBeWrittenBack. |
1353 |
||
3534 | 1354 |
doCompare := autoCompare value. |
1355 |
DefaultAutoCompare := doCompare. |
|
1356 |
self setupTabSpec. |
|
1357 |
doCompare ifTrue:[ |
|
13373 | 1358 |
self doUpdate |
3202 | 1359 |
] ifFalse:[ |
13373 | 1360 |
changeListView invalidate. "/ clear; redraw. |
3202 | 1361 |
] |
1362 |
! |
|
1363 |
||
202 | 1364 |
changeListMenu |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1365 |
"return the menu for the change (upper) list" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1366 |
|
586 | 1367 |
<resource: #keyboard ( #Accept #Delete ) > |
1359 | 1368 |
<resource: #programMenu > |
586 | 1369 |
|
3211 | 1370 |
|items m replNext replPrev sel| |
1670
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1371 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
1372 |
self sensor ctrlDown ifTrue:[ |
7360 | 1373 |
"/ notice - findNext/prev shortKeys will search for the same thing again. |
1374 |
items := #( |
|
1375 |
('Search Class...' findClass #Find ) |
|
1376 |
('Previous for this Class' findPreviousForClass #FindPrevClass ) |
|
1377 |
('Next for this Class' findNextForClass #FindNextClass ) |
|
1378 |
('-' ) |
|
1379 |
('Search Selector...' findSelector ) |
|
1380 |
('Previous with this Selector' findPreviousForSelector #FindPrevSelector ) |
|
1381 |
('Next with this Selector' findNextForSelector #FindNextSelector ) |
|
1382 |
('-' ) |
|
1383 |
('Search String...' findString ) |
|
1384 |
('Previous with this String' findPreviousForString #FindPrevString ) |
|
1385 |
('Next with this String' findNextForString #FindNextString ) |
|
1386 |
('-' ) |
|
1387 |
('Previous Snapshot' findPreviousSnapshot #FindPrevSnapshot ) |
|
1388 |
('Next Snapshot' findNextSnapshot #FindNextSnapshot ) |
|
1389 |
). |
|
1390 |
||
1391 |
lastSearchType == #selector ifTrue:[ |
|
1392 |
replNext := #FindNextSelector. |
|
1393 |
replPrev := #FindPrevSelector. |
|
1394 |
] ifFalse:[ |
|
1395 |
lastSearchType == #snapshot ifTrue:[ |
|
1396 |
replNext := #FindNextSnapshot. |
|
1397 |
replPrev := #FindPrevSnapshot. |
|
1398 |
] ifFalse:[ |
|
1399 |
lastSearchType == #string ifTrue:[ |
|
1400 |
replNext := #FindNextString. |
|
1401 |
replPrev := #FindPrevString. |
|
1402 |
] ifFalse:[ |
|
1403 |
replNext := #FindNextClass. |
|
1404 |
replPrev := #FindPrevClass. |
|
1405 |
] |
|
1406 |
] |
|
1407 |
]. |
|
1408 |
items := items deepCopy. |
|
1409 |
items do:[:each | |
|
1410 |
each replaceAll:replNext with:#FindNext. |
|
1411 |
each replaceAll:replPrev with:#FindPrev. |
|
1412 |
each replaceAny:#(FindNextClass FindPrevClass |
|
1413 |
FindNextSelector FindPrevSelector |
|
1414 |
FindNextSnapshot FindPrevSnapshot |
|
1415 |
FindNextString FindPrevString) |
|
1416 |
with:nil. |
|
1417 |
]. |
|
1418 |
||
1419 |
^ PopUpMenu itemList:items resources:resources. |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
1420 |
]. |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
1421 |
|
1670
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1422 |
items := #( |
7360 | 1423 |
('Apply' doApply Accept) |
1424 |
('Apply to End' doApplyRest ) |
|
1425 |
('Apply from Begin' doApplyFromBeginning ) |
|
1426 |
('Apply for Class to End' doApplyClassRest ) |
|
1427 |
('Apply for Class from Begin' doApplyClassFromBeginning ) |
|
1428 |
('Apply All' doApplyAll ) |
|
1429 |
('-' ) |
|
1430 |
('Delete' doDelete Delete) |
|
1431 |
('Delete to End' doDeleteRest ) |
|
1432 |
('Delete for Class to End' doDeleteClassRest ) |
|
1433 |
('Delete for Class from Begin' doDeleteClassFromBeginning ) |
|
1434 |
). |
|
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1435 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1436 |
(self hasSelection and:[self hasSingleSelection not]) ifTrue:[ |
7360 | 1437 |
items := items , |
1438 |
#( |
|
15187 | 1439 |
('Delete all for Classes' doDeleteClassAll ) |
1440 |
('Delete all for Classes & their Private Classes' doDeleteClassAndPrivateClassesAll ) |
|
7360 | 1441 |
). |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1442 |
] ifFalse:[ |
7360 | 1443 |
items := items , |
1444 |
#( |
|
15187 | 1445 |
('Delete all for Class' doDeleteClassAll ) |
1446 |
('Delete all for Class & its Private Classes' doDeleteClassAndPrivateClassesAll ) |
|
7360 | 1447 |
). |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1448 |
]. |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1449 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1450 |
items := items , |
7360 | 1451 |
#( |
1452 |
('-' ) |
|
1453 |
('Compress' doCompress ) |
|
1454 |
('Compress for Class' doCompressClass ) |
|
1455 |
('Compare and Compress' doCompareAndCompress ) |
|
1456 |
('-' ) |
|
1457 |
('Compare with current Version' doCompare ) |
|
1458 |
('Browse Class' doBrowse ) |
|
1459 |
('-' ) |
|
1460 |
('Make Change a Patch' doMakePatch ) |
|
1461 |
). |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1462 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1463 |
editingClassSource ifFalse:[ |
7360 | 1464 |
items := items , #( |
15187 | 1465 |
('Fileout & Delete all for Class' doFileoutAndDeleteClassAll ) |
1466 |
('CheckIn & Delete all for Class' doCheckinAndDeleteClassAll ) |
|
7360 | 1467 |
) |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1468 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1469 |
|
1670
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1470 |
items := items , #( |
7360 | 1471 |
('-' ) |
1472 |
('Save in...' doSave ) |
|
1473 |
('Save to End In...' doSaveRest ) |
|
1474 |
('Save for Class to End In...' doSaveClassRest ) |
|
1475 |
('Save all for Class In...' doSaveClassAll ) |
|
1476 |
('-' ) |
|
1477 |
). |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1478 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1479 |
editingClassSource ifTrue:[ |
7360 | 1480 |
items := items , #( |
1481 |
('Writeback ClassFile' doWriteBack ) |
|
1482 |
) |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1483 |
] ifFalse:[ |
7360 | 1484 |
items := items , #( |
1485 |
('Writeback ChangeFile' doWriteBack ) |
|
1486 |
) |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1487 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1488 |
|
1833
c9b1a30b326d
moved update item to the end
Claus Gittinger <cg@exept.de>
parents:
1788
diff
changeset
|
1489 |
items := items , #( |
7360 | 1490 |
('-' ) |
1491 |
('Update' doUpdate ) |
|
1492 |
). |
|
1670
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1493 |
|
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1494 |
m := PopUpMenu itemList:items resources:resources. |
202 | 1495 |
|
255 | 1496 |
"/ |
1497 |
"/ disable those that require a selected entry |
|
1498 |
"/ |
|
3202 | 1499 |
self hasSelection ifFalse:[ |
7360 | 1500 |
m disableAll:#(doApply doApplyClassRest doApplyRest doDelete doDeleteRest doDeleteClassRest |
1501 |
doDeleteClassFromBeginning doDeleteClassAll doDeleteClassAndPrivateClassesAll |
|
1502 |
doCompare doCompressClass doMakePatch doSaveChangeInFile doMakePermanent |
|
1503 |
doSave doSaveRest doSaveClassAll doSaveClassRest doBrowse |
|
1504 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll) |
|
1368 | 1505 |
] ifTrue:[ |
7360 | 1506 |
sel := self theSingleSelection. |
1507 |
sel isNil ifTrue:[ |
|
1508 |
"/ multiple selections |
|
1509 |
m disableAll:#(doApplyClassRest doApplyRest doDeleteClassRest doDeleteRest |
|
1510 |
doDeleteClassFromBeginning |
|
1511 |
doCompressClass doCompare |
|
1512 |
doSaveClassAll doSaveClassRest doSaveRest doBrowse |
|
1513 |
doFileoutAndDeleteClassAll) |
|
1514 |
] ifFalse:[ |
|
1515 |
(self classNameOfChange:sel) isNil ifTrue:[ |
|
1516 |
m disableAll:#(doApplyClassRest doDeleteClassRest |
|
1517 |
doDeleteClassFromBeginning doDeleteClassAll doDeleteClassAndPrivateClassesAll |
|
1518 |
doCompressClass doCompare doMakePatch |
|
1519 |
doSaveClassAll doSaveClassRest doBrowse |
|
1520 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll) |
|
1521 |
] |
|
1522 |
] |
|
255 | 1523 |
]. |
1524 |
||
1525 |
"/ |
|
1526 |
"/ disable those that do not make sense with autoUpdate |
|
1527 |
"/ ('cause this would be overwritten by next update operation) |
|
1528 |
"/ |
|
3202 | 1529 |
autoUpdate value ifTrue:[ |
7360 | 1530 |
m disableAll:#(doDelete doDeleteRest doDeleteClassRest doDeleteClassAll |
1531 |
doDeleteClassAndPrivateClassesAll doCompress |
|
1532 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll |
|
1533 |
doWriteBack) |
|
202 | 1534 |
]. |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1535 |
readOnly == true ifTrue:[ |
7360 | 1536 |
m disableAll:#(doDelete doDeleteRest doDeleteClassRest doDeleteClassAll |
1537 |
doDeleteClassAndPrivateClassesAll doCompress |
|
1538 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll |
|
1539 |
doWriteBack doSaveBack doUpdate |
|
1540 |
doApplyAll doApplyRest) |
|
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1541 |
]. |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1542 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1543 |
self hasSelection ifTrue:[ |
7360 | 1544 |
m disable:#doApplyAll |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1545 |
]. |
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1546 |
|
202 | 1547 |
^ m |
1548 |
||
7360 | 1549 |
"Modified: / 06-09-1995 / 17:14:22 / claus" |
1550 |
"Modified: / 06-10-2006 / 11:17:06 / cg" |
|
202 | 1551 |
! |
1552 |
||
2114 | 1553 |
destroy |
1554 |
"destroy the receiver; make certain, that boxes are destroyed too" |
|
1555 |
||
1556 |
Processor removeTimedBlock:checkBlock. |
|
1557 |
ObjectMemory removeDependent:self. |
|
1558 |
super destroy |
|
1559 |
! |
|
1560 |
||
202 | 1561 |
initialize |
16467 | 1562 |
|panel infoLabel v upperFrame buttonPanel menuPanel mH toolbarMenu tmH |
9168 | 1563 |
checkBox oldStyle codeViewBox lbl applyInOriginal| |
3202 | 1564 |
|
17848 | 1565 |
leftCodeLabelHolder := 'Current' asValue. |
1566 |
rightCodeLabelHolder := 'Change' asValue. |
|
1567 |
||
3211 | 1568 |
"/ oldStyle := true. |
3202 | 1569 |
oldStyle := false. |
202 | 1570 |
|
1571 |
super initialize. |
|
1572 |
||
5702 | 1573 |
changeFileName := ObjectMemory nameForChanges. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
1574 |
encodingIfKnown := nil. |
17968 | 1575 |
autoCompare := (DefaultAutoCompare ? true) asValue. |
3202 | 1576 |
autoCompare onChangeSend:#autoCompareChanged to:self. |
1577 |
autoUpdate := false asValue. |
|
6216 | 1578 |
autoloadAsRequired := false asValue. |
10719 | 1579 |
ignorePublicPrivateCategories := false asValue. |
9168 | 1580 |
|
1581 |
applyInOriginal := true. |
|
1582 |
KeepEnforcedNameSpace == true ifTrue:[ |
|
1583 |
enforcedNameSpace := LastEnforcedNameSpace. |
|
1584 |
applyInOriginal := false. |
|
1585 |
]. |
|
1586 |
||
1587 |
applyInOriginalNameSpace := applyInOriginal asValue. |
|
6288 | 1588 |
applyInOriginalNameSpace |
6357 | 1589 |
onChangeEvaluate:[ |
1590 |
autoCompare value ifTrue:[ |
|
1591 |
self doUpdate |
|
1592 |
]. |
|
1593 |
]. |
|
9168 | 1594 |
|
4897 | 1595 |
updateChangeSet := true "false" asValue. |
8026
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
1596 |
classesNotToBeAutoloaded := Set new. |
221 | 1597 |
|
1099
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1598 |
" |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1599 |
checkBlock is executed by the Processor. |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1600 |
We use #pushEvent: to perform the update |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1601 |
in our windowgroups process. |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1602 |
" |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1603 |
checkBlock := [self pushEvent:#checkIfFileHasChanged]. |
202 | 1604 |
|
3202 | 1605 |
oldStyle ifFalse:[ |
6357 | 1606 |
menuPanel := MenuPanel in:self. |
1607 |
"/ menuPanel level:1. |
|
1608 |
menuPanel verticalLayout:false. |
|
1609 |
menuPanel receiver:self. |
|
1610 |
menuPanel menu:(self pullDownMenu). |
|
1611 |
||
8164
ee17624160a6
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8102
diff
changeset
|
1612 |
mH := menuPanel preferredHeight. |
6357 | 1613 |
menuPanel origin:(0.0 @ 0.0) corner:(1.0 @ (mH)). |
1614 |
mH := mH + 1. |
|
10681 | 1615 |
|
1616 |
toolbarMenu := MenuPanel in:self. |
|
1617 |
toolbarMenu verticalLayout:false. |
|
1618 |
toolbarMenu receiver:self. |
|
1619 |
toolbarMenu menu:(self toolbarMenu). |
|
17899 | 1620 |
toolbarMenu helpSpecProvider:self. "/ for helpTexts |
10681 | 1621 |
|
1622 |
tmH := toolbarMenu preferredHeight. |
|
1623 |
toolbarMenu origin:(0.0 @ mH) corner:(1.0 @ (mH+tmH)). |
|
1624 |
mH := mH + tmH + 1. |
|
3202 | 1625 |
] ifTrue:[ |
6357 | 1626 |
mH := 0.0 |
3202 | 1627 |
]. |
1628 |
||
16467 | 1629 |
panel := VariableVerticalPanel in:self. |
1630 |
"/ panel origin:(0.0 @ mH) corner:(1.0 @ 1.0) |
|
1631 |
panel layout:(LayoutFrame |
|
1632 |
leftFraction:0.0 offset:0 |
|
1633 |
rightFraction:1.0 offset:0 |
|
1634 |
topFraction:0.0 offset:mH |
|
1635 |
bottomFraction:1.0 offset:-30). |
|
1636 |
panel borderWidth:0. |
|
1637 |
||
1638 |
infoLabel := Label in:self. |
|
1639 |
infoLabel layout:(LayoutFrame |
|
1640 |
leftFraction:0.0 offset:0 |
|
1641 |
rightFraction:1.0 offset:0 |
|
1642 |
topFraction:1.0 offset:-28 |
|
1643 |
bottomFraction:1.0 offset:-2). |
|
1644 |
infoLabel borderWidth:0. |
|
1645 |
infoLabel sizeFixed:true. |
|
1646 |
infoLabel level:-1. |
|
1647 |
infoLabel adjust:#left. |
|
1648 |
infoLabel labelChannel:(infoHolder := '' asValue). |
|
1649 |
||
3202 | 1650 |
upperFrame := panel. |
1651 |
oldStyle ifTrue:[ |
|
6357 | 1652 |
upperFrame := VariableHorizontalPanel origin:(0.0 @ 0.0) corner:(1.0 @ 0.3) in:panel. |
3202 | 1653 |
]. |
202 | 1654 |
|
1655 |
v := HVScrollableView for:SelectionInListView miniScrollerH:true in:upperFrame. |
|
3202 | 1656 |
oldStyle ifTrue:[ |
6357 | 1657 |
v origin:(0.0 @ 0.0) corner:(0.75 @ 1.0). |
3202 | 1658 |
] ifFalse:[ |
6357 | 1659 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.3). |
3202 | 1660 |
]. |
3090 | 1661 |
|
202 | 1662 |
changeListView := v scrolledView. |
1663 |
changeListView delegate:self. |
|
1664 |
changeListView menuHolder:self; menuPerformer:self; menuMessage:#changeListMenu. |
|
1471 | 1665 |
changeListView doubleClickAction:[:line | self doubleClickOnChange:line]. |
3211 | 1666 |
oldStyle ifFalse:[ |
6357 | 1667 |
changeListView multipleSelectOk:true. |
3211 | 1668 |
]. |
202 | 1669 |
|
3202 | 1670 |
oldStyle ifTrue:[ |
6357 | 1671 |
buttonPanel := VerticalPanelView in:upperFrame. |
1672 |
buttonPanel origin:(0.75 @ 0.0) corner:(1.0 @ 1.0). |
|
1673 |
buttonPanel verticalLayout:#topSpace; horizontalLayout:#leftSpace. |
|
1674 |
||
1675 |
checkBox := CheckBox new model:autoCompare. |
|
1676 |
checkBox label:(resources string:'Auto Compare'). |
|
1677 |
checkBox action:[:val | autoCompare value:val]. |
|
1678 |
buttonPanel addSubView:checkBox. |
|
1679 |
||
1680 |
checkBox := CheckBox new model:autoUpdate. |
|
1681 |
checkBox label:(resources string:'Auto Update'). |
|
1682 |
checkBox action:[:val | autoUpdate value:val]. |
|
1683 |
buttonPanel addSubView:checkBox. |
|
1684 |
||
1685 |
checkBox := CheckBox new. |
|
1686 |
checkBox label:(resources stringWithCRs:'Apply in original NameSpace'). |
|
1687 |
checkBox model:applyInOriginalNameSpace. |
|
1688 |
buttonPanel addSubView:checkBox. |
|
3202 | 1689 |
]. |
2301 | 1690 |
|
3090 | 1691 |
"/ protectExistingMethods := CheckBox new. |
1692 |
"/ protectExistingMethods label:(resources string:'Protect existing code' withCRs). |
|
1693 |
"/ protectExistingMethods model:protectExistingMethods. |
|
1694 |
"/ buttonPanel addSubView:protectExistingMethods. |
|
1695 |
||
4487 | 1696 |
codeViewBox := View in:panel. |
1697 |
codeViewBox origin:(0.0 @ 0.3) corner:(1.0 @ 1.0). |
|
1698 |
||
1699 |
v := HVScrollableView for:CodeView miniScrollerH:true miniScrollerV:false in:codeViewBox. |
|
1700 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
202 | 1701 |
codeView := v scrolledView. |
1996 | 1702 |
codeView readOnly:true. |
202 | 1703 |
|
4487 | 1704 |
diffViewBox := View in:codeViewBox. |
1705 |
diffViewBox origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
1706 |
||
17848 | 1707 |
lbl := Label label:leftCodeLabelHolder value in:diffViewBox. |
1708 |
lbl labelChannel:leftCodeLabelHolder. |
|
4487 | 1709 |
lbl layout:(LayoutFrame |
6357 | 1710 |
leftFraction:0.0 offset:0 |
1711 |
rightFraction:0.5 offset:0 |
|
1712 |
topFraction:0.0 offset:0 |
|
1713 |
bottomFraction:0.0 offset:20). |
|
17848 | 1714 |
lbl := Label label:rightCodeLabelHolder value in:diffViewBox. |
1715 |
lbl labelChannel:rightCodeLabelHolder. |
|
4487 | 1716 |
lbl layout:(LayoutFrame |
6357 | 1717 |
leftFraction:0.5 offset:0 |
1718 |
rightFraction:1.0 offset:0 |
|
1719 |
topFraction:0.0 offset:0 |
|
1720 |
bottomFraction:0.0 offset:20). |
|
4487 | 1721 |
|
1722 |
"/ diffView := DiffTextView in:diffViewBox. |
|
1723 |
"/ diffView layout:(LayoutFrame |
|
1724 |
"/ leftFraction:0.0 offset:0 |
|
1725 |
"/ rightFraction:1.0 offset:0 |
|
1726 |
"/ topFraction:0.0 offset:20 |
|
1727 |
"/ bottomFraction:1.0 offset:0). |
|
1728 |
||
8102 | 1729 |
v := HVScrollableView for:DiffCodeView miniScrollerH:true miniScrollerV:false in:diffViewBox. |
4487 | 1730 |
v layout:(LayoutFrame |
6357 | 1731 |
leftFraction:0.0 offset:0 |
1732 |
rightFraction:1.0 offset:0 |
|
1733 |
topFraction:0.0 offset:20 |
|
1734 |
bottomFraction:1.0 offset:0). |
|
4487 | 1735 |
diffView := v scrolledView. |
1736 |
||
1737 |
self showingDiffs value ifFalse:[ |
|
6357 | 1738 |
self makeDiffViewInvisible |
4487 | 1739 |
]. |
1740 |
||
202 | 1741 |
anyChanges := false. |
1742 |
ObjectMemory addDependent:self. "to get shutdown-update" |
|
1743 |
||
1744 |
tabSpec := TabulatorSpecification new. |
|
1745 |
tabSpec unit:#inch. |
|
1746 |
tabSpec positions:#(-1 0 5 8.5 ). |
|
1747 |
" +/- cls>>sel type info" |
|
1748 |
tabSpec align: #(#left #left #left #left). |
|
1749 |
||
10681 | 1750 |
"Modified: / 27-03-1997 / 11:07:07 / stefan" |
17848 | 1751 |
"Modified: / 07-12-2017 / 12:28:09 / cg" |
202 | 1752 |
! |
1753 |
||
1246
9ed3722bd2f2
setup in #postRealize instead of #realize
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
1754 |
postRealize |
3534 | 1755 |
self setupTabSpec. |
202 | 1756 |
self readChangesFileInBackground:true. |
18059 | 1757 |
self updateChangeList. |
16467 | 1758 |
changeListView action:[:lineNrOrCollection | self changeSelection:lineNrOrCollection]. |
202 | 1759 |
Processor addTimedBlock:checkBlock afterSeconds:5. |
1246
9ed3722bd2f2
setup in #postRealize instead of #realize
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
1760 |
|
9ed3722bd2f2
setup in #postRealize instead of #realize
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
1761 |
"Created: 24.7.1997 / 18:06:12 / cg" |
202 | 1762 |
! |
1763 |
||
3202 | 1764 |
pullDownMenu |
1765 |
"return the top (pullDown) menu" |
|
1766 |
||
1767 |
<resource: #programMenu> |
|
1768 |
||
3330 | 1769 |
^ self menuFromSpec:self class menuSpec. |
1770 |
||
1771 |
"/ |m| |
|
1772 |
"/ |
|
1773 |
"/ m := self class menuSpec. |
|
1774 |
"/ m := m decodeAsLiteralArray. |
|
1775 |
"/ m receiver:self. |
|
1776 |
"/ m findGuiResourcesIn:self. |
|
1777 |
"/ ^ m. |
|
3202 | 1778 |
! |
1779 |
||
3534 | 1780 |
setupTabSpec |
1781 |
autoCompare value ifTrue:[ |
|
9515 | 1782 |
tabSpec positions:#(0 0.15 7 9.5 ). |
3534 | 1783 |
] ifFalse:[ |
9515 | 1784 |
"/ |
1785 |
"/ set tabs to hide compare-column |
|
1786 |
"/ |
|
1787 |
tabSpec positions:#(-1 0 7 9.5 ). |
|
3534 | 1788 |
] |
9515 | 1789 |
|
1790 |
"Modified: / 10-07-2010 / 10:59:49 / cg" |
|
3534 | 1791 |
! |
1792 |
||
10681 | 1793 |
toolbarMenu |
1794 |
"return the top (pullDown) menu" |
|
1795 |
||
1796 |
<resource: #programMenu> |
|
1797 |
||
1798 |
^ self menuFromSpec:self class toolbarMenuSpec. |
|
1799 |
||
1800 |
"Created: / 07-09-2011 / 16:03:41 / cg" |
|
1801 |
! |
|
1802 |
||
627 | 1803 |
update:what with:aParameter from:changedObject |
202 | 1804 |
|box| |
1805 |
||
8558
a85166102cb7
Wait for #aboutToQuit change message instead of obsolete #aboutToExit
Stefan Vogel <sv@exept.de>
parents:
8515
diff
changeset
|
1806 |
(what == #aboutToQuit) ifTrue:[ |
6639 | 1807 |
" |
1808 |
smalltalk is about to shut down - |
|
1809 |
- if change list was modified, ask user and save if requested. |
|
1810 |
" |
|
1811 |
anyChanges ifTrue:[ |
|
1812 |
self raiseDeiconified. |
|
1813 |
||
1814 |
box := YesNoBox new. |
|
1815 |
box title:('The modified changelist has not been written back to the change file.\\Write change file before exiting ?') withCRs. |
|
1816 |
box okText:(resources string:'Write') noText:(resources string:'Don''t write'). |
|
1817 |
box yesAction:[self writeBackChanges] |
|
1818 |
noAction:[]. |
|
1819 |
box showAtPointer. |
|
1820 |
box destroy |
|
1821 |
]. |
|
1822 |
^ self |
|
202 | 1823 |
]. |
11048 | 1824 |
|
8558
a85166102cb7
Wait for #aboutToQuit change message instead of obsolete #aboutToExit
Stefan Vogel <sv@exept.de>
parents:
8515
diff
changeset
|
1825 |
super update:what with:aParameter from:changedObject |
627 | 1826 |
|
11048 | 1827 |
"Created: / 15-06-1996 / 15:26:30 / cg" |
1828 |
"Modified: / 24-08-1999 / 09:45:06 / stefan" |
|
1829 |
"Modified: / 03-01-2012 / 15:23:13 / cg" |
|
202 | 1830 |
! ! |
1831 |
||
3202 | 1832 |
!ChangesBrowser methodsFor:'menu actions'! |
1833 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1834 |
doApply |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1835 |
"user wants a change to be applied" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1836 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1837 |
self withSelectedChangesDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1838 |
(self applyChange:changeNr) ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1839 |
^ self "/ cancel |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1840 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1841 |
self autoSelect:(changeNr + 1) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1842 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1843 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1844 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1845 |
doApplyAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1846 |
"user wants all changes to be applied" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1847 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1848 |
self withExecuteCursorDo:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1849 |
|lastNr "{ Class: SmallInteger }" | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1850 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1851 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1852 |
lastNr := self numberOfChanges. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1853 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1854 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1855 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1856 |
multipleApply := lastNr > 1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1857 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1858 |
1 to:lastNr do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1859 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1860 |
self applyChange:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1861 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1862 |
self autoSelectLast |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1863 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1864 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1865 |
"Modified: 21.1.1997 / 22:26:30 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1866 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1867 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1868 |
doApplyClassFromBeginning |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1869 |
"user wants all changes for this class from 1 to changeNr to be applied" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1870 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1871 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1872 |
|thisClassName classNameToApply lastChange |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1873 |
lastNr "{ Class: SmallInteger }" | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1874 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1875 |
classNameToApply := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1876 |
classNameToApply notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1877 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1878 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1879 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1880 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1881 |
multipleApply := changeNr ~= 1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1882 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1883 |
1 to:changeNr do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1884 |
thisClassName := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1885 |
thisClassName = classNameToApply ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1886 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1887 |
self applyChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1888 |
lastChange := changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1889 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1890 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1891 |
self autoSelect:changeNr+1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1892 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1893 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1894 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1895 |
"Modified: 21.1.1997 / 22:26:04 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1896 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1897 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1898 |
doApplyClassRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1899 |
"user wants all changes for this class from changeNr to be applied" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1900 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1901 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1902 |
|thisClassName classNameToApply lastChange |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1903 |
lastNr "{ Class: SmallInteger }" | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1904 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1905 |
classNameToApply := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1906 |
classNameToApply notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1907 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1908 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1909 |
lastNr := self numberOfChanges. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1910 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1911 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1912 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1913 |
multipleApply := (lastNr - changeNr) > 1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1914 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1915 |
changeNr to:lastNr do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1916 |
thisClassName := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1917 |
thisClassName = classNameToApply ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1918 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1919 |
self applyChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1920 |
lastChange := changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1921 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1922 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1923 |
self autoSelect:lastChange. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1924 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1925 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1926 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1927 |
"Modified: 21.1.1997 / 22:26:04 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1928 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1929 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1930 |
doApplyFromBeginning |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1931 |
"user wants all changes from 1 to changeNr to be applied" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1932 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1933 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1934 |
|lastNr "{ Class: SmallInteger }" | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1935 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1936 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1937 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1938 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1939 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1940 |
multipleApply := changeNr ~= 1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1941 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1942 |
1 to:changeNr do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1943 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1944 |
self applyChange:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1945 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1946 |
self autoSelect:changeNr+1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1947 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1948 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1949 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1950 |
doApplyRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1951 |
"apply all changes from changeNr to the end" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1952 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1953 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1954 |
|lastNr "{ Class: SmallInteger }" | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1955 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1956 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1957 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1958 |
lastNr := self numberOfChanges. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1959 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1960 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1961 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1962 |
multipleApply := (lastNr - changeNr) > 1. |
15087 | 1963 |
AbortAllOperationRequest handle:[:ex | |
1964 |
ex return |
|
1965 |
] do:[ |
|
1966 |
changeNr to:lastNr do:[:changeNr | |
|
1967 |
changeListView setSelection:changeNr. |
|
1968 |
self applyChange:changeNr |
|
1969 |
]. |
|
1970 |
self autoSelect:self numberOfChanges. |
|
1971 |
] |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1972 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1973 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1974 |
"Modified: 21.1.1997 / 22:25:29 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1975 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1976 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1977 |
doApplyToConflictOrEnd |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1978 |
"apply all changes from changeNr to either a conflict (i.e. method exists) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1979 |
or the end." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1980 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1981 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1982 |
|lastNr "{ Class: SmallInteger }"| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1983 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1984 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1985 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1986 |
lastNr := self numberOfChanges. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1987 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1988 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1989 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1990 |
multipleApply := (lastNr - changeNr) > 1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1991 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1992 |
changeNr to:lastNr do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1993 |
| cls sel | |
18059 | 1994 |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1995 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1996 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1997 |
((cls := self classOfChange:changeNr ifAbsent:[:className| nil]) notNil |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1998 |
and:[(sel := self selectorOfMethodChange:changeNr) notNil]) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1999 |
ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2000 |
(cls includesSelector:sel) ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2001 |
self autoSelect:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2002 |
^ self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2003 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2004 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2005 |
self applyChange:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2006 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2007 |
self autoSelect:self numberOfChanges. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2008 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2009 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2010 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2011 |
doBrowse |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2012 |
"user wants a browser on the class of a change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2013 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2014 |
self withSingleSelectedChangeDo:[:changeNr | |
17666 | 2015 |
|cls| |
2016 |
||
2017 |
cls := self classOfChange:changeNr. |
|
2018 |
cls notNil ifTrue:[ |
|
2019 |
SystemBrowser default |
|
2020 |
openInClass:cls |
|
2021 |
selector:(self selectorOfMethodChange:changeNr) |
|
2022 |
] |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2023 |
] |
17666 | 2024 |
|
2025 |
"Modified: / 01-09-2017 / 14:20:00 / cg" |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2026 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2027 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2028 |
doBrowseImplementors |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2029 |
"open an implementors-browser" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2030 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2031 |
|changeNr initial selector| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2032 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2033 |
(changeNr := self theSingleSelection) notNil ifTrue:[ |
17666 | 2034 |
initial := self selectorOfMethodChange:changeNr. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2035 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2036 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2037 |
selector := Dialog |
17666 | 2038 |
request:'Selector to browse implementors of:' |
2039 |
initialAnswer:(initial ? ''). |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2040 |
selector size ~~ 0 ifTrue:[ |
17666 | 2041 |
SystemBrowser default browseImplementorsMatching:selector. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2042 |
] |
17666 | 2043 |
|
2044 |
"Modified (format): / 01-09-2017 / 14:20:06 / cg" |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2045 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2046 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2047 |
doBrowseSenders |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2048 |
"user wants a browser on the class of a change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2049 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2050 |
|changeNr initial selector| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2051 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2052 |
(changeNr := self theSingleSelection) notNil ifTrue:[ |
17666 | 2053 |
initial := self selectorOfMethodChange:changeNr. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2054 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2055 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2056 |
selector := Dialog |
17666 | 2057 |
request:'Selector to browse senders of:' |
2058 |
initialAnswer:(initial ? ''). |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2059 |
selector size ~~ 0 ifTrue:[ |
17666 | 2060 |
SystemBrowser default browseAllCallsOn:selector asSymbol. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2061 |
] |
17666 | 2062 |
|
2063 |
"Modified: / 01-09-2017 / 14:20:13 / cg" |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2064 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2065 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2066 |
doCheckinAndDeleteClassAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2067 |
"first checkin the selected changes class then delete all changes |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2068 |
for it." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2069 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2070 |
|classes answer logTitle checkinInfo| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2071 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2072 |
"/ self theSingleSelection isNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2073 |
"/ ^ self information:'Only possible if a single change is selected.'. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2074 |
"/ ]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2075 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2076 |
self withExecuteCursorDo:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2077 |
classes := IdentitySet new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2078 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2079 |
self withSelectedChangesDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2080 |
| className class | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2081 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2082 |
className := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2083 |
className notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2084 |
class := Smalltalk classNamed:className. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2085 |
class isNil ifTrue:[ |
18152 | 2086 |
self proceedableError:'oops - no class: ', className. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2087 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2088 |
class notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2089 |
class := class theNonMetaclass. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2090 |
(classes includes:class) ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2091 |
class isPrivate ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2092 |
(classes includes:class owningClass) ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2093 |
answer := self confirmWithCancel:('This is a private class.\\CheckIn the owner ''%1'' and all of its private classes ?' |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2094 |
bindWith:class owningClass name allBold) withCRs. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2095 |
answer isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2096 |
answer ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2097 |
classes add:class owningClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2098 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2099 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2100 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2101 |
classes add:class |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2102 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2103 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2104 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2105 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2106 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2107 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2108 |
classes size == 1 ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2109 |
logTitle := classes first name. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2110 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2111 |
logTitle := '%1 classes' bindWith:classes size. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2112 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2113 |
checkinInfo := SourceCodeManagerUtilities default |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2114 |
getCheckinInfoFor:logTitle |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2115 |
initialAnswer:nil. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2116 |
checkinInfo isNil ifTrue:[^ self ]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2117 |
|
18059 | 2118 |
self unselect. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2119 |
classes do:[:eachClass | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2120 |
(SourceCodeManagerUtilities default checkinClass:eachClass withInfo:checkinInfo) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2121 |
ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2122 |
self silentDeleteChangesForClassAndPrivateClasses:eachClass name |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2123 |
from:1 to:(self numberOfChanges). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2124 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2125 |
]. |
18059 | 2126 |
self updateChangeList. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2127 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2128 |
|
18152 | 2129 |
"Modified: / 06-09-1995 / 17:11:16 / claus" |
2130 |
"Modified: / 17-11-2001 / 14:21:13 / cg" |
|
2131 |
"Modified: / 24-05-2018 / 14:55:14 / Claus Gittinger" |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2132 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2133 |
|
18059 | 2134 |
doCleanup |
2135 |
"cleanup the changefile/changeset. |
|
2136 |
actions done: |
|
2137 |
- from the end, find changes which are equal to the current version |
|
18061 | 2138 |
and not in the current changeset (i.e. represents the current version as built from CVS). |
18059 | 2139 |
Then delete it incl. previous versions of it." |
2140 |
||
2141 |
|numChanges nextChangeNr changeNr changeSelector changeClass numDeleted| |
|
2142 |
||
2143 |
numChanges := self numberOfChanges. |
|
2144 |
self unselect. |
|
2145 |
||
2146 |
self withWaitCursorDo:[ |
|
2147 |
"/ find the last method change which is equal |
|
2148 |
changeNr := numChanges. |
|
2149 |
[changeNr > 0] whileTrue:[ |
|
2150 |
nextChangeNr := changeNr - 1. |
|
2151 |
||
2152 |
(changeClass := self classOfChange:changeNr ifAbsent:nil) notNil ifTrue:[ |
|
2153 |
||
2154 |
(changeInfoList at:changeNr) isMethodCategoryChange ifTrue:[ |
|
2155 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
|
2156 |
(changeSelector := self selectorOfMethodCategoryChange:changeNr) notNil ifTrue:[ |
|
2157 |
(ChangeSet current includesChangeForClass:changeClass selector:changeSelector) ifFalse:[ |
|
2158 |
infoHolder value:('Deleting category changes for %1 >> %2' bindWith:changeClass name with:changeSelector). |
|
2159 |
self windowGroup repairDamage. |
|
2160 |
numDeleted := self |
|
2161 |
silentDeleteMethodCategoryChangesFor:changeClass name selector:changeSelector |
|
2162 |
from:1 to:changeNr. |
|
2163 |
"/ self selectChange:changeNr. |
|
2164 |
"/ self doDeleteClassSelectorOlder. |
|
2165 |
nextChangeNr := (changeNr - numDeleted + 1) min:self numberOfChanges. |
|
2166 |
]. |
|
2167 |
]. |
|
2168 |
]. |
|
2169 |
] ifFalse:[ |
|
2170 |
(changeSelector := self selectorOfMethodChange:changeNr) notNil ifTrue:[ |
|
2171 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
|
2172 |
"/ found a method change, which is the same as the current version |
|
2173 |
"/ if in the current changeSet, then do not delete (needs checkin first) |
|
2174 |
(ChangeSet current includesChangeForClass:changeClass selector:changeSelector) ifFalse:[ |
|
2175 |
infoHolder value:('Deleting changes for %1 >> %2' bindWith:changeClass name with:changeSelector). |
|
2176 |
self windowGroup repairDamage. |
|
2177 |
numDeleted := self |
|
2178 |
silentDeleteChangesFor:changeClass name selector:changeSelector |
|
2179 |
from:1 to:changeNr. |
|
2180 |
"/ self selectChange:changeNr. |
|
2181 |
"/ self doDeleteClassSelectorOlder. |
|
2182 |
nextChangeNr := (changeNr - numDeleted + 1) min:self numberOfChanges. |
|
2183 |
]. |
|
2184 |
]. |
|
2185 |
]. |
|
2186 |
]. |
|
2187 |
]. |
|
2188 |
changeNr := nextChangeNr. |
|
2189 |
]. |
|
2190 |
]. |
|
2191 |
self updateChangeList. |
|
2192 |
! |
|
2193 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2194 |
doCompare |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2195 |
"compare change with current system version" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2196 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2197 |
classesNotToBeAutoloaded removeAll. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2198 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2199 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2200 |
self withExecuteCursorDo:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2201 |
self compareChange:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2202 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2203 |
self newLabel:'' |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2204 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2205 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2206 |
"Modified: 24.2.1996 / 19:37:19 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2207 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2208 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2209 |
doCompareAndCompress |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2210 |
"remove all changes, which are equivalent to the current image version" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2211 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2212 |
|toDelete| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2213 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2214 |
classesNotToBeAutoloaded removeAll. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2215 |
toDelete := OrderedCollection new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2216 |
self withExecuteCursorDo:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2217 |
1 to:self numberOfChanges do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2218 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2219 |
toDelete add:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2220 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2221 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2222 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2223 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2224 |
toDelete reverseDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2225 |
self silentDeleteChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2226 |
]. |
18059 | 2227 |
self updateChangeList. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2228 |
" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2229 |
scroll back a bit, if we are left way behind the list |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2230 |
" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2231 |
changeListView firstLineShown > self numberOfChanges ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2232 |
changeListView makeLineVisible:self numberOfChanges |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2233 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2234 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2235 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2236 |
self newLabel:''. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2237 |
classesNotToBeAutoloaded removeAll. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2238 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2239 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2240 |
doCompress |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2241 |
"compress the change-set; this replaces multiple method-changes by the last |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2242 |
(i.e. the most recent) change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2243 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2244 |
self compressForClass:nil |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2245 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2246 |
"Modified: / 29.10.1997 / 01:03:26 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2247 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2248 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2249 |
doCompressClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2250 |
"compress changes for the selected class. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2251 |
this replaces multiple method-changes by the last (i.e. the most recent) change." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2252 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2253 |
self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2254 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2255 |
self selectedClassNames do:[:classNameToCompress | |
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2256 |
self compressForClass:classNameToCompress. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2257 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2258 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2259 |
"Created: / 29.10.1997 / 01:05:16 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2260 |
"Modified: / 19.11.2001 / 21:55:17 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2261 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2262 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2263 |
doCompressSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2264 |
"compress changes for the selected class & selector. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2265 |
this replaces multiple method-changes by the last (i.e. the most recent) change." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2266 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2267 |
|classSelectorPairs| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2268 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2269 |
self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2270 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2271 |
classSelectorPairs := Set new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2272 |
self withSelectedChangesDo:[:changeNr | |
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2273 |
| classNameToCompress selector | |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2274 |
|
17600 | 2275 |
classNameToCompress := self realClassNameOfChange:changeNr. |
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2276 |
classNameToCompress notNil ifTrue:[ |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2277 |
selector := self selectorOfMethodChange:changeNr. |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2278 |
selector notNil ifTrue:[ |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2279 |
classSelectorPairs add:(classNameToCompress -> selector). |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2280 |
] |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2281 |
] |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2282 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2283 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2284 |
classSelectorPairs do:[:pair | |
17600 | 2285 |
self compressForClass:(pair key) selector:(pair value). |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2286 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2287 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2288 |
"Created: / 19.11.2001 / 21:50:59 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2289 |
"Modified: / 19.11.2001 / 22:10:08 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2290 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2291 |
|
17096 | 2292 |
doCopyToClipboard |
2293 |
"user wants a change text to be copied to the clipboard" |
|
2294 |
||
2295 |
|text| |
|
2296 |
||
2297 |
self withSingleSelectedChangeDo:[:changeNr | |
|
2298 |
text := self sourceOfMethodChange:changeNr. |
|
2299 |
]. |
|
2300 |
text notEmptyOrNil ifTrue:[ |
|
2301 |
self window setClipboardText:text |
|
2302 |
] |
|
2303 |
||
2304 |
"Created: / 21-11-2016 / 23:38:11 / cg" |
|
2305 |
! |
|
2306 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2307 |
doDelete |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2308 |
"delete currently selected change(s)" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2309 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2310 |
|rangeEnd rangeStart firstDeleted| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2311 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2312 |
changeListView selection size <= 5 ifTrue:[ |
16467 | 2313 |
self withSelectedChangesReverseDo:[:changeNr | |
2314 |
self deleteChange:changeNr. |
|
2315 |
self autoSelectOrEnd:changeNr |
|
2316 |
]. |
|
2317 |
self showNumberOfChanges. |
|
2318 |
^ self |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2319 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2320 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2321 |
self withSelectedChangesReverseDo:[:changeNr | |
16467 | 2322 |
rangeEnd isNil ifTrue:[ |
2323 |
rangeEnd := rangeStart := changeNr |
|
2324 |
] ifFalse:[ |
|
2325 |
(changeNr = (rangeEnd + 1)) ifTrue:[ |
|
2326 |
rangeEnd := changeNr |
|
2327 |
] ifFalse:[ |
|
2328 |
(changeNr = (rangeStart - 1)) ifTrue:[ |
|
2329 |
rangeStart := changeNr |
|
2330 |
] ifFalse:[ |
|
2331 |
self deleteChangesFrom:rangeStart to:rangeEnd. |
|
2332 |
firstDeleted := (firstDeleted ? rangeStart) min:rangeStart. |
|
2333 |
rangeStart := rangeEnd := nil. |
|
2334 |
]. |
|
2335 |
]. |
|
2336 |
]. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2337 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2338 |
rangeStart notNil ifTrue:[ |
16467 | 2339 |
self deleteChangesFrom:rangeStart to:rangeEnd. |
2340 |
firstDeleted := (firstDeleted ? rangeStart) min:rangeStart. |
|
2341 |
]. |
|
2342 |
self autoSelectOrEnd:firstDeleted. |
|
2343 |
self showNumberOfChanges |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2344 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2345 |
|
12428 | 2346 |
doDeleteAllForNamespace |
2347 |
"delete all changes for classes with same namespace as currently selected change" |
|
2348 |
||
2349 |
|namespacesToDelete lastChangeNr overAllNumDeletedBefore| |
|
2350 |
||
2351 |
lastChangeNr := -1. |
|
2352 |
namespacesToDelete := Set new. |
|
2353 |
self withSelectedChangesDo:[:changeNr | |
|
2354 |
|namespaceToDelete| |
|
2355 |
||
2356 |
namespaceToDelete := self namespaceOfChange:changeNr. |
|
2357 |
namespaceToDelete notNil ifTrue:[ |
|
2358 |
namespacesToDelete add:namespaceToDelete |
|
2359 |
]. |
|
2360 |
lastChangeNr := lastChangeNr max:changeNr. |
|
2361 |
]. |
|
2362 |
namespacesToDelete isEmpty ifTrue:[^ self]. |
|
2363 |
||
2364 |
overAllNumDeletedBefore := 0. |
|
18059 | 2365 |
self unselect. |
12428 | 2366 |
|
2367 |
self withExecuteCursorDo:[ |
|
2368 |
namespacesToDelete do:[:namespaceToDelete | |
|
2369 |
|numDeletedBefore| |
|
2370 |
||
2371 |
self |
|
2372 |
silentDeleteChangesForNamespace:namespaceToDelete |
|
2373 |
from:lastChangeNr |
|
2374 |
to:(self numberOfChanges). |
|
2375 |
numDeletedBefore := self |
|
2376 |
silentDeleteChangesForNamespace:namespaceToDelete |
|
2377 |
from:1 |
|
2378 |
to:(lastChangeNr-1). |
|
2379 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
2380 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
2381 |
]. |
|
2382 |
]. |
|
2383 |
||
18059 | 2384 |
self updateChangeList. |
16467 | 2385 |
self autoSelectOrEnd:lastChangeNr. |
12428 | 2386 |
! |
2387 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2388 |
doDeleteAndSelectPrevious |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2389 |
"delete currently selected change(s)" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2390 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2391 |
self withSelectedChangesReverseDo:[:changeNr | |
16467 | 2392 |
self deleteChange:changeNr. |
2393 |
self autoSelectOrEnd:changeNr-1 |
|
2394 |
]. |
|
2395 |
||
2396 |
"/mh - don't we need a |
|
2397 |
"/ self setChangeList |
|
2398 |
"/ here? |
|
2399 |
self showNumberOfChanges |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2400 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2401 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2402 |
doDeleteClassAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2403 |
"delete all changes with same class as currently selected change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2404 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2405 |
|classNamesToDelete lastChangeNr overAllNumDeletedBefore| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2406 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2407 |
lastChangeNr := -1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2408 |
classNamesToDelete := Set new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2409 |
self withSelectedChangesDo:[:changeNr | |
16467 | 2410 |
|classNameToDelete| |
2411 |
||
2412 |
classNameToDelete := self classNameOfChange:changeNr. |
|
2413 |
classNameToDelete notNil ifTrue:[ |
|
2414 |
classNamesToDelete add:classNameToDelete. |
|
2415 |
]. |
|
2416 |
lastChangeNr := lastChangeNr max:changeNr. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2417 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2418 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2419 |
overAllNumDeletedBefore := 0. |
18059 | 2420 |
self unselect. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2421 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2422 |
self withExecuteCursorDo:[ |
16467 | 2423 |
classNamesToDelete do:[:classNameToDelete | |
2424 |
|numDeletedBefore| |
|
2425 |
||
2426 |
self silentDeleteChangesFor:classNameToDelete |
|
2427 |
from:lastChangeNr |
|
2428 |
to:(self numberOfChanges). |
|
2429 |
numDeletedBefore := self |
|
2430 |
silentDeleteChangesFor:classNameToDelete |
|
2431 |
from:1 |
|
2432 |
to:(lastChangeNr-1). |
|
2433 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
2434 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
2435 |
]. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2436 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2437 |
|
18059 | 2438 |
self updateChangeList. |
16467 | 2439 |
self autoSelectOrEnd:lastChangeNr. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2440 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2441 |
"Created: / 13.12.1995 / 16:07:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2442 |
"Modified: / 28.1.1998 / 20:42:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2443 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2444 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2445 |
doDeleteClassAndPrivateClassesAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2446 |
"delete all changes with same class and private classes |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2447 |
as currently selected change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2448 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2449 |
|lastChangeNr classNamesToDelete overAllNumDeletedBefore| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2450 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2451 |
lastChangeNr := -1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2452 |
classNamesToDelete := Set new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2453 |
self withSelectedChangesDo:[:changeNr | |
16467 | 2454 |
|classNameToDelete| |
2455 |
||
2456 |
classNameToDelete := self ownerClassNameOfChange:changeNr. |
|
2457 |
classNameToDelete notNil ifTrue:[ |
|
2458 |
classNamesToDelete add:classNameToDelete. |
|
2459 |
]. |
|
2460 |
lastChangeNr := lastChangeNr max:changeNr. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2461 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2462 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2463 |
overAllNumDeletedBefore := 0. |
18059 | 2464 |
self unselect. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2465 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2466 |
self withExecuteCursorDo:[ |
16467 | 2467 |
classNamesToDelete do:[:classNameToDelete | |
2468 |
| changeNr numDeletedBefore| |
|
2469 |
||
2470 |
classNameToDelete notNil ifTrue:[ |
|
2471 |
changeListView setSelection:nil. |
|
2472 |
self silentDeleteChangesForClassAndPrivateClasses:classNameToDelete |
|
2473 |
from:lastChangeNr |
|
2474 |
to:(self numberOfChanges). |
|
2475 |
numDeletedBefore := self |
|
2476 |
silentDeleteChangesForClassAndPrivateClasses:classNameToDelete |
|
2477 |
from:1 |
|
2478 |
to:(lastChangeNr-1). |
|
2479 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
2480 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
2481 |
] |
|
2482 |
] |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2483 |
]. |
18059 | 2484 |
self updateChangeList. |
16467 | 2485 |
self autoSelectOrEnd:lastChangeNr. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2486 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2487 |
"Created: / 13.12.1995 / 16:07:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2488 |
"Modified: / 28.1.1998 / 20:42:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2489 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2490 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2491 |
doDeleteClassFromBeginning |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2492 |
"delete changes with same class as currently selected change from the beginning |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2493 |
up to the selected change. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2494 |
Useful to get rid of obsolete changes before a fileout or checkin entry." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2495 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2496 |
self withSingleSelectedChangeDo:[:changeNr | |
18059 | 2497 |
|classNameToDelete prevSelection numDeleted| |
2498 |
||
2499 |
classNameToDelete := self classNameOfChange:changeNr. |
|
2500 |
classNameToDelete notNil ifTrue:[ |
|
2501 |
prevSelection := changeNr. |
|
2502 |
self unselect. |
|
2503 |
numDeleted := self |
|
2504 |
silentDeleteChangesFor:classNameToDelete |
|
2505 |
from:1 |
|
2506 |
to:changeNr. |
|
2507 |
self updateChangeList. |
|
2508 |
self autoSelectOrEnd:(changeNr + 1 - numDeleted) |
|
2509 |
] |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2510 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2511 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2512 |
"Created: 13.12.1995 / 15:41:58 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2513 |
"Modified: 25.5.1996 / 12:26:34 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2514 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2515 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2516 |
doDeleteClassRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2517 |
"delete rest of changes with same class as currently selected change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2518 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2519 |
self withSingleSelectedChangeDo:[:changeNr | |
18059 | 2520 |
| classNameToDelete | |
2521 |
||
2522 |
classNameToDelete := self classNameOfChange:changeNr. |
|
2523 |
classNameToDelete notNil ifTrue:[ |
|
2524 |
self unselect. |
|
2525 |
self silentDeleteChangesFor:classNameToDelete |
|
2526 |
from:changeNr |
|
2527 |
to:(self numberOfChanges). |
|
2528 |
self updateChangeList. |
|
2529 |
self autoSelectOrEnd:changeNr |
|
2530 |
] |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2531 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2532 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2533 |
"Modified: / 18.5.1998 / 14:25:07 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2534 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2535 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2536 |
doDeleteClassSelectorAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2537 |
"delete all changes with same class and selector as currently selected change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2538 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2539 |
|classNameSelectorPairsToDelete lastChangeNr overAllNumDeletedBefore| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2540 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2541 |
lastChangeNr := -1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2542 |
classNameSelectorPairsToDelete := Set new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2543 |
self withSelectedChangesDo:[:changeNr | |
17600 | 2544 |
|className selector| |
2545 |
||
2546 |
className := self realClassNameOfChange:changeNr. |
|
2547 |
selector := self selectorOfMethodChange:changeNr. |
|
2548 |
selector notNil ifTrue:[ |
|
2549 |
(className notNil and:[selector notNil]) ifTrue:[ |
|
2550 |
classNameSelectorPairsToDelete add:(className -> selector). |
|
2551 |
] |
|
2552 |
]. |
|
2553 |
lastChangeNr := lastChangeNr max:changeNr. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2554 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2555 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2556 |
overAllNumDeletedBefore := 0. |
18059 | 2557 |
self unselect. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2558 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2559 |
self withExecuteCursorDo:[ |
17600 | 2560 |
classNameSelectorPairsToDelete do:[:pair | |
2561 |
|numDeletedBefore className selector| |
|
2562 |
||
2563 |
className := pair key. |
|
2564 |
selector := pair value. |
|
2565 |
self silentDeleteChangesFor:className selector:selector |
|
2566 |
from:lastChangeNr |
|
2567 |
to:(self numberOfChanges). |
|
2568 |
numDeletedBefore := self |
|
2569 |
silentDeleteChangesFor:className selector:selector |
|
2570 |
from:1 |
|
2571 |
to:(lastChangeNr-1). |
|
2572 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
2573 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
2574 |
]. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2575 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2576 |
|
18059 | 2577 |
self updateChangeList. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2578 |
self autoSelectOrEnd:lastChangeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2579 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2580 |
"Created: / 13.12.1995 / 16:07:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2581 |
"Modified: / 28.1.1998 / 20:42:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2582 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2583 |
|
16475 | 2584 |
doDeleteClassSelectorOlder |
18059 | 2585 |
"delete this and older changes with same class and selector as currently selected change(s)" |
16475 | 2586 |
|
2587 |
|classNameSelectorPairsToDelete upToPerClassAndSelector lastChangeNr overAllNumDeletedBefore| |
|
2588 |
||
2589 |
lastChangeNr := -1. |
|
2590 |
classNameSelectorPairsToDelete := Set new. |
|
2591 |
upToPerClassAndSelector := Dictionary new. |
|
2592 |
||
17597 | 2593 |
"/ collect info on what is to be deleted |
16475 | 2594 |
self withSelectedChangesDo:[:changeNr | |
2595 |
|className selector| |
|
2596 |
||
17600 | 2597 |
className := self realClassNameOfChange:changeNr. |
16475 | 2598 |
selector := self selectorOfMethodChange:changeNr. |
2599 |
selector notNil ifTrue:[ |
|
2600 |
(className notNil and:[selector notNil]) ifTrue:[ |
|
2601 |
classNameSelectorPairsToDelete add:(className -> selector). |
|
2602 |
upToPerClassAndSelector at:(className -> selector) put:changeNr. |
|
2603 |
] |
|
2604 |
]. |
|
2605 |
lastChangeNr := lastChangeNr max:changeNr. |
|
2606 |
]. |
|
2607 |
||
2608 |
overAllNumDeletedBefore := 0. |
|
18059 | 2609 |
self unselect. |
16475 | 2610 |
|
2611 |
self withExecuteCursorDo:[ |
|
2612 |
classNameSelectorPairsToDelete do:[:pair | |
|
2613 |
|numDeletedBefore className selector lastToDelete| |
|
2614 |
||
2615 |
className := pair key. |
|
2616 |
selector := pair value. |
|
17597 | 2617 |
lastToDelete := (upToPerClassAndSelector at:pair). |
16475 | 2618 |
|
2619 |
numDeletedBefore := self |
|
2620 |
silentDeleteChangesFor:className selector:selector |
|
2621 |
from:1 |
|
2622 |
to:lastToDelete. |
|
2623 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
2624 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
2625 |
]. |
|
2626 |
]. |
|
2627 |
||
18059 | 2628 |
self updateChangeList. |
16475 | 2629 |
self autoSelectOrEnd:lastChangeNr |
17597 | 2630 |
|
2631 |
"Modified: / 25-07-2017 / 10:57:31 / cg" |
|
16475 | 2632 |
! |
2633 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2634 |
doDeleteFromBeginning |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2635 |
"delete all changes from 1 to the current" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2636 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2637 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2638 |
self deleteChangesFrom:1 to:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2639 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2640 |
self autoSelectOrEnd:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2641 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2642 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2643 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2644 |
doDeleteRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2645 |
"delete all changes from current to the end" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2646 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2647 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2648 |
self deleteChangesFrom:changeNr to:(self numberOfChanges). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2649 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2650 |
self autoSelectOrEnd:changeNr-1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2651 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2652 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2653 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2654 |
doFileoutAndDeleteClassAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2655 |
"first fileOut the selected changes class then delete all changes |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2656 |
for it." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2657 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2658 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2659 |
| className class | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2660 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2661 |
className := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2662 |
className notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2663 |
class := Smalltalk classNamed:className. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2664 |
class notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2665 |
Class fileOutErrorSignal handle:[:ex | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2666 |
self warn:('fileout failed: ' , ex description). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2667 |
] do:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2668 |
class fileOut. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2669 |
self doDeleteClassAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2670 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2671 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2672 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2673 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2674 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2675 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2676 |
"Modified: 6.9.1995 / 17:11:16 / claus" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2677 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2678 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2679 |
doMakePatch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2680 |
"user wants a change to be made a patch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2681 |
- copy it over to the patches file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2682 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2683 |
self withSelectedChangesDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2684 |
self makeChangeAPatch:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2685 |
self autoSelect:(changeNr + 1) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2686 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2687 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2688 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2689 |
doMakePermanent |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2690 |
"user wants a change to be made permanent |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2691 |
- rewrite the source file where this change has to go" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2692 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2693 |
|yesNoBox| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2694 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2695 |
self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2696 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2697 |
yesNoBox := YesNoBox new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2698 |
yesNoBox title:(resources string:'Warning: this operation cannot be undone'). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2699 |
yesNoBox okText:(resources string:'continue') noText:(resources string:'abort'). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2700 |
yesNoBox okAction:[ |changeNr| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2701 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2702 |
changeNr := self theSingleSelection. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2703 |
changeNr notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2704 |
self makeChangePermanent:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2705 |
self autoSelect:(changeNr + 1) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2706 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2707 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2708 |
yesNoBox showAtPointer. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2709 |
yesNoBox destroy |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2710 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2711 |
"Modified: 7.1.1997 / 23:03:33 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2712 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2713 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2714 |
doSave |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2715 |
"user wants a change to be appended to a file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2716 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2717 |
|fileName| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2718 |
|
13651 | 2719 |
fileName := Dialog |
2720 |
requestFileNameForSave:(resources string:'Append change to:') |
|
2721 |
default:(lastSaveFileName ? '') |
|
2722 |
ok:(resources string:'Append') |
|
2723 |
abort:(resources string:'Abort') |
|
2724 |
pattern:'*.chg'. |
|
2725 |
fileName isEmptyOrNil ifTrue:[ |
|
2726 |
^ self |
|
2727 |
]. |
|
2728 |
lastSaveFileName := fileName. |
|
2729 |
||
2730 |
self withWriteCursorDo:[ |
|
2731 |
self withSelectedChangesDo:[:changeNr | |
|
2732 |
self appendChange:changeNr toFile:fileName. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2733 |
self autoSelect:(changeNr + 1) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2734 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2735 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2736 |
|
11685 | 2737 |
"Modified: / 27-07-2012 / 09:46:14 / cg" |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2738 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2739 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2740 |
doSaveClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2741 |
"user wants changes for some class from current to end to be appended to a file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2742 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2743 |
self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2744 |
self doSaveClassFrom:1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2745 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2746 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2747 |
doSaveClassAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2748 |
"user wants changes for some class from current to end to be appended to a file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2749 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2750 |
self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2751 |
self doSaveClassFrom:1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2752 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2753 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2754 |
doSaveClassFrom:startNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2755 |
"user wants changes from current to end to be appended to a file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2756 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2757 |
|changeNr classNameToSave| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2758 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2759 |
changeNr := self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2760 |
classNameToSave := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2761 |
classNameToSave notNil ifTrue:[ |
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2762 |
self saveClass:classNameToSave from:startNr |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2763 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2764 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2765 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2766 |
doSaveClassRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2767 |
"user wants changes for some class from current to end to be appended to a file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2768 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2769 |
|changeNr| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2770 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2771 |
changeNr := self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2772 |
self doSaveClassFrom:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2773 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2774 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2775 |
"/ self changeSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2776 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2777 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2778 |
doSaveRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2779 |
"user wants changes from current to end to be appended to a file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2780 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2781 |
|changeNr fileName| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2782 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2783 |
(changeNr := self theSingleSelection) isNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2784 |
^ self information:(resources string:'Only possible if a single change is selected.'). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2785 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2786 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2787 |
fileName := Dialog |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2788 |
requestFileNameForSave:(resources string:'Append changes to:') |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2789 |
default:(lastSaveFileName ? '') |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2790 |
ok:(resources string:'Append') |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2791 |
abort:(resources string:'Abort') |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2792 |
pattern:'*.chg'. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2793 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2794 |
fileName notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2795 |
lastSaveFileName := fileName. |
11685 | 2796 |
self withWriteCursorDo:[ |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2797 |
changeNr to:(self numberOfChanges) do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2798 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2799 |
(self appendChange:changeNr toFile:fileName) ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2800 |
^ self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2801 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2802 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2803 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2804 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2805 |
|
11685 | 2806 |
"Modified: / 27-07-2012 / 09:46:09 / cg" |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2807 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2808 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2809 |
doUpdate |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2810 |
"reread the changes-file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2811 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2812 |
self readChangesFileInBackground:true. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2813 |
self newLabel:''. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2814 |
realized ifTrue:[ |
18059 | 2815 |
self updateChangeList. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2816 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2817 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2818 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2819 |
doWriteBack |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2820 |
"write back the list onto the changes file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2821 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2822 |
anyChanges ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2823 |
(self writeBackChanges) ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2824 |
realized ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2825 |
self readChangesFile. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2826 |
realized ifTrue:[ |
18059 | 2827 |
self updateChangeList |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2828 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2829 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2830 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2831 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2832 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2833 |
"Modified: 5.9.1996 / 17:19:46 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2834 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2835 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2836 |
findClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2837 |
"findClass menu action: let user enter a classes name, and select the next change for that class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2838 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2839 |
|current| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2840 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2841 |
changeNrShown notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2842 |
current := self classNameOfChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2843 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2844 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2845 |
self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2846 |
askForSearch:'Class to search for:' |
17394 | 2847 |
initialAnswer:(current ? lastSearchString) |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2848 |
thenSearchUsing:[:searchString :changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2849 |
|thisClassName| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2850 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2851 |
thisClassName := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2852 |
thisClassName notNil |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2853 |
and:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2854 |
(thisClassName sameAs: searchString) |
13440 | 2855 |
or:[searchString includesMatchCharacters and:[searchString match:thisClassName caseSensitive:false]]] |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2856 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2857 |
onCancel:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2858 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2859 |
lastSearchType := #class. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2860 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
17382 | 2861 |
|
17394 | 2862 |
"Modified: / 12-02-2017 / 11:31:47 / cg" |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2863 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2864 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2865 |
findFirstForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2866 |
"findNextForClass menu action: select the next change for the selected changes class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2867 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2868 |
self findNextForClassStartingAt:1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2869 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2870 |
"Created: / 20-11-2006 / 16:37:56 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2871 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2872 |
|
15674 | 2873 |
findFirstForClass:className |
2874 |
"findNextForClass menu action: select the next change for the selected changes class" |
|
2875 |
||
2876 |
self findNextForClass:className startingAt:1 |
|
2877 |
! |
|
2878 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2879 |
findLastForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2880 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2881 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2882 |
self findPreviousForClassStartingAt:(self numberOfChanges) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2883 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2884 |
"Created: / 20-11-2006 / 16:39:15 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2885 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2886 |
|
15674 | 2887 |
findLastForClass:className |
2888 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
|
2889 |
||
2890 |
self findPreviousForClass:className startingAt:(self numberOfChanges) |
|
2891 |
||
2892 |
"Created: / 20-11-2006 / 16:39:15 / cg" |
|
2893 |
! |
|
2894 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2895 |
findLastSnapshot |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2896 |
"findLastSnapshot menu action: select the last change which is for a snapShot-image save action" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2897 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2898 |
"/ lastSearchType := #snapshot. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2899 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2900 |
self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2901 |
findPreviousForWhich: [:changeNr | self changeIsSnapShotInfo:changeNr ] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2902 |
startingAt:(self numberOfChanges) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2903 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2904 |
"Created: / 06-10-2006 / 11:03:39 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2905 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2906 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2907 |
findNext |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2908 |
"findNext menu action: select the next change. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2909 |
Searches for what the last search was for; i.e. either same class or same selector" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2910 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2911 |
lastSearchType == #selector ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2912 |
^ self findNextForSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2913 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2914 |
lastSearchType == #snapshot ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2915 |
^ self findNextSnapshot |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2916 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2917 |
lastSearchType == #string ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2918 |
^ self findNextForString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2919 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2920 |
lastSearchType == #difference ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2921 |
^ self findNextDifference |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2922 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2923 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2924 |
^ self findNextForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2925 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2926 |
"Created: / 18.6.1998 / 22:15:00 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2927 |
"Modified: / 18.6.1998 / 22:15:25 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2928 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2929 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2930 |
findNextDifference |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2931 |
lastSearchType := #difference. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2932 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2933 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2934 |
self findNextForWhich:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2935 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2936 |
"/ same |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2937 |
false |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2938 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2939 |
"/ different |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2940 |
true |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2941 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2942 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2943 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2944 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2945 |
findNextForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2946 |
"findNextForClass menu action: select the next change for the selected changes class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2947 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2948 |
self findNextForClassStartingAt: changeNrShown + 1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2949 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2950 |
"Modified: / 20-11-2006 / 16:37:49 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2951 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2952 |
|
15674 | 2953 |
findNextForClass:className startingAt:startNr |
2954 |
"findNextForClass menu action: select the next change for the selected changes class" |
|
2955 |
||
2956 |
lastSearchType := #class. |
|
2957 |
||
2958 |
self |
|
2959 |
findNextForWhich:[:changeNr | |
|
2960 |
|thisClass| |
|
2961 |
||
2962 |
thisClass := self classNameOfChange:changeNr. |
|
2963 |
(thisClass = className |
|
2964 |
or:[className includesMatchCharacters |
|
2965 |
and:[className match:thisClass]])] |
|
2966 |
startingAt:startNr |
|
2967 |
! |
|
2968 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2969 |
findNextForClassStartingAt:startNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2970 |
"findNextForClass menu action: select the next change for the selected changes class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2971 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2972 |
|cls| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2973 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2974 |
lastSearchType := #class. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2975 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2976 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2977 |
cls := self classNameOfChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2978 |
cls isNil ifTrue:[^ self]. |
15674 | 2979 |
self findNextForClass:cls startingAt:startNr. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2980 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2981 |
"Created: / 20-11-2006 / 16:37:37 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2982 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2983 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2984 |
findNextForSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2985 |
"findNextForSelector menu action: select the next change for the selected changes selector" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2986 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2987 |
|sel| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2988 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2989 |
lastSearchType := #selector. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2990 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2991 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2992 |
sel := self selectorOfMethodChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2993 |
sel isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2994 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2995 |
self findNextForWhich: [:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2996 |
|thisSelector| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2997 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2998 |
thisSelector := self selectorOfMethodChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2999 |
(thisSelector = sel or:[sel includesMatchCharacters and:[sel match:thisSelector]]) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3000 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3001 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3002 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3003 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3004 |
findNextForString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3005 |
lastSearchString isNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3006 |
^ self findString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3007 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3008 |
self findNextWithString:lastSearchString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3009 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3010 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3011 |
findNextForWhich:aBlock |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3012 |
"helper: select the next change for which aBlock evaluates to true" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3013 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3014 |
^ self findNextForWhich:aBlock startingAt:changeNrShown + 1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3015 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3016 |
"Modified: / 20-11-2006 / 16:34:23 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3017 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3018 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3019 |
findNextForWhich:aBlock startingAt:changeNrToStartSearch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3020 |
"helper: select the next change for which aBlock evaluates to true" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3021 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3022 |
^ self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3023 |
findNextOrPrevious:#next |
18059 | 3024 |
forWhich:aBlock |
3025 |
startingAt:changeNrToStartSearch |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3026 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3027 |
"Created: / 20-11-2006 / 16:34:06 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3028 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3029 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3030 |
findNextOrPrevious:direction forWhich:aBlock startingAt:changeNrToStartSearch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3031 |
"helper: find and select the next or previous change for which aBlock evaluates to true" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3032 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3033 |
self withCursor:Cursor questionMark do:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3034 |
Object userInterruptSignal handle:[:ex | |
17941 | 3035 |
self beepInEditor. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3036 |
^ 0 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3037 |
] do:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3038 |
|increment nr lastNr| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3039 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3040 |
increment := (direction == #previous) ifTrue:[-1] ifFalse:[1]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3041 |
lastNr := self numberOfChanges. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3042 |
nr := changeNrToStartSearch. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3043 |
[ (direction == #previous and:[nr >= 1]) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3044 |
or:[ direction == #next and:[ nr <= lastNr]] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3045 |
] whileTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3046 |
(aBlock value:nr) ifTrue:[ |
18059 | 3047 |
self selectChange:nr. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3048 |
^ nr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3049 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3050 |
nr := nr + increment. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3051 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3052 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3053 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3054 |
self showNotFound. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3055 |
self windowGroup sensor flushKeyboard. "/ avoid multiple beeps, in case of type ahead |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3056 |
^ 0 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3057 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3058 |
"Created: / 08-03-2012 / 11:57:26 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3059 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3060 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3061 |
findNextSnapshot |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3062 |
"findNextSnapshot menu action: select the next change which is for a snapShot-image save action" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3063 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3064 |
lastSearchType := #snapshot. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3065 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3066 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3067 |
self findNextForWhich: [:changeNr | self changeIsSnapShotInfo:changeNr ] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3068 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3069 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3070 |
findNextWithString:searchString |
14939 | 3071 |
|includesMatchCharacters| |
3072 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3073 |
lastSearchType := #string. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3074 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3075 |
lastSearchString := searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3076 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3077 |
changeNrShown isNil ifTrue:[ |
14939 | 3078 |
changeNrShown := 0. |
3079 |
]. |
|
3080 |
||
3081 |
includesMatchCharacters := searchString includesMatchCharacters. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3082 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3083 |
self findNextForWhich: |
14939 | 3084 |
[:changeNr | |
3085 |
|s| |
|
3086 |
||
3087 |
s := self sourceOfMethodChange:changeNr. |
|
3088 |
s notNil and:[ |
|
3089 |
(includesMatchCharacters not and:[(s findString:searchString) ~~ 0]) |
|
3090 |
or:[ includesMatchCharacters and:[('*' , searchString , '*') match:s ]]] |
|
3091 |
]. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3092 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3093 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3094 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3095 |
codeView setSearchPattern:searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3096 |
codeView |
14939 | 3097 |
searchFwd:searchString |
3098 |
ignoreCase:false |
|
3099 |
startingAtLine:1 col:0 |
|
3100 |
ifAbsent:nil. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3101 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3102 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3103 |
findPrevious |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3104 |
"findPrevious menu action: select the previous change. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3105 |
Searches for what the last search was for; i.e. either same class or same selector" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3106 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3107 |
lastSearchType == #selector ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3108 |
^ self findPreviousForSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3109 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3110 |
lastSearchType == #snapshot ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3111 |
^ self findPreviousSnapshot |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3112 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3113 |
lastSearchType == #string ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3114 |
^ self findPreviousForString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3115 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3116 |
lastSearchType == #difference ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3117 |
^ self findPreviousDifference |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3118 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3119 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3120 |
^ self findPreviousForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3121 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3122 |
"Created: / 18.6.1998 / 22:15:15 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3123 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3124 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3125 |
findPreviousDifference |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3126 |
lastSearchType := #difference. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3127 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3128 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3129 |
self findPreviousForWhich:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3130 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3131 |
"/ same |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3132 |
false |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3133 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3134 |
"/ different |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3135 |
true |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3136 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3137 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3138 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3139 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3140 |
findPreviousForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3141 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3142 |
|
12738 | 3143 |
self findPreviousForClassStartingAt:((changeNrShown ? 1) - 1) |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3144 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3145 |
"Modified: / 20-11-2006 / 16:39:04 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3146 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3147 |
|
15674 | 3148 |
findPreviousForClass:className startingAt:startNr |
3149 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
|
3150 |
||
3151 |
lastSearchType := #class. |
|
3152 |
||
3153 |
self |
|
3154 |
findPreviousForWhich: |
|
3155 |
[:changeNr | |
|
3156 |
|thisClass| |
|
3157 |
||
3158 |
thisClass := self classNameOfChange:changeNr. |
|
3159 |
(thisClass = className |
|
3160 |
or:[className includesMatchCharacters |
|
3161 |
and:[className match:thisClass]])] |
|
3162 |
startingAt:startNr |
|
3163 |
! |
|
3164 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3165 |
findPreviousForClassStartingAt:startNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3166 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3167 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3168 |
|cls| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3169 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3170 |
lastSearchType := #class. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3171 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3172 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3173 |
cls := self classNameOfChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3174 |
cls isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3175 |
|
15674 | 3176 |
self findPreviousForClass:cls startingAt:startNr |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3177 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3178 |
"Created: / 20-11-2006 / 16:38:37 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3179 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3180 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3181 |
findPreviousForSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3182 |
"findPreviousForSelector menu action: select the previous change for the selected changes selector" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3183 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3184 |
|sel| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3185 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3186 |
lastSearchType := #selector. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3187 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3188 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3189 |
sel := self selectorOfMethodChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3190 |
sel isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3191 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3192 |
self findPreviousForWhich: |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3193 |
[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3194 |
|thisSelector| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3195 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3196 |
thisSelector := self selectorOfMethodChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3197 |
(thisSelector = sel |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3198 |
or:[sel includesMatchCharacters and:[sel match:thisSelector]]) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3199 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3200 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3201 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3202 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3203 |
findPreviousForString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3204 |
lastSearchString isNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3205 |
^ self findString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3206 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3207 |
self findPreviousWithString:lastSearchString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3208 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3209 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3210 |
findPreviousForWhich:aBlock |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3211 |
"helper: select the previous change for which aBlock evaluates to true" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3212 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3213 |
^ self findPreviousForWhich:aBlock startingAt:(changeNrShown - 1) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3214 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3215 |
"Modified: / 06-10-2006 / 11:01:38 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3216 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3217 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3218 |
findPreviousForWhich:aBlock startingAt:changeNrToStartSearch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3219 |
"helper: select the previous change for which aBlock evaluates to true" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3220 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3221 |
^ self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3222 |
findNextOrPrevious:#previous |
18059 | 3223 |
forWhich:aBlock |
3224 |
startingAt:changeNrToStartSearch |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3225 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3226 |
"Created: / 06-10-2006 / 11:01:09 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3227 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3228 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3229 |
findPreviousSnapshot |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3230 |
"findPreviousSnapshot menu action: select the previous change which is for a snapShot-image save action" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3231 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3232 |
lastSearchType := #snapshot. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3233 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3234 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3235 |
self findPreviousForWhich: [:changeNr | self changeIsSnapShotInfo:changeNr ] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3236 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3237 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3238 |
findPreviousWithString:searchString |
14939 | 3239 |
|includesMatchCharacters| |
3240 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3241 |
lastSearchType := #string. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3242 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3243 |
lastSearchString := searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3244 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3245 |
changeNrShown isNil ifTrue:[ |
14939 | 3246 |
changeNrShown := 0. |
3247 |
]. |
|
3248 |
||
3249 |
includesMatchCharacters := searchString includesMatchCharacters. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3250 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3251 |
self findPreviousForWhich: |
14939 | 3252 |
[:changeNr | |
3253 |
|s | |
|
3254 |
||
3255 |
s := self sourceOfMethodChange:changeNr. |
|
3256 |
s notNil and:[ |
|
3257 |
(includesMatchCharacters not and:[(s findString:searchString) ~~ 0]) |
|
3258 |
or:[includesMatchCharacters and:[('*' , searchString , '*') match:s ]]] |
|
3259 |
]. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3260 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3261 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3262 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3263 |
codeView setSearchPattern:searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3264 |
codeView |
14939 | 3265 |
searchFwd:searchString |
3266 |
ignoreCase:false |
|
3267 |
startingAtLine:1 col:0 |
|
3268 |
ifAbsent:nil. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3269 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3270 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3271 |
findSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3272 |
"findSelector menu action: let user enter a selector, and select the next change for that selector" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3273 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3274 |
|current| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3275 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3276 |
changeNrShown notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3277 |
current := self selectorOfMethodChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3278 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3279 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3280 |
self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3281 |
askForSearch:'Selector to search for:' |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3282 |
initialAnswer:current |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3283 |
thenSearchUsing:[:searchString :changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3284 |
|thisSelector| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3285 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3286 |
thisSelector := self selectorOfMethodChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3287 |
(thisSelector = searchString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3288 |
or:[searchString includesMatchCharacters and:[searchString match:thisSelector]]) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3289 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3290 |
onCancel:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3291 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3292 |
lastSearchType := #selector. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3293 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3294 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3295 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3296 |
findString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3297 |
|searchString directionHolder| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3298 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3299 |
lastSearchType := #string. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3300 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3301 |
searchString := codeView selection. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3302 |
searchString size == 0 ifTrue:[searchString := lastSearchString]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3303 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3304 |
searchString := self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3305 |
askForSearchString:'String to search for:' |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3306 |
initialAnswer:(searchString ? '') |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3307 |
directionInto:(directionHolder := ValueHolder new). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3308 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3309 |
searchString size == 0 ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3310 |
^ self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3311 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3312 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3313 |
directionHolder value == #backward ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3314 |
self findPreviousWithString:searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3315 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3316 |
self findNextWithString:searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3317 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3318 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3319 |
|
10719 | 3320 |
ignorePublicPrivateCategories:aBoolean |
3321 |
UserPreferences current ignorePublicPrivateCategories:aBoolean |
|
3322 |
||
3323 |
"Created: / 23-09-2011 / 19:52:21 / cg" |
|
3324 |
! |
|
3325 |
||
3202 | 3326 |
menuExit |
3204 | 3327 |
self closeRequest |
3202 | 3328 |
! |
3329 |
||
3330 |
openAboutThisApplication |
|
3331 |
"opens an about box for this application." |
|
3332 |
||
7115 | 3333 |
Dialog aboutClass:self class. |
3334 |
||
3335 |
"Modified: / 12-09-2006 / 17:20:22 / cg" |
|
3202 | 3336 |
! |
3337 |
||
3338 |
openHTMLDocument:relativeDocPath |
|
3339 |
HTMLDocumentView openFullOnDocumentationFile:relativeDocPath |
|
3340 |
! |
|
3341 |
||
9055 | 3342 |
openSettingsDialog |
14558 | 3343 |
|settingsList| |
9055 | 3344 |
|
3345 |
settingsList := |
|
3346 |
#( |
|
3347 |
#('Editor' #'AbstractSettingsApplication::EditSettingsAppl' ) |
|
3348 |
"/ #('Syntax Color' #'AbstractSettingsApplication::SyntaxColorSettingsAppl' ) |
|
3349 |
"/ #('Code Format' #'AbstractSettingsApplication::SourceCodeFormatSettingsAppl' ) |
|
3350 |
"/ #('System Browser' #'AbstractSettingsApplication::SystemBrowserSettingsAppl' ) |
|
3351 |
#('Compiler' #'AbstractSettingsApplication::GeneralCompilerSettingsAppl' ) |
|
3352 |
#('Compiler/ByteCode' #'AbstractSettingsApplication::ByteCodeCompilerSettingsAppl' ) |
|
3353 |
"/ #('Source Code Management' #'AbstractSettingsApplication::SourceCodeManagementSettingsAppl') |
|
3354 |
). |
|
3355 |
||
14558 | 3356 |
SettingsDialog |
3357 |
openWithList:settingsList |
|
3358 |
label:(resources string:'Change Browser Settings'). |
|
9055 | 3359 |
! |
3360 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3361 |
setEnforcedNameSpace |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3362 |
|nsName listOfKnownNameSpaces keepAsDefaultHolder| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3363 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3364 |
listOfKnownNameSpaces := Set new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3365 |
NameSpace |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3366 |
allNameSpaces |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3367 |
do:[:eachNameSpace | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3368 |
listOfKnownNameSpaces add:eachNameSpace name |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3369 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3370 |
listOfKnownNameSpaces := listOfKnownNameSpaces asOrderedCollection sort. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3371 |
|
15450 | 3372 |
Dialog modifyingBoxWith:[:box | |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3373 |
keepAsDefaultHolder := true asValue. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3374 |
box verticalPanel |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3375 |
add:((CheckBox |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3376 |
label:(resources string:'Use this as default in the future')) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3377 |
model:keepAsDefaultHolder). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3378 |
] do:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3379 |
nsName := Dialog |
15450 | 3380 |
request:(resources string:'When applying, new classes are created in nameSpace:') |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3381 |
initialAnswer:(enforcedNameSpace ? LastEnforcedNameSpace ? Class nameSpaceQuerySignal query name) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3382 |
list:listOfKnownNameSpaces. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3383 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3384 |
nsName isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3385 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3386 |
(nsName isEmpty or:[nsName = 'Smalltalk']) ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3387 |
applyInOriginalNameSpace value:true. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3388 |
LastEnforcedNameSpace := enforcedNameSpace := nil. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3389 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3390 |
applyInOriginalNameSpace value:false. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3391 |
LastEnforcedNameSpace := enforcedNameSpace := NameSpace name:nsName. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3392 |
autoCompare value ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3393 |
self doUpdate |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3394 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3395 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3396 |
KeepEnforcedNameSpace := keepAsDefaultHolder value. |
11680
5b1a15736f97
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11499
diff
changeset
|
3397 |
codeView nameSpaceForDoits:enforcedNameSpace. |
5b1a15736f97
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11499
diff
changeset
|
3398 |
diffView textViews do:[:each | each nameSpaceForDoits:enforcedNameSpace]. |
5b1a15736f97
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11499
diff
changeset
|
3399 |
|
5b1a15736f97
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11499
diff
changeset
|
3400 |
"Modified: / 26-07-2012 / 23:06:23 / cg" |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3401 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3402 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3403 |
setEnforcedPackage |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3404 |
|pkg listOfKnownPackages| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3405 |
|
16207 | 3406 |
listOfKnownPackages := Smalltalk allPackageIDs. |
12645 | 3407 |
"/ Smalltalk allClassesDo:[:eachClass | |
3408 |
"/ |package| |
|
3409 |
"/ |
|
3410 |
"/ package := eachClass package. |
|
3411 |
"/ package size > 0 ifTrue:[ |
|
3412 |
"/ listOfKnownPackages add:package |
|
3413 |
"/ ] |
|
3414 |
"/ ]. |
|
3415 |
listOfKnownPackages := listOfKnownPackages asNewOrderedCollection sort. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3416 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3417 |
pkg := Dialog |
12645 | 3418 |
request:'When applying, changes go into package:' |
3419 |
initialAnswer:(enforcedPackage ? Class packageQuerySignal query) |
|
3420 |
list:listOfKnownPackages. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3421 |
pkg size ~~ 0 ifTrue:[ |
12645 | 3422 |
enforcedPackage := pkg |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3423 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3424 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3425 |
|
3202 | 3426 |
showAboutSTX |
3427 |
ToolApplicationModel openAboutSTX |
|
3428 |
! ! |
|
3429 |
||
202 | 3430 |
!ChangesBrowser methodsFor:'private'! |
3431 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3432 |
autoSelect:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3433 |
"select a change" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3434 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3435 |
self class autoSelectNext ifTrue:[ |
18059 | 3436 |
(changeNr <= self numberOfChanges) ifTrue:[ |
3437 |
self selectChange:changeNr. |
|
3438 |
^ self |
|
3439 |
] |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3440 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3441 |
self clearCodeView. |
18059 | 3442 |
self unselect. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3443 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3444 |
"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
|
3445 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3446 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3447 |
autoSelectLast |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3448 |
"select the last change" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3449 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3450 |
self autoSelect:(self numberOfChanges) |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3451 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3452 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3453 |
autoSelectOrEnd:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3454 |
"select the next change or the last" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3455 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3456 |
|last| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3457 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3458 |
last := self numberOfChanges. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3459 |
changeNr < last ifTrue:[ |
18059 | 3460 |
self autoSelect:changeNr |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3461 |
] ifFalse:[ |
18059 | 3462 |
last == 0 ifTrue:[ |
3463 |
last := nil |
|
3464 |
]. |
|
3465 |
self selectChange:last. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3466 |
] |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3467 |
|
3406
8fe22b36fbc2
fixed autoselectNext if list is empty
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
3468 |
"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
|
3469 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3470 |
|
16372 | 3471 |
changeChunkAt:index |
3472 |
^ (changeInfoList at:index) chunk |
|
3473 |
"/ ^ changeChunks at:index |
|
3474 |
||
3475 |
"Created: / 01-05-2016 / 18:24:28 / cg" |
|
3476 |
! |
|
3477 |
||
3478 |
changeClassNameAt:index |
|
3479 |
^ (changeInfoList at:index) className |
|
3480 |
||
3481 |
"Created: / 01-05-2016 / 18:28:13 / cg" |
|
3482 |
"Modified: / 01-05-2016 / 19:32:42 / cg" |
|
3483 |
! |
|
3484 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3485 |
checkClassIsLoaded:aClass |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3486 |
"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
|
3487 |
|
6162
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
3488 |
|cls answer| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3489 |
|
3359
2cc7eff866e4
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
3341
diff
changeset
|
3490 |
cls := aClass theNonMetaclass. |
5825 | 3491 |
cls isLoaded ifTrue:[ |
6357 | 3492 |
^ true. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3493 |
]. |
11805 | 3494 |
(classesNotToBeAutoloaded includes:#all) ifTrue:[ |
3495 |
^ false. |
|
3496 |
]. |
|
8026
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3497 |
(classesNotToBeAutoloaded includes:cls) ifTrue:[ |
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3498 |
^ false. |
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3499 |
]. |
5825 | 3500 |
|
6216 | 3501 |
autoloadAsRequired value == true ifTrue:[ |
6357 | 3502 |
answer := true |
6216 | 3503 |
] ifFalse:[ |
11805 | 3504 |
answer := Dialog |
3505 |
confirmWithCancel:(resources |
|
17400 | 3506 |
stringWithCRs:'%1 is an autoloaded class.\I can only compare the method''s source if it''s loaded first.\\Shall the class be loaded now ?' |
11805 | 3507 |
with:cls name allBold) |
3508 |
labels:(resources array:#('Cancel' 'No for All' 'No' 'Yes')) |
|
3509 |
values:#(nil #never false true) |
|
3510 |
default:4. |
|
3511 |
answer isNil ifTrue:[ |
|
3512 |
"cancel the operation" |
|
3513 |
AbortAllOperationRequest raise. |
|
3514 |
"not reached" |
|
3515 |
]. |
|
3516 |
answer == #never ifTrue:[ |
|
3517 |
classesNotToBeAutoloaded add:#all. |
|
3518 |
^ false. |
|
3519 |
]. |
|
8026
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3520 |
]. |
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3521 |
|
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3522 |
answer ifTrue:[ |
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3523 |
Autoload autoloadFailedSignal catch:[ |
6357 | 3524 |
^ cls autoload isLoaded |
3525 |
] |
|
5825 | 3526 |
]. |
6162
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
3527 |
|
8026
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3528 |
classesNotToBeAutoloaded add:cls. |
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3529 |
|
6162
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
3530 |
^ false. |
17400 | 3531 |
|
3532 |
"Modified: / 13-02-2017 / 19:57:15 / cg" |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3533 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3534 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3535 |
checkSingleSelectedChange |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3536 |
"just a helper, check for a single selection" |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3537 |
|
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3538 |
|changeNr| |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3539 |
|
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3540 |
(changeNr := self theSingleSelection) isNil ifTrue:[ |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3541 |
self information:'Only possible if a single change is selected.'. |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3542 |
AbortSignal raise. |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3543 |
^ nil. |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3544 |
]. |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3545 |
^ changeNr |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3546 |
! |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3547 |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3548 |
classFromEvaluatingTree:aParseTree |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3549 |
|thisClass| |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3550 |
|
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3551 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3552 |
do:[ |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3553 |
thisClass := Parser undefinedVariableError handle:[:ex | ] do:[ aParseTree evaluate ]. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3554 |
]. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3555 |
^ thisClass |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3556 |
|
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3557 |
"Created: / 05-03-2012 / 14:28:01 / cg" |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3558 |
! |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3559 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3560 |
clearCodeView |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3561 |
"clear the (lower) code view." |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3562 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3563 |
self unselect "changeListView deselect". |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3564 |
codeView contents:nil. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3565 |
changeNrShown := nil |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3566 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3567 |
|
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3568 |
currentSourceForParseTree:parseTree |
12845 | 3569 |
|selector thisClass method mClass thisClassSym ownerClass receiver classGlobalNode| |
4857 | 3570 |
|
6288 | 3571 |
(parseTree isNil |
3572 |
or:[parseTree == #Error |
|
4857 | 3573 |
or:[ parseTree isMessage not ]]) ifTrue:[ |
6614 | 3574 |
^ nil |
4857 | 3575 |
]. |
3576 |
||
3577 |
selector := parseTree selector. |
|
3578 |
receiver := parseTree receiver. |
|
3579 |
||
3580 |
selector == #'removeSelector:' ifTrue:[ |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3581 |
thisClass := self classFromEvaluatingTree:receiver. |
6614 | 3582 |
thisClass isBehavior ifTrue:[ |
3583 |
thisClass isLoaded ifTrue:[ |
|
3584 |
selector := (parseTree arg1 evaluate). |
|
3585 |
(thisClass includesSelector:selector) ifTrue:[ |
|
3586 |
^ (thisClass compiledMethodAt:selector) source. |
|
3587 |
] |
|
3588 |
] ifFalse:[ |
|
3589 |
^ 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
3590 |
] |
|
3591 |
] ifFalse:[ |
|
3592 |
^ 'Cannot compare this change (class not present)'. |
|
3593 |
]. |
|
4857 | 3594 |
]. |
3595 |
selector == #'comment:' ifTrue:[ |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3596 |
thisClass := self classFromEvaluatingTree:receiver. |
6614 | 3597 |
thisClass isBehavior ifTrue:[ |
3598 |
thisClass isLoaded ifTrue:[ |
|
3599 |
^ thisClass name , ' comment: ' , thisClass comment storeString. |
|
3600 |
] ifFalse:[ |
|
3601 |
^ 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
3602 |
] |
|
3603 |
] ifFalse:[ |
|
3604 |
^ 'Cannot compare this change (class not present)'. |
|
3605 |
]. |
|
4857 | 3606 |
]. |
3607 |
||
7953 | 3608 |
(#(#'category:' #'package:') includes:selector) ifTrue:[ |
6614 | 3609 |
receiver isMessage ifTrue:[ |
3610 |
receiver selector == #compiledMethodAt: ifTrue:[ |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3611 |
"/ thisClass := self classFromEvaluatingTree:receiver receiver. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3612 |
"/ thisClass isNil ifTrue:[ |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3613 |
"/ ^ 'Class does not exist.'. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3614 |
"/ ]. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3615 |
|
6614 | 3616 |
classGlobalNode := receiver receiver. |
3617 |
(classGlobalNode isMessage and:[classGlobalNode selector == #class]) ifTrue:[ |
|
3618 |
classGlobalNode := classGlobalNode receiver |
|
3619 |
]. |
|
3620 |
classGlobalNode isUndeclared ifTrue:[ |
|
3621 |
^ 'Class does not exist.'. |
|
3622 |
]. |
|
3623 |
Error handle:[method := nil] do:[method := receiver evaluate]. |
|
7953 | 3624 |
method isMethod ifFalse:[ |
3625 |
^ 'There is no such method'. |
|
3626 |
]. |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3627 |
mClass := method mclass. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3628 |
|
7953 | 3629 |
selector == #category: ifTrue:[ |
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3630 |
"/ method category = parseTree arg1 evaluate ifFalse:[ |
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3631 |
^ '(' , mClass name , ' compiledMethodAt: ' , method selector storeString , ') category: ' , method category storeString. |
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3632 |
"/ ]. |
6614 | 3633 |
] ifFalse:[ |
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3634 |
"/ method package = parseTree arg1 evaluate ifFalse:[ |
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3635 |
^ '(' , mClass name , ' compiledMethodAt: ' , method selector storeString , ') package: ' , method package storeString. |
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3636 |
"/ ]. |
7953 | 3637 |
]. |
3638 |
^ nil |
|
6614 | 3639 |
] |
3640 |
] |
|
4857 | 3641 |
]. |
3642 |
||
3643 |
selector == #'instanceVariableNames:' ifTrue:[ |
|
6614 | 3644 |
receiver isMessage ifTrue:[ |
3645 |
receiver selector == #class ifTrue:[ |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3646 |
thisClass := self classFromEvaluatingTree:receiver. |
6614 | 3647 |
thisClass isBehavior ifTrue:[ |
3648 |
thisClass isLoaded ifTrue:[ |
|
4857 | 3649 |
"/ varsHere := thisClass instanceVariableString asCollectionOfWords. |
3650 |
"/ varsInChange := (parseTree arguments at:1) evaluate asCollectionOfWords. |
|
6614 | 3651 |
^ thisClass definition. |
3652 |
] ifFalse:[ |
|
3653 |
^ 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
3654 |
]. |
|
3655 |
] ifFalse:[ |
|
3656 |
^ 'Cannot compare this change (class not present)'. |
|
3657 |
] |
|
3658 |
]. |
|
3659 |
] |
|
4857 | 3660 |
]. |
3661 |
||
3662 |
(Class definitionSelectors includes:selector) |
|
6288 | 3663 |
"/ selector == #'subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:' |
4857 | 3664 |
ifTrue:[ |
6614 | 3665 |
"/ Class nameSpaceQuerySignal |
3666 |
"/ answer:(self nameSpaceForApply) |
|
3667 |
"/ do:[ |
|
3668 |
"/ superClass := receiver evaluate. |
|
3669 |
"/ ]. |
|
3670 |
"/ superClass isBehavior ifFalse:[ |
|
3671 |
"/ self nameSpaceForApply classNamed:receiver name |
|
3672 |
"/ ]. |
|
3673 |
"/ superClass isBehavior ifFalse:[ |
|
3674 |
"/ |rest matchingKeys superClassName| |
|
3675 |
"/ |
|
3676 |
"/ rest := '::' , receiver name. |
|
3677 |
"/ matchingKeys := Smalltalk keys select:[:nm | nm endsWith:rest]. |
|
3678 |
"/ superClassName := Dialog choose:'Which Class ?' fromList:matchingKeys lines:10. |
|
3679 |
"/ superClassName notEmptyOrNil ifTrue:[ |
|
3680 |
"/ superClass := Smalltalk at:superClassName asSymbol. |
|
3681 |
"/ ]. |
|
3682 |
"/ ]. |
|
3683 |
"/ superClass isBehavior ifFalse:[ |
|
3684 |
"/ ^ 'Cannot compare this change\\(no such superclass).' withCRs. |
|
3685 |
"/ ]. |
|
3686 |
"/ superClass isLoaded ifFalse:[ |
|
3687 |
"/ ^ 'Cannot compare this change\\(superclass not loaded).' withCRs. |
|
3688 |
"/ ]. |
|
3689 |
||
3690 |
thisClassSym := (parseTree arguments at:1) evaluate. |
|
3691 |
||
3692 |
(selector endsWith:':privateIn:') ifTrue:[ |
|
3693 |
ownerClass := (parseTree arguments at:5). |
|
3694 |
ownerClass isUndeclared ifFalse:[ |
|
3695 |
ownerClass := ownerClass evaluate. |
|
3696 |
] ifTrue:[ |
|
3697 |
ownerClass := nil. |
|
3698 |
]. |
|
3699 |
ownerClass isNil ifTrue:[ |
|
3700 |
^ 'Cannot compare this change\\(owning class is not loaded).' withCRs. |
|
3701 |
]. |
|
3702 |
thisClass := ownerClass privateClassesAt:thisClassSym. |
|
3703 |
] ifFalse:[ |
|
3704 |
thisClass := (self nameSpaceForApply) at:thisClassSym ifAbsent:nil. |
|
3705 |
]. |
|
3706 |
thisClass notNil ifTrue:[ |
|
3707 |
thisClass isLoaded ifFalse:[ |
|
3708 |
^ 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
3709 |
] ifTrue:[ |
|
3710 |
^ thisClass definition. |
|
3711 |
] |
|
3712 |
] |
|
4857 | 3713 |
]. |
3714 |
||
3715 |
^ nil. |
|
9570
f81993219003
changed: #oldSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
9548
diff
changeset
|
3716 |
|
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3717 |
"Created: / 15-02-2012 / 15:11:15 / cg" |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3718 |
! |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3719 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3720 |
isChangeSetBrowser |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3721 |
^ false |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3722 |
! |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3723 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3724 |
makeDiffViewInvisible |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3725 |
diffViewBox lower |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3726 |
! |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3727 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3728 |
makeDiffViewVisible |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3729 |
diffViewBox raise |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3730 |
! |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3731 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3732 |
nameSpaceForApply |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3733 |
applyInOriginalNameSpace value ifFalse:[ |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3734 |
^ enforcedNameSpace ? Class nameSpaceQuerySignal query. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3735 |
]. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3736 |
^ Smalltalk. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3737 |
! |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3738 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3739 |
newLabel:how |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3740 |
|l| |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3741 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3742 |
l := self class defaultLabel. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3743 |
(changeFileName notNil and:[changeFileName ~= 'changes']) ifTrue:[ |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3744 |
l := l , ': ', changeFileName |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3745 |
]. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3746 |
l := l , ' ' , how. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3747 |
self label:l |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3748 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3749 |
"Created: / 08-09-1995 / 19:32:04 / claus" |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3750 |
"Modified: / 12-11-2006 / 16:23:53 / cg" |
4857 | 3751 |
! |
3752 |
||
8665 | 3753 |
parseExpression:chunk |
18059 | 3754 |
"parse an expression; return a parseTree" |
3755 |
||
8665 | 3756 |
^ self parseExpression:chunk inNameSpace:(self nameSpaceForApply). |
3757 |
! |
|
3758 |
||
3759 |
parseExpression:text inNameSpace:nameSpace |
|
18059 | 3760 |
"parse an expression; return a parseTree" |
3761 |
||
3762 |
|parser parseTree| |
|
8665 | 3763 |
|
3764 |
"/ old: |
|
3765 |
"/ does not care for VW qualified names |
|
3766 |
"/ ^ Parser parseExpression:text inNameSpace:nameSpace. |
|
3767 |
||
18136 | 3768 |
(text includesString:'§') ifTrue:[ |
18054 | 3769 |
self halt:'should no longer happen' |
3770 |
]. |
|
17094 | 3771 |
|
8665 | 3772 |
"/ new: |
3773 |
parser := Parser for:(ReadStream on:text). |
|
18059 | 3774 |
parser parserFlags |
3775 |
allowQualifiedNames:true; |
|
3776 |
allowDollarInIdentifier:true; |
|
3777 |
allowParagraphInIdentifier:true. |
|
3778 |
||
9228
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3779 |
Error handle:[:ex | |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3780 |
^ nil |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3781 |
] do:[ |
18059 | 3782 |
parseTree := parser |
9228
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3783 |
parseExpressionWithSelf:nil |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3784 |
notifying:nil |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3785 |
ignoreErrors:true |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3786 |
ignoreWarnings:true |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3787 |
inNameSpace:nameSpace. |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3788 |
]. |
18059 | 3789 |
^ parseTree |
17094 | 3790 |
|
3791 |
"Modified: / 21-11-2016 / 23:25:48 / cg" |
|
8665 | 3792 |
! |
3793 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3794 |
queryCloseText |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3795 |
"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
|
3796 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3797 |
^ 'Quit without updating changeFile ?' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3798 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3799 |
|
18059 | 3800 |
selectChange:changeNr |
3801 |
changeListView setSelection:changeNr. |
|
3802 |
self changeSelection:changeNr. |
|
3803 |
! |
|
3804 |
||
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3805 |
selectedClassNames |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3806 |
|classes| |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3807 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3808 |
classes := Set new. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3809 |
self withSelectedChangesDo:[:changeNr | |
6288 | 3810 |
| classNameToCompress | |
3811 |
||
3812 |
classNameToCompress := self classNameOfChange:changeNr. |
|
3813 |
classNameToCompress notNil ifTrue:[ |
|
3814 |
classes add:classNameToCompress. |
|
3815 |
] |
|
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3816 |
]. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3817 |
^ classes |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3818 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3819 |
"Created: / 19.11.2001 / 21:54:59 / cg" |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3820 |
! |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3821 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3822 |
setChangeList |
18059 | 3823 |
<resource: #obsolete> |
16467 | 3824 |
"update the selection-list; |
3825 |
called after the changeList has been modified" |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3826 |
|
18059 | 3827 |
self updateChangeList |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3828 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3829 |
|
3211 | 3830 |
setSingleSelection:changeNr |
3831 |
changeListView multipleSelectOk ifFalse:[ |
|
6288 | 3832 |
changeListView setSelection:changeNr. |
3211 | 3833 |
] ifTrue:[ |
6288 | 3834 |
changeListView setSelection:(Array with:changeNr). |
3211 | 3835 |
]. |
3836 |
! |
|
3837 |
||
16467 | 3838 |
showNumberOfChanges |
3839 |
infoHolder value:(resources string:'%1 changes.' with:changeInfoList size). |
|
3840 |
! |
|
3841 |
||
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3842 |
sourceOfChange:changeNr |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3843 |
|aStream sawExcla chunk| |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3844 |
|
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3845 |
aStream := self streamForChange:changeNr. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3846 |
aStream isNil ifTrue:[ |
6288 | 3847 |
^ nil |
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3848 |
]. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3849 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3850 |
chunk := aStream nextChunk. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3851 |
sawExcla ifTrue:[ |
6288 | 3852 |
chunk := aStream nextChunk |
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3853 |
]. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3854 |
aStream close. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3855 |
^ chunk |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3856 |
! |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3857 |
|
12599
827681c8f7d4
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
3858 |
timeStampPrintStringOf:ts |
827681c8f7d4
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
3859 |
^ ts printString |
17838 | 3860 |
|
3861 |
" |
|
3862 |
self basicNew timeStampPrintStringOf:(Timestamp now) |
|
3863 |
" |
|
3864 |
||
3865 |
"Modified (format): / 05-12-2017 / 15:08:48 / cg" |
|
12599
827681c8f7d4
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
3866 |
! |
827681c8f7d4
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
3867 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3868 |
unselect |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3869 |
"common unselect" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3870 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3871 |
changeListView setSelection:nil. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3872 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3873 |
"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
|
3874 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3875 |
|
18059 | 3876 |
updateChangeList |
3877 |
"update the selection-list; |
|
3878 |
called after the changeList has been modified" |
|
3879 |
||
3880 |
|headerList| |
|
3881 |
||
3882 |
headerList := changeInfoList collect:[:info | info headerLine]. |
|
3883 |
changeListView setList:headerList expandTabs:false redraw:false. |
|
3884 |
changeListView invalidate. |
|
3885 |
self showNumberOfChanges. |
|
3886 |
||
3887 |
"/ changeListView deselect. |
|
3888 |
||
3889 |
"Modified: / 01-05-2016 / 19:27:35 / cg" |
|
3890 |
! |
|
3891 |
||
3211 | 3892 |
withSelectedChangesDo:aBlock |
3893 |
"just a helper, check for a selected change and evaluate aBlock |
|
3894 |
with busy cursor" |
|
3895 |
||
3896 |
self withSelectedChangesInOrder:nil do:aBlock |
|
3897 |
! |
|
3898 |
||
3899 |
withSelectedChangesInOrder:order do:aBlock |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3900 |
"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
|
3901 |
with busy cursor" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3902 |
|
3211 | 3903 |
|changeNrSelection| |
3904 |
||
3905 |
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
|
3906 |
|
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3907 |
"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
|
3908 |
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
|
3909 |
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
|
3910 |
|
3211 | 3911 |
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
|
3912 |
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
|
3913 |
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
|
3914 |
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
|
3915 |
] |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3916 |
] |
3211 | 3917 |
] 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
|
3918 |
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
|
3919 |
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
|
3920 |
|changeNumbers| |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3921 |
|
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3922 |
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
|
3923 |
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
|
3924 |
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
|
3925 |
]. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3926 |
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
|
3927 |
] |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3928 |
] |
3211 | 3929 |
]. |
3930 |
! |
|
3931 |
||
3932 |
withSelectedChangesReverseDo:aBlock |
|
3933 |
"just a helper, check for a selected change and evaluate aBlock |
|
3934 |
with busy cursor" |
|
3935 |
||
3936 |
self withSelectedChangesInOrder:#reverse do:aBlock |
|
3668 | 3937 |
! |
3938 |
||
3939 |
withSingleSelectedChangeDo:aBlock |
|
3940 |
"just a helper, check for a single selection, and evaluate aBlock |
|
3941 |
with busy cursor" |
|
3942 |
||
3943 |
self theSingleSelection isNil ifTrue:[ |
|
6288 | 3944 |
^ self information:'Only possible if a single change is selected.'. |
3668 | 3945 |
]. |
3946 |
||
3947 |
self withSelectedChangesInOrder:nil do:aBlock |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3948 |
! ! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3949 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3950 |
!ChangesBrowser methodsFor:'private-change access'! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3951 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3952 |
changeIsFollowupMethodChange:changeNr |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3953 |
"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
|
3954 |
in a bunch of methodsFor-changes)" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3955 |
|
16372 | 3956 |
^ (changeInfoList at:changeNr) isFollowupChange |
3957 |
||
3958 |
"Created: / 06-02-1998 / 13:03:39 / cg" |
|
3959 |
"Modified: / 01-05-2016 / 19:32:06 / cg" |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3960 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3961 |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3962 |
changeIsSnapShotInfo:changeNr |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3963 |
"return true, if a change is a snapShot info chunk" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3964 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3965 |
|words chunk| |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3966 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3967 |
(self classNameOfChange:changeNr) isNil ifTrue:[ |
16372 | 3968 |
" |
3969 |
get the chunk |
|
3970 |
" |
|
3971 |
chunk := self changeChunkAt:changeNr. |
|
3972 |
"mhmh - empty ??" |
|
3973 |
chunk notNil ifTrue:[ |
|
3974 |
(chunk startsWith:'''---') ifTrue:[ |
|
3975 |
words := chunk asCollectionOfWords. |
|
3976 |
words size > 2 ifTrue:[ |
|
3977 |
(words at:2) = 'snapshot' ifTrue:[ |
|
3978 |
^ true |
|
3979 |
]. |
|
3980 |
]. |
|
3981 |
]. |
|
3982 |
]. |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3983 |
]. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3984 |
^ false |
16372 | 3985 |
|
3986 |
"Modified: / 01-05-2016 / 18:25:25 / cg" |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3987 |
! |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3988 |
|
11396 | 3989 |
classNameFromAttributeChangeParseTree:aParseTree |
3990 |
"mhmh - seems to always return the name of the nonMeta class - is this OK?" |
|
3991 |
||
11397 | 3992 |
|recTree isMeta name| |
11396 | 3993 |
|
3994 |
recTree := aParseTree receiver. |
|
3995 |
||
3996 |
(recTree notNil |
|
3997 |
and:[recTree ~~ #Error |
|
3998 |
and:[recTree isMessage |
|
3999 |
and:[recTree selector == #compiledMethodAt:]]]) ifTrue:[ |
|
4000 |
isMeta := false. |
|
4001 |
recTree := recTree receiver. |
|
4002 |
recTree isUnaryMessage ifTrue:[ |
|
4003 |
(recTree selector ~~ #class) ifTrue:[^ nil]. |
|
4004 |
"id class " |
|
4005 |
recTree := recTree receiver |
|
4006 |
]. |
|
4007 |
recTree isPrimary ifTrue:[ |
|
4008 |
name := recTree name. |
|
4009 |
isMeta ifTrue:[ |
|
4010 |
^ name , ' class'. |
|
4011 |
]. |
|
4012 |
^ name |
|
4013 |
] |
|
4014 |
]. |
|
4015 |
"very strange" |
|
4016 |
^ nil |
|
4017 |
||
4018 |
"Created: / 08-03-2012 / 09:42:36 / cg" |
|
4019 |
! |
|
4020 |
||
4021 |
classNameFromClassDefinitionChange:changeNr |
|
11397 | 4022 |
|changeStream chunk fullParseTree sel arg1Tree ownerTree ownerName name| |
11396 | 4023 |
|
4024 |
"/ must parse the full changes text, to get privacy information. |
|
4025 |
||
4026 |
changeStream := self streamForChange:changeNr. |
|
4027 |
changeStream isNil ifTrue:[ ^ nil]. |
|
4028 |
||
4029 |
chunk := changeStream nextChunk. |
|
4030 |
changeStream close. |
|
4031 |
fullParseTree := self parseExpression:chunk. |
|
4032 |
(fullParseTree isNil or:[fullParseTree == #Error]) ifTrue:[ |
|
4033 |
^ nil |
|
4034 |
]. |
|
4035 |
fullParseTree isMessage ifFalse:[ |
|
4036 |
^ nil |
|
4037 |
]. |
|
4038 |
||
4039 |
sel := fullParseTree selector. |
|
4040 |
arg1Tree := fullParseTree arg1. |
|
16390 | 4041 |
(arg1Tree notNil and:[arg1Tree isLiteral]) ifTrue:[ |
11396 | 4042 |
name := arg1Tree value asString. |
4043 |
||
4044 |
"/ is it a private-class ? |
|
4045 |
('*privateIn:' match:sel) ifTrue:[ |
|
4046 |
ownerTree := fullParseTree args last. |
|
4047 |
ownerName := ownerTree name asString. |
|
4048 |
^ ownerName , '::' , name |
|
4049 |
]. |
|
4050 |
^ name |
|
4051 |
]. |
|
4052 |
"very strange" |
|
4053 |
^ nil |
|
4054 |
||
4055 |
"Created: / 08-03-2012 / 09:34:04 / cg" |
|
4056 |
! |
|
4057 |
||
4058 |
classNameFromReceiverInParseTree:aParseTree |
|
4059 |
"extrat the class name from a method-change, methodRemove or comment-change's |
|
4060 |
parse tree" |
|
4061 |
||
4062 |
|recTree isMeta cls name| |
|
4063 |
||
4064 |
recTree := aParseTree receiver. |
|
4065 |
(recTree isNil or:[recTree == #Error]) ifTrue:[ |
|
4066 |
"more strange things" |
|
4067 |
^ nil |
|
4068 |
]. |
|
4069 |
||
4070 |
isMeta := false. |
|
4071 |
recTree isUnaryMessage ifTrue:[ |
|
4072 |
(recTree selector ~~ #class) ifTrue:[^ nil]. |
|
4073 |
"id class methodsFor:..." |
|
4074 |
recTree := recTree receiver. |
|
4075 |
isMeta := true. |
|
4076 |
]. |
|
4077 |
recTree isPrimary ifTrue:[ |
|
4078 |
cls := self classFromEvaluatingTree:recTree. |
|
4079 |
cls notNil ifTrue:[^ cls name]. |
|
4080 |
||
4081 |
name := recTree name. |
|
4082 |
isMeta ifTrue:[ |
|
4083 |
^ name , ' class'. |
|
4084 |
]. |
|
4085 |
^ name |
|
4086 |
]. |
|
4087 |
||
4088 |
"more strange things" |
|
4089 |
^ nil |
|
4090 |
||
4091 |
"Created: / 08-03-2012 / 09:26:57 / cg" |
|
4092 |
! |
|
4093 |
||
4094 |
classNameFromRemoveClassParseTree:aParseTree |
|
11397 | 4095 |
"tree is: Smalltalk removeClass: class" |
4096 |
||
11396 | 4097 |
|recTree arg1Tree| |
4098 |
||
4099 |
recTree := aParseTree receiver. |
|
4100 |
||
4101 |
(recTree notNil |
|
4102 |
and:[recTree ~~ #Error |
|
4103 |
and:[recTree isPrimary |
|
4104 |
and:[recTree name = 'Smalltalk']]]) ifTrue:[ |
|
4105 |
arg1Tree := aParseTree arg1. |
|
13663 | 4106 |
(arg1Tree notNil and:[arg1Tree isVariable]) ifTrue:[ |
11397 | 4107 |
^ arg1Tree name. |
11396 | 4108 |
]. |
4109 |
]. |
|
4110 |
"very strange" |
|
4111 |
^ nil |
|
4112 |
||
4113 |
"Created: / 08-03-2012 / 09:36:59 / cg" |
|
4114 |
! |
|
4115 |
||
11397 | 4116 |
classNameFromRenameClassParseTree:aParseTree |
4117 |
"tree is: Smalltalk renameClass: oldClass to: 'newName'" |
|
4118 |
||
4119 |
|recTree arg1Tree arg2Tree oldName newName| |
|
4120 |
||
4121 |
recTree := aParseTree receiver. |
|
4122 |
||
4123 |
(recTree notNil |
|
4124 |
and:[recTree ~~ #Error |
|
4125 |
and:[recTree isPrimary |
|
4126 |
and:[recTree name = 'Smalltalk']]]) ifTrue:[ |
|
4127 |
arg1Tree := aParseTree arg1. |
|
4128 |
(arg1Tree notNil and:[arg1Tree isPrimary]) ifTrue:[ |
|
4129 |
oldName := arg1Tree name. |
|
4130 |
arg2Tree := aParseTree arg2. |
|
16390 | 4131 |
(arg2Tree notNil and:[arg2Tree isLiteral]) ifTrue:[ |
11397 | 4132 |
newName := arg2Tree evaluate. |
4133 |
(Smalltalk classNamed:oldName) notNil ifTrue:[^ oldName ]. |
|
4134 |
(Smalltalk classNamed:newName) notNil ifTrue:[^ newName ]. |
|
4135 |
]. |
|
4136 |
]. |
|
4137 |
]. |
|
4138 |
"very strange" |
|
4139 |
^ nil |
|
4140 |
||
4141 |
"Created: / 08-03-2012 / 11:42:25 / cg" |
|
4142 |
! |
|
4143 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4144 |
classNameOfChange:changeNr |
6288 | 4145 |
"return the classname of a change |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4146 |
(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
|
4147 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4148 |
|name| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4149 |
|
3364 | 4150 |
name := self realClassNameOfChange:changeNr. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4151 |
name isNil ifTrue:[^ nil]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4152 |
(name endsWith:' class') ifTrue:[ |
12704
6f20f7d39e75
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12656
diff
changeset
|
4153 |
name := name copyButLast:6 |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4154 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4155 |
^ name |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4156 |
|
3364 | 4157 |
"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
|
4158 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4159 |
|
3202 | 4160 |
extractSelectorOfMethodChange:changeNr |
17400 | 4161 |
"return a method-changes selector, or nil if it's not a methodChange" |
3202 | 4162 |
|
4163 |
|source parser sel chunk aParseTree | |
|
4164 |
||
4165 |
source := self sourceOfMethodChange:changeNr. |
|
4166 |
source isNil ifTrue:[ |
|
8665 | 4167 |
(self classNameOfChange:changeNr) notNil ifTrue:[ |
16372 | 4168 |
chunk := self changeChunkAt:changeNr. |
8665 | 4169 |
chunk isNil ifTrue:[^ nil]. "mhmh - empty" |
4170 |
||
4171 |
aParseTree := self parseExpression:chunk. |
|
4172 |
(aParseTree isNil |
|
4173 |
or:[aParseTree == #Error |
|
4174 |
or:[aParseTree isMessage not]]) ifTrue:[ |
|
4175 |
^ nil "seems strange ... (could be a comment)" |
|
4176 |
]. |
|
4177 |
sel := aParseTree selector. |
|
4178 |
(#( |
|
4179 |
#'removeSelector:' |
|
4180 |
) includes:sel) ifTrue:[ |
|
4181 |
sel := aParseTree arguments at:1. |
|
16390 | 4182 |
sel isLiteral ifTrue:[ |
8665 | 4183 |
sel := sel evaluate. |
4184 |
sel isSymbol ifTrue:[ |
|
4185 |
^ sel |
|
4186 |
] |
|
4187 |
] |
|
4188 |
] |
|
4189 |
]. |
|
4190 |
^ nil |
|
3202 | 4191 |
]. |
4192 |
||
4193 |
||
6288 | 4194 |
parser := Parser |
8665 | 4195 |
parseMethodArgAndVarSpecification:source |
4196 |
in:nil |
|
4197 |
ignoreErrors:true |
|
4198 |
ignoreWarnings:true |
|
4199 |
parseBody:false. |
|
3202 | 4200 |
|
4201 |
(parser notNil and:[parser ~~ #Error]) ifTrue:[ |
|
8665 | 4202 |
sel := parser selector. |
3202 | 4203 |
]. |
4204 |
^ sel |
|
4205 |
||
16372 | 4206 |
"Created: / 24-11-1995 / 14:30:46 / cg" |
4207 |
"Modified: / 01-05-2016 / 18:25:39 / cg" |
|
17400 | 4208 |
"Modified (comment): / 13-02-2017 / 19:57:20 / cg" |
3202 | 4209 |
! |
4210 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4211 |
fullClassNameOfChange:changeNr |
6288 | 4212 |
"return the full classname of a change |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
4213 |
(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
|
4214 |
|
11396 | 4215 |
|chunk aParseTree sel name prevMethodDefNr words oldDollarSetting| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4216 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4217 |
changeNr isNil ifTrue:[^ nil]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4218 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4219 |
first look, if not already known |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4220 |
" |
16372 | 4221 |
name := self changeClassNameAt:changeNr. |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
4222 |
name notNil ifTrue:[ |
7953 | 4223 |
name == #nil ifTrue:[^ nil]. |
4224 |
^ name |
|
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
4225 |
]. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4226 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4227 |
prevMethodDefNr := changeNr. |
16372 | 4228 |
[ (changeInfoList at:prevMethodDefNr) isFollowupChange ] whileTrue:[ |
7953 | 4229 |
prevMethodDefNr := prevMethodDefNr - 1. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4230 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4231 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4232 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4233 |
get the chunk |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4234 |
" |
16372 | 4235 |
chunk := self changeChunkAt:prevMethodDefNr. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4236 |
chunk isNil ifTrue:[^ nil]. "mhmh - empty" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4237 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4238 |
(chunk startsWith:'''---') ifTrue:[ |
7953 | 4239 |
words := chunk asCollectionOfWords. |
4240 |
words size > 2 ifTrue:[ |
|
4241 |
(words at:2) = 'checkin' ifTrue:[ |
|
4242 |
name := words at:3. |
|
4243 |
^ name |
|
4244 |
] |
|
4245 |
]. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4246 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4247 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4248 |
"/ fix it - otherwise, it cannot be parsed |
11396 | 4249 |
((chunk endsWith:'primitiveDefinitions:') |
4250 |
or:[(chunk endsWith:'primitiveFunctions:') |
|
4251 |
or:[(chunk endsWith:'primitiveVariables:')]]) ifTrue:[ |
|
7953 | 4252 |
chunk := chunk , '''''' |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4253 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4254 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4255 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4256 |
use parser to construct a parseTree |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4257 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4258 |
oldDollarSetting := Parser allowDollarInIdentifier. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4259 |
[ |
7953 | 4260 |
Parser allowDollarInIdentifier:true. |
5014 | 4261 |
"/ Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
4262 |
"/ do:[ |
|
8665 | 4263 |
aParseTree := self parseExpression:chunk. |
5014 | 4264 |
"/ ]. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4265 |
|
7953 | 4266 |
aParseTree == #Error ifTrue:[ |
4267 |
(chunk includesString:'comment') ifTrue:[ |
|
4268 |
"/ could be a comment ... |
|
8665 | 4269 |
aParseTree := self parseExpression:chunk , ''''. |
7953 | 4270 |
] |
4271 |
]. |
|
3597
2e7fc0ae28c9
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
4272 |
] ensure:[ |
7953 | 4273 |
Parser allowDollarInIdentifier:oldDollarSetting |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4274 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4275 |
(aParseTree isNil or:[aParseTree == #Error]) ifTrue:[ |
7953 | 4276 |
^ 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
|
4277 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4278 |
aParseTree isMessage ifFalse:[ |
7953 | 4279 |
^ nil "very strange ... (whats that ?)" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4280 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4281 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4282 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4283 |
ask parser for selector |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4284 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4285 |
sel := aParseTree selector. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4286 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4287 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4288 |
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
|
4289 |
" |
6288 | 4290 |
(#(#'methodsFor:' |
4291 |
#'privateMethodsFor:' |
|
4292 |
#'protectedMethodsFor:' |
|
4293 |
#'ignoredMethodsFor:' |
|
4294 |
#'publicMethodsFor:' |
|
4295 |
#'removeSelector:' |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4296 |
#'comment:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4297 |
#'primitiveDefinitions:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4298 |
#'primitiveFunctions:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4299 |
#'primitiveVariables:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4300 |
#'renameCategory:to:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4301 |
#'instanceVariableNames:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4302 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4303 |
#'methodsFor:stamp:' "/ Squeak support |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4304 |
#'commentStamp:prior:' "/ Squeak support |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4305 |
#'addClassVarName:' "/ Squeak support |
2527
afa639104477
some support for dolphin source files
Claus Gittinger <cg@exept.de>
parents:
2511
diff
changeset
|
4306 |
#methodsFor "/ Dolphin support |
3472 | 4307 |
#categoriesForClass "/ Dolphin support |
4308 |
#categoriesFor: "/ Dolphin support |
|
2606 | 4309 |
#methods "/ STV support |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4310 |
) includes:sel) ifTrue:[ |
7953 | 4311 |
" |
4312 |
yes, the className is the receiver |
|
4313 |
" |
|
11396 | 4314 |
^ self classNameFromReceiverInParseTree:aParseTree |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4315 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4316 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4317 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4318 |
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
|
4319 |
" |
6288 | 4320 |
(('subclass:*' match:sel) |
2322 | 4321 |
or:[('variable*ubclass:*' match:sel)]) ifTrue:[ |
7953 | 4322 |
"/ must parse the full changes text, to get |
4323 |
"/ privacy information. |
|
11396 | 4324 |
^ self classNameFromClassDefinitionChange:changeNr |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4325 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4326 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4327 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4328 |
is it a class remove ? |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4329 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4330 |
(sel == #removeClass:) ifTrue:[ |
11396 | 4331 |
^ self classNameFromRemoveClassParseTree:aParseTree |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4332 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4333 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4334 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4335 |
is it a method category change ? |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4336 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4337 |
((sel == #category:) |
7953 | 4338 |
or:[sel == #package: |
4339 |
or:[sel == #privacy:]]) ifTrue:[ |
|
11396 | 4340 |
^ self classNameFromAttributeChangeParseTree:aParseTree |
4341 |
]. |
|
4342 |
||
4343 |
sel == #renameClass:to: ifTrue:[ |
|
11397 | 4344 |
^ self classNameFromRenameClassParseTree:aParseTree |
11396 | 4345 |
]. |
4346 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4347 |
^ nil |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4348 |
|
16372 | 4349 |
"Modified: / 01-05-2016 / 19:29:14 / cg" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4350 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4351 |
|
12428 | 4352 |
namespaceOfChange:changeNr |
4353 |
"return the namespace of a change or nil" |
|
4354 |
||
15116 | 4355 |
|className namespace idx| |
12428 | 4356 |
|
4357 |
className := self classNameOfChange:changeNr. |
|
4358 |
className isNil ifTrue:[ ^ nil ]. |
|
4359 |
||
15116 | 4360 |
idx := className indexOfSubCollection:'::'. |
4361 |
idx == 0 ifTrue:[ ^ nil ]. |
|
4362 |
namespace := className copyTo:idx-1. |
|
12428 | 4363 |
^ namespace |
4364 |
! |
|
4365 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4366 |
numberOfChanges |
16372 | 4367 |
^ changeInfoList size |
4368 |
||
4369 |
"Created: / 03-12-1995 / 18:15:39 / cg" |
|
4370 |
"Modified: / 01-05-2016 / 19:24:05 / cg" |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4371 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4372 |
|
2511 | 4373 |
ownerClassNameOfChange:changeNr |
6288 | 4374 |
"return the owner classname of a change |
2511 | 4375 |
For a normal class, this is the className; |
4376 |
for a private class, this is the name of the owning class" |
|
4377 |
||
4706 | 4378 |
|name "ns idx" cls| |
2511 | 4379 |
|
4380 |
name := self classNameOfChange:changeNr. |
|
4381 |
name isNil ifTrue:[^ nil]. |
|
4382 |
cls := Smalltalk at:name asSymbol. |
|
4383 |
(cls notNil and:[cls isBehavior]) ifTrue:[ |
|
6288 | 4384 |
cls owningClass notNil ifTrue:[ |
4385 |
^ cls owningClass name |
|
4386 |
]. |
|
4387 |
^ cls name |
|
2511 | 4388 |
]. |
4389 |
||
4390 |
"/ (name includes:$:) ifTrue:[ |
|
4391 |
"/ idx := name indexOf:$:. |
|
4392 |
"/ ns := name copyTo:idx-1. |
|
4393 |
"/ ns := Smalltalk at:ns asSymbol. |
|
4394 |
"/ ns notNil ifTrue:[ |
|
6288 | 4395 |
"/ |
2511 | 4396 |
"/ ]. |
4397 |
"/ |
|
4398 |
"/ name := name copyFrom:idx+2. |
|
4399 |
"/ (Smalltalk at:ns asSymbol) notNil ifTrue:[ |
|
4400 |
"/ cls |
|
4401 |
"/ ]. |
|
13851 | 4402 |
"/ ^ name copyButLast:6 |
2511 | 4403 |
"/ ]. |
4404 |
^ name |
|
4405 |
||
4406 |
"Modified: 6.12.1995 / 17:06:31 / cg" |
|
4407 |
! |
|
4408 |
||
3364 | 4409 |
realClassNameOfChange:changeNr |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
4410 |
"return the classname of a change. |
6288 | 4411 |
- 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
|
4412 |
changeClassNames for the next query" |
3364 | 4413 |
|
4414 |
|name| |
|
4415 |
||
16372 | 4416 |
name := self changeClassNameAt:changeNr. |
3364 | 4417 |
name isNil ifTrue:[ |
16372 | 4418 |
name := self fullClassNameOfChange:changeNr. |
4419 |
name isNil ifTrue:[ |
|
4420 |
(changeInfoList at:changeNr) className:#nil. |
|
4421 |
]. |
|
3364 | 4422 |
]. |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
4423 |
name == #nil ifTrue:[^ nil]. |
3364 | 4424 |
^ name |
4425 |
||
16372 | 4426 |
"Created: / 05-11-2001 / 18:09:46 / cg" |
4427 |
"Modified: / 01-05-2016 / 19:24:53 / cg" |
|
3364 | 4428 |
! |
4429 |
||
18059 | 4430 |
selectorOfMethodCategoryChange:changeNr |
4431 |
"return a methodCategory-change's selector, |
|
4432 |
or nil if it's not a methodCategoryChange" |
|
4433 |
||
4434 |
(changeInfoList at:changeNr) isMethodCategoryChange ifFalse:[^ nil]. |
|
4435 |
^ (changeInfoList at:changeNr) selector. |
|
4436 |
||
4437 |
"Modified: / 01-05-2016 / 19:26:21 / cg" |
|
4438 |
! |
|
4439 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4440 |
selectorOfMethodChange:changeNr |
18059 | 4441 |
"return a method-change's selector, |
16467 | 4442 |
or nil if it's not a methodChange" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4443 |
|
3202 | 4444 |
|sel | |
4445 |
||
16372 | 4446 |
changeInfoList size >= changeNr ifTrue:[ |
18059 | 4447 |
(changeInfoList at:changeNr) isMethodCategoryChange ifTrue:[^ nil]. |
16372 | 4448 |
sel := (changeInfoList at:changeNr) selector. |
15652 | 4449 |
sel notNil ifTrue:[ ^ sel ]. |
3202 | 4450 |
]. |
4451 |
||
4452 |
sel := self extractSelectorOfMethodChange:changeNr. |
|
4453 |
sel notNil ifTrue:[ |
|
18059 | 4454 |
self assert:(changeInfoList at:changeNr) isMethodCategoryChange not. |
16372 | 4455 |
(changeInfoList at:changeNr) selector:sel. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4456 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4457 |
^ sel |
16372 | 4458 |
|
4459 |
"Modified: / 01-05-2016 / 19:26:21 / cg" |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4460 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4461 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4462 |
sourceOfMethodChange:changeNr |
17400 | 4463 |
"return a method-changes source code, or nil if it's not a methodChange." |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4464 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4465 |
|aStream chunk sawExcla parseTree sourceChunk sel| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4466 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4467 |
aStream := self streamForChange:changeNr. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4468 |
aStream isNil ifTrue:[^ nil]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4469 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4470 |
(self changeIsFollowupMethodChange:changeNr) ifFalse:[ |
8665 | 4471 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
4472 |
chunk := aStream nextChunk. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4473 |
] ifTrue:[ |
16372 | 4474 |
chunk := self changeChunkAt:changeNr. |
8665 | 4475 |
sawExcla := true. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4476 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4477 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4478 |
sawExcla ifTrue:[ |
8665 | 4479 |
parseTree := self parseExpression:chunk. |
4480 |
(parseTree notNil |
|
4481 |
and:[parseTree ~~ #Error |
|
4482 |
and:[parseTree isMessage]]) ifTrue:[ |
|
4483 |
sel := parseTree selector. |
|
4484 |
(#( |
|
4485 |
#methodsFor: |
|
4486 |
#privateMethodsFor: |
|
4487 |
#publicMethodsFor: |
|
4488 |
#ignoredMethodsFor: |
|
4489 |
#protectedMethodsFor: |
|
4490 |
||
4491 |
#methodsFor:stamp: "/ Squeak support |
|
4492 |
#commentStamp:prior: "/ Squeak support |
|
4493 |
#methodsFor "/ Dolphin support |
|
4494 |
#methods "/ STV support |
|
4495 |
) |
|
4496 |
includes:sel) ifTrue:[ |
|
4497 |
sourceChunk := aStream nextChunk. |
|
4498 |
] |
|
4499 |
]. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4500 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4501 |
aStream close. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4502 |
^ sourceChunk |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4503 |
|
16372 | 4504 |
"Created: / 05-09-1996 / 17:11:32 / cg" |
4505 |
"Modified: / 01-05-2016 / 18:25:53 / cg" |
|
17400 | 4506 |
"Modified (comment): / 13-02-2017 / 19:57:25 / cg" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4507 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4508 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4509 |
streamForChange:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4510 |
"answer a stream for change" |
6288 | 4511 |
|
15858 | 4512 |
|aStream encoding| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4513 |
|
16372 | 4514 |
(changeNr between:1 and:changeInfoList size) ifFalse:[^ nil]. |
5702 | 4515 |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
4516 |
aStream := changeFileName asFilename readStreamOrNil. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4517 |
aStream isNil ifTrue:[^ nil]. |
5702 | 4518 |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4519 |
encodingIfKnown isNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4520 |
encoding := CharacterEncoder guessEncodingOfStream:aStream. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4521 |
encodingIfKnown := encoding ? #none |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4522 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4523 |
(encodingIfKnown notNil and:[encodingIfKnown ~~ #none]) ifTrue:[ |
15858 | 4524 |
aStream := EncodedStream stream:aStream encoding:encodingIfKnown. |
5702 | 4525 |
]. |
4526 |
||
16372 | 4527 |
aStream position:((changeInfoList at:changeNr) position)-1. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4528 |
^ aStream |
16372 | 4529 |
|
4530 |
"Modified: / 01-05-2016 / 19:24:17 / cg" |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4531 |
! ! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4532 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4533 |
!ChangesBrowser methodsFor:'private-changeFile access'! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4534 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4535 |
changeFileName:aFileName |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4536 |
"set the name of the changeFile" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4537 |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4538 |
changeFileName := aFileName. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4539 |
encodingIfKnown := nil. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4540 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4541 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4542 |
checkIfFileHasChanged |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4543 |
"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
|
4544 |
install a timeout for rechecking after some time." |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4545 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4546 |
|f info | |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4547 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4548 |
Processor removeTimedBlock:checkBlock. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4549 |
f := changeFileName asFilename. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4550 |
(info := f info) isNil ifTrue:[ |
16092 | 4551 |
self newLabel:'(unaccessible)' |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4552 |
] ifFalse:[ |
16092 | 4553 |
(info modificationTime) > changeFileTimestamp ifTrue:[ |
4554 |
self newLabel:'(outdated)'. |
|
4555 |
autoUpdate value ifTrue:[ |
|
4556 |
self doUpdate |
|
4557 |
] |
|
4558 |
] ifFalse:[ |
|
4559 |
self newLabel:'' |
|
4560 |
] |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4561 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4562 |
Processor addTimedBlock:checkBlock afterSeconds:5. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4563 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4564 |
"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
|
4565 |
"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
|
4566 |
"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
|
4567 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4568 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4569 |
readChangesFile |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4570 |
"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
|
4571 |
and a list of chunk-positions (changePositions)" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4572 |
|
5178 | 4573 |
self readChangesFileInBackground:false. |
4574 |
self newLabel:''. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4575 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4576 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4577 |
readChangesFileInBackground:inBackground |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4578 |
"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
|
4579 |
and a list of chunk-positions (changePositions). |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4580 |
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
|
4581 |
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
|
4582 |
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
|
4583 |
'+' -> 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
|
4584 |
'-' -> 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
|
4585 |
'?' -> class does not exist currently |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4586 |
'=' -> 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
|
4587 |
'~' -> 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
|
4588 |
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
|
4589 |
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
|
4590 |
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
|
4591 |
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
|
4592 |
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
|
4593 |
4 timestamp |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4594 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4595 |
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
|
4596 |
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
|
4597 |
|
12635 | 4598 |
|inStream i f askedForEditingClassSource myProcess myPriority myPrioRange| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4599 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4600 |
editingClassSource := false. |
2641 | 4601 |
askedForEditingClassSource := false. |
17953 | 4602 |
changeInfoList := #(). "make sure, that it is non-nil on error" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4603 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4604 |
"/ maxLen := 60. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4605 |
|
3674 | 4606 |
self newLabel:'updating ...'. |
4607 |
||
4608 |
(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
|
4609 |
^ self class readXMLChangesFromFile:changeFileName inBackground:inBackground |
3674 | 4610 |
]. |
4611 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4612 |
f := changeFileName asFilename. |
7346 | 4613 |
f exists ifFalse:[^ self]. |
12635 | 4614 |
inStream := EncodedStream decodedStreamFor:(f readStream). |
5696 | 4615 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4616 |
i := f info. |
3965
e499c0dae8fc
use #fileSize instead of #size
Claus Gittinger <cg@exept.de>
parents:
3962
diff
changeset
|
4617 |
changeFileSize := i fileSize. |
3962
3906b10c42fd
modified -> modificationTime
Claus Gittinger <cg@exept.de>
parents:
3930
diff
changeset
|
4618 |
changeFileTimestamp := i modificationTime. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4619 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4620 |
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
|
4621 |
" |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4622 |
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
|
4623 |
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
|
4624 |
" |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4625 |
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
|
4626 |
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
|
4627 |
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
|
4628 |
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
|
4629 |
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
|
4630 |
]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4631 |
|
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4632 |
[ |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4633 |
|reader| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4634 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4635 |
reader := ChangeFileReader new. |
6516
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
4636 |
reader changeFileName:changeFileName. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4637 |
reader browser:self. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4638 |
reader enforcedNameSpace:enforcedNameSpace. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4639 |
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
|
4640 |
reader autoloadAsRequired:autoloadAsRequired. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4641 |
reader tabSpec:tabSpec. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4642 |
reader inStream:inStream. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4643 |
reader noColoring:(NoColoring == true). |
16467 | 4644 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4645 |
reader readChangesFile. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4646 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4647 |
editingClassSource := reader thisIsAClassSource. |
16372 | 4648 |
changeInfoList := reader changeInfo. |
16467 | 4649 |
|
4650 |
self showNumberOfChanges. |
|
7360 | 4651 |
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
|
4652 |
] 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
|
4653 |
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
|
4654 |
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
|
4655 |
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
|
4656 |
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
|
4657 |
]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4658 |
]. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4659 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4660 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4661 |
self checkIfFileHasChanged |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4662 |
|
7360 | 4663 |
"Modified: / 27-08-1995 / 23:06:55 / claus" |
16372 | 4664 |
"Modified: / 01-05-2016 / 19:13:09 / cg" |
17953 | 4665 |
"Modified (comment): / 22-01-2018 / 18:53:40 / stefan" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4666 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4667 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4668 |
writeBackChanges |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4669 |
"write back the changes file. To avoid problems when the disk is full |
6288 | 4670 |
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
|
4671 |
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
|
4672 |
rename the old change-file to a .bak file and finally rename the |
6288 | 4673 |
tempfile back to the change-file. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4674 |
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
|
4675 |
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
|
4676 |
|
15858 | 4677 |
|inFilename inStream outStream stamp encoding tempFilename| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4678 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4679 |
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
|
4680 |
(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
|
4681 |
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
|
4682 |
^ 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
|
4683 |
] |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4684 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4685 |
|
13123 | 4686 |
inFilename := changeFileName asFilename. |
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
|
4687 |
[ |
13123 | 4688 |
inStream := inFilename readStream. |
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
|
4689 |
] 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
|
4690 |
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
|
4691 |
^ 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
|
4692 |
]. |
9020 | 4693 |
[ |
4694 |
[ |
|
13123 | 4695 |
outStream := FileStream newTemporaryIn:inFilename directory. |
4696 |
tempFilename := outStream fileName. |
|
9020 | 4697 |
] on:FileStream openErrorSignal do:[:ex| |
4698 |
self warn:'Cannot create temp file in current directory.'. |
|
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
|
4699 |
^ false |
9020 | 4700 |
]. |
4701 |
||
11234 | 4702 |
outStream nextPutLine:'''---- encoding: utf8 ----''!!'. |
9020 | 4703 |
outStream := EncodedStream stream:outStream encoder:(CharacterEncoder encoderForUTF8). |
4704 |
||
4705 |
encoding := CharacterEncoder guessEncodingOfStream:inStream. |
|
4706 |
encoding notNil ifTrue:[ |
|
15858 | 4707 |
inStream := EncodedStream stream:inStream encoding:encoding. |
9020 | 4708 |
]. |
4709 |
||
11685 | 4710 |
self withWriteCursorDo:[ |
9020 | 4711 |
|excla sawExcla done first chunk |
4712 |
nChanges "{Class:SmallInteger}" | |
|
4713 |
||
4714 |
Stream writeErrorSignal handle:[:ex | |
|
4715 |
self warn:('Could not update the changes file.\\' , ex description) withCRs. |
|
13123 | 4716 |
outStream close. |
4717 |
tempFilename remove. |
|
9020 | 4718 |
^ false |
4719 |
] do:[ |
|
4720 |
excla := inStream class chunkSeparator. |
|
4721 |
nChanges := self numberOfChanges. |
|
4722 |
||
4723 |
1 to:nChanges do:[:index | |
|
16372 | 4724 |
inStream position:((changeInfoList at:index) position)-1. |
9020 | 4725 |
sawExcla := inStream peekFor:excla. |
4726 |
chunk := inStream nextChunk. |
|
4727 |
||
4728 |
(chunk notNil |
|
4729 |
and:[(chunk startsWith:'''---- snap') not]) ifTrue:[ |
|
16372 | 4730 |
(stamp := (changeInfoList at:index) timestamp) notNil ifTrue:[ |
9020 | 4731 |
outStream nextPutAll:'''---- timestamp ' , stamp , ' ----'''. |
4732 |
outStream nextPut:excla; cr. |
|
4733 |
]. |
|
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
|
4734 |
]. |
9020 | 4735 |
|
4736 |
sawExcla ifTrue:[ |
|
4737 |
outStream nextPut:excla. |
|
4738 |
outStream nextChunkPut:chunk. |
|
4739 |
outStream cr; cr. |
|
4740 |
" |
|
4741 |
a method-definition chunk - output followups |
|
4742 |
" |
|
4743 |
done := false. |
|
4744 |
first := true. |
|
4745 |
[done] whileFalse:[ |
|
4746 |
chunk := inStream nextChunk. |
|
4747 |
chunk isNil ifTrue:[ |
|
4748 |
outStream cr; cr. |
|
4749 |
done := true |
|
4750 |
] ifFalse:[ |
|
4751 |
chunk isEmpty ifTrue:[ |
|
4752 |
outStream space; nextChunkPut:chunk; cr; cr. |
|
4753 |
done := true. |
|
4754 |
] ifFalse:[ |
|
4755 |
first ifFalse:[ |
|
4756 |
outStream cr; cr. |
|
4757 |
]. |
|
4758 |
outStream nextChunkPut:chunk. |
|
4759 |
]. |
|
4760 |
]. |
|
4761 |
first := false. |
|
4762 |
]. |
|
4763 |
] ifFalse:[ |
|
4764 |
outStream nextChunkPut:chunk. |
|
4765 |
outStream cr |
|
4766 |
] |
|
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
|
4767 |
]. |
9020 | 4768 |
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
|
4769 |
]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4770 |
inStream close. |
9020 | 4771 |
|
17376 | 4772 |
inFilename renameTo:inFilename asBackupFilename. |
13123 | 4773 |
tempFilename renameTo:changeFileName. |
9020 | 4774 |
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
|
4775 |
]. |
9020 | 4776 |
] ensure:[ |
4777 |
inStream close. |
|
4778 |
]. |
|
4779 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4780 |
^ true |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4781 |
|
16372 | 4782 |
"Modified: / 01-05-2016 / 19:30:34 / cg" |
17376 | 4783 |
"Modified: / 09-02-2017 / 13:30:57 / stefan" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4784 |
! ! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4785 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4786 |
!ChangesBrowser methodsFor:'private-user interaction ops'! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4787 |
|
5735 | 4788 |
appendChange:changeNr toFile:aFileNameOrFileNameString |
202 | 4789 |
"append change to a file. return true if ok." |
4790 |
||
5735 | 4791 |
|fileName changeInStream outStream chunk chunk2 sawExcla separator encoding| |
4792 |
||
4793 |
changeInStream := self streamForChange:changeNr. |
|
4794 |
changeInStream isNil ifTrue:[ |
|
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4795 |
self warn:'Cannot read change'. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4796 |
^ false |
2394
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
4797 |
]. |
5735 | 4798 |
changeInStream skipSeparators. |
4799 |
||
4800 |
separator := changeInStream class chunkSeparator. |
|
2394
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
4801 |
|
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
4802 |
(self changeIsFollowupMethodChange:changeNr) ifTrue:[ |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4803 |
sawExcla := true. |
16372 | 4804 |
chunk := self changeChunkAt:changeNr. |
2394
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
4805 |
] ifFalse:[ |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4806 |
sawExcla := changeInStream peekFor:separator. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4807 |
chunk := changeInStream nextChunk. |
3991 | 4808 |
]. |
4809 |
chunk withoutSeparators isEmpty ifTrue:[ |
|
18152 | 4810 |
self proceedableError:'Empty chunk - should not happen'. |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4811 |
^ false. |
5735 | 4812 |
]. |
4813 |
||
4814 |
fileName := aFileNameOrFileNameString asFilename. |
|
202 | 4815 |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
4816 |
[ |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4817 |
outStream := fileName readWriteStream. |
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
4818 |
] on:FileStream openErrorSignal do:[:ex| |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4819 |
self warn:'Cannot update file: ''%1''' with:fileName. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4820 |
^ false |
73 | 4821 |
]. |
202 | 4822 |
|
11476
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4823 |
outStream fileSize = 0 ifTrue:[ |
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4824 |
encoding := #utf8. |
15090 | 4825 |
outStream nextPutLine:'"{ Encoding: utf8 }" !!'. |
11476
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4826 |
] ifFalse:[ |
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4827 |
encoding := CharacterEncoder guessEncodingOfStream:outStream. |
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4828 |
]. |
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4829 |
|
5735 | 4830 |
encoding notNil ifTrue:[ |
15858 | 4831 |
outStream := EncodedStream stream:outStream encoding:encoding. |
11476
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4832 |
]. |
202 | 4833 |
outStream setToEnd. |
4834 |
||
4835 |
sawExcla ifTrue:[ |
|
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4836 |
outStream nextPut:separator |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4837 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4838 |
outStream nextChunkPut:chunk; cr. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4839 |
sawExcla ifTrue:[ |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4840 |
chunk2 := changeInStream nextChunk. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4841 |
chunk2 withoutSeparators isEmpty ifTrue:[ |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4842 |
self error:'Empty chunk - should not happen'. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4843 |
]. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4844 |
outStream nextChunkPut:chunk2; space |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4845 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4846 |
sawExcla ifTrue:[ |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4847 |
outStream nextPut:separator |
202 | 4848 |
]. |
4849 |
outStream cr. |
|
5735 | 4850 |
|
4851 |
changeInStream close. |
|
202 | 4852 |
outStream close. |
4853 |
^ true |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4854 |
|
16372 | 4855 |
"Modified: / 01-05-2016 / 18:25:00 / cg" |
18152 | 4856 |
"Modified: / 24-05-2018 / 14:54:56 / Claus Gittinger" |
73 | 4857 |
! |
4858 |
||
51 | 4859 |
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
|
4860 |
"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
|
4861 |
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
|
4862 |
|
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
4863 |
|aStream applyAction nameSpace className changeClass ownerName ownerClass reader doItChunk methodsForChunk pkg |
4877 | 4864 |
alternativeClass shortName orgClassName nsClass aborted| |
45 | 4865 |
|
51 | 4866 |
aStream := self streamForChange:changeNr. |
12973 | 4867 |
aStream isNil ifTrue:[^ false]. |
51 | 4868 |
|
2965 | 4869 |
className := self classNameOfChange:changeNr. |
4870 |
className notNil ifTrue:[ |
|
6378 | 4871 |
className := className asSymbol. |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
4872 |
enforcedNameSpace notNil ifTrue:[ |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
4873 |
changeClass := enforcedNameSpace at:className ifAbsent:nil. |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
4874 |
] ifFalse:[ |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
4875 |
changeClass := Smalltalk at:className ifAbsent:nil. |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
4876 |
]. |
6378 | 4877 |
changeClass isNil ifTrue:[ |
4878 |
changeClass := self classOfChange:changeNr. |
|
4879 |
]. |
|
8351
e99a28a6288b
changed #applyChange: load class before applying a change
Stefan Vogel <sv@exept.de>
parents:
8320
diff
changeset
|
4880 |
changeClass notNil ifTrue:[ |
e99a28a6288b
changed #applyChange: load class before applying a change
Stefan Vogel <sv@exept.de>
parents:
8320
diff
changeset
|
4881 |
"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
|
4882 |
will create a class without methods" |
e99a28a6288b
changed #applyChange: load class before applying a change
Stefan Vogel <sv@exept.de>
parents:
8320
diff
changeset
|
4883 |
changeClass autoload. |
e99a28a6288b
changed #applyChange: load class before applying a change
Stefan Vogel <sv@exept.de>
parents:
8320
diff
changeset
|
4884 |
]. |
51 | 4885 |
]. |
45 | 4886 |
|
51 | 4887 |
changeNrProcessed := changeNr. |
4877 | 4888 |
aborted := false. |
45 | 4889 |
|
6288 | 4890 |
applyAction := |
6378 | 4891 |
[ |
7783
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
4892 |
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
|
4893 |
"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
|
4894 |
Send AbortAllOperationRequest to abort multiple operations" |
6378 | 4895 |
aborted := true. |
4896 |
ex return. |
|
4897 |
] do:[ |
|
4898 |
nameSpace := self nameSpaceForApply. |
|
4899 |
||
4900 |
pkg := enforcedPackage ? Class packageQuerySignal query. |
|
4901 |
Class packageQuerySignal answer:pkg |
|
4902 |
do:[ |
|
4903 |
Class nameSpaceQuerySignal answer:nameSpace |
|
4904 |
do:[ |
|
11244 | 4905 |
Class defaultApplicationQuerySignal handle:[:ex | |
4906 |
ex proceedWith:defaultApplicationForVAGEClasses |
|
4907 |
] do:[ |
|
4908 |
Class changeDefaultApplicationNotificationSignal handle:[:ex | |
|
4909 |
defaultApplicationForVAGEClasses := ex parameter. |
|
4910 |
] do:[ |
|
17899 | 4911 |
|skip| |
4912 |
||
4913 |
skip := false. |
|
11244 | 4914 |
|
4915 |
"/ a followup methodsFor: chunk ... |
|
4916 |
(self changeIsFollowupMethodChange:changeNr) ifTrue:[ |
|
16372 | 4917 |
methodsForChunk := self changeChunkAt:changeNr. |
11244 | 4918 |
] ifFalse:[ |
4919 |
doItChunk := aStream nextChunk. "/ an empty chunk sometimes ... |
|
4920 |
doItChunk notEmpty ifTrue:[ |
|
4921 |
doItChunk first = (Character value:16rFEFF) ifTrue:[ |
|
4922 |
doItChunk := doItChunk copyFrom:2. |
|
4923 |
]. |
|
4924 |
Compiler evaluate:doItChunk notifying:self. |
|
6378 | 4925 |
] ifFalse:[ |
11244 | 4926 |
methodsForChunk := aStream nextChunk. "/ the real one |
6378 | 4927 |
] |
4928 |
]. |
|
11244 | 4929 |
methodsForChunk notNil ifTrue:[ |
4930 |
changeClass isNil ifTrue:[ |
|
4931 |
orgClassName := className. |
|
4932 |
||
4933 |
(className includes:$:) ifTrue:[ |
|
4934 |
ownerName := className copyTo:(className lastIndexOf:$:) - 1. |
|
4935 |
(ownerName endsWith:$:) ifTrue:[ |
|
12704
6f20f7d39e75
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12656
diff
changeset
|
4936 |
ownerName := ownerName copyButLast:1. |
11244 | 4937 |
]. |
4938 |
||
4939 |
ownerClass := Smalltalk at:(ownerName asSymbol) ifAbsent:[]. |
|
4940 |
ownerClass notNil ifTrue:[ |
|
4941 |
ownerClass autoload |
|
4942 |
]. |
|
4943 |
]. |
|
4944 |
(nameSpace notNil and:[nameSpace ~~ Smalltalk]) ifTrue:[ |
|
4945 |
changeClass := nameSpace at:className ifAbsent:[]. |
|
4946 |
]. |
|
4947 |
changeClass isNil ifTrue:[ |
|
4948 |
changeClass := Smalltalk at:className ifAbsent:[]. |
|
4949 |
]. |
|
4950 |
[changeClass isNil] whileTrue:[ |
|
4951 |
(NameSpace allNameSpaces |
|
15683 | 4952 |
contains:[:ns | (nsClass := (ns at:className asSymbol)) notNil]) |
11244 | 4953 |
ifTrue:[ |
4954 |
shortName := nsClass name. |
|
4955 |
] ifFalse:[ |
|
4956 |
shortName := className copyFrom:(className lastIndexOf:$:) + 1. |
|
4957 |
shortName = className ifTrue:[ |
|
4958 |
shortName := '' |
|
4959 |
]. |
|
4960 |
]. |
|
17899 | 4961 |
|
4962 |
skip := false. |
|
4963 |
||
4964 |
Dialog modifyingBoxWith:[:box | |
|
18054 | 4965 |
"/ self halt. |
17899 | 4966 |
box |
4967 |
addButton:(Button label:'Skip' action:[skip := true. box hide]) |
|
4968 |
after:box noButton |
|
4969 |
] do:[ |
|
4970 |
className := Dialog |
|
12973 | 4971 |
request:'No class ''' , className , ''' for change. Add to which class? (enter empty string to skip this change)' |
11244 | 4972 |
initialAnswer:shortName. |
4973 |
]. |
|
17899 | 4974 |
skip ifFalse:[ |
4975 |
className isNil ifTrue:[ |
|
4976 |
AbortAllOperationRequest raise. |
|
4977 |
]. |
|
4978 |
className isEmpty ifTrue:[ |
|
4979 |
^ false |
|
4980 |
]. |
|
4981 |
alternativeClass := Smalltalk classNamed:className. |
|
4982 |
alternativeClass notNil ifTrue:[ |
|
4983 |
changeClass := alternativeClass |
|
4984 |
] |
|
4985 |
]. |
|
11244 | 4986 |
]. |
17899 | 4987 |
skip ifFalse:[ |
4988 |
methodsForChunk := methodsForChunk copyFrom:(methodsForChunk indexOfSeparator). |
|
4989 |
methodsForChunk := changeClass name , methodsForChunk. |
|
4990 |
]. |
|
11244 | 4991 |
]. |
17899 | 4992 |
skip ifFalse:[ |
4993 |
reader := Compiler evaluate:methodsForChunk notifying:self. |
|
4994 |
reader fileInFrom:aStream notifying:self passChunk:false single:true. |
|
4995 |
] |
|
11244 | 4996 |
] |
4997 |
] |
|
6378 | 4998 |
] |
4999 |
] |
|
5000 |
] |
|
5001 |
]. |
|
5002 |
changeNrProcessed := nil. |
|
5003 |
]. |
|
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
5004 |
|
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
5005 |
"/ |
17026 | 5006 |
"/ if I am showing the changes file, don't update it |
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
5007 |
"/ |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
5008 |
changeFileName = ObjectMemory nameForChanges ifTrue:[ |
6378 | 5009 |
Class withoutUpdatingChangesDo:[ |
5010 |
Class updateChangeListQuerySignal answer:updateChangeSet value do:applyAction |
|
5011 |
] |
|
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
5012 |
] ifFalse:[ |
6378 | 5013 |
applyAction value |
45 | 5014 |
]. |
4877 | 5015 |
aStream close. |
5016 |
||
5017 |
^ aborted not |
|
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
5018 |
|
16372 | 5019 |
"Modified: / 01-05-2016 / 18:25:18 / cg" |
45 | 5020 |
! |
5021 |
||
7953 | 5022 |
compareCategoryChange:parseTree |
9888 | 5023 |
|receiverExpression method thisClass| |
7953 | 5024 |
|
5025 |
receiverExpression := parseTree receiver. |
|
5026 |
receiverExpression isMessage ifTrue:[ |
|
5027 |
receiverExpression selector == #compiledMethodAt: ifTrue:[ |
|
9888 | 5028 |
[ |
5029 |
thisClass := receiverExpression receiver evaluate. |
|
5030 |
] on:Parser undefinedVariableError do:[:ex| ]. |
|
5031 |
||
5032 |
(thisClass isBehavior |
|
7953 | 5033 |
and:[(method := receiverExpression evaluate) isMethod]) ifTrue:[ |
5034 |
method category = parseTree arg1 evaluate ifTrue:[ |
|
5035 |
^ true -> 'Change has no effect\\(same category)'. |
|
5036 |
] ifFalse:[ |
|
8173 | 5037 |
^ false -> ('Category is different (''' , method category , ''' vs. ''' , parseTree arg1 evaluate , ''')'). |
7953 | 5038 |
] |
5039 |
] ifFalse:[ |
|
5040 |
^ nil -> 'There is no such method'. |
|
5041 |
] |
|
5042 |
] |
|
5043 |
]. |
|
5044 |
^ nil -> 'Unhandled receiver' |
|
5045 |
! |
|
5046 |
||
255 | 5047 |
compareChange:changeNr |
18059 | 5048 |
"compare a change with the current (in-image) version; |
5049 |
show the result of the compare (as dialog)" |
|
2835 | 5050 |
|
5051 |
^ self compareChange:changeNr showResult:true |
|
5052 |
! |
|
5053 |
||
5054 |
compareChange:changeNr showResult:doShowResult |
|
5055 |
"compare a change with current version. |
|
18059 | 5056 |
Return the result of the compare |
5057 |
same -> true, |
|
5058 |
different -> false, |
|
5059 |
uncomparable -> nil. |
|
2835 | 5060 |
If doShowResult is true, the outcome is shown in a dialog/diffViewer." |
255 | 5061 |
|
15016 | 5062 |
|aStream chunk sawExcla parseTree thisClass cat oldSource newSource outcome showDiff d selector isLoaded beep superClass thisClassSym varsHere varsInChange addedVars removedVars |
9888 | 5063 |
isSame ownerClass superClassHere superClassInChange sameAndOutcome| |
255 | 5064 |
|
5065 |
aStream := self streamForChange:changeNr. |
|
2835 | 5066 |
aStream isNil ifTrue:[^ nil]. |
255 | 5067 |
|
275
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
5068 |
showDiff := false. |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
5069 |
|
1472 | 5070 |
(self changeIsFollowupMethodChange:changeNr) ifFalse:[ |
6357 | 5071 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
5072 |
chunk := aStream nextChunk. |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
5073 |
] ifTrue:[ |
16372 | 5074 |
chunk := self changeChunkAt:changeNr. |
6357 | 5075 |
sawExcla := true. |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
5076 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
5077 |
|
2835 | 5078 |
isSame := nil. |
5079 |
||
761 | 5080 |
beep := false. |
255 | 5081 |
sawExcla ifFalse:[ |
6357 | 5082 |
outcome := 'cannot compare this change\\(i.e. this is not a method change).'. |
5083 |
||
5084 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
|
5085 |
do:[ |
|
8665 | 5086 |
parseTree := self parseExpression:chunk. |
6357 | 5087 |
]. |
5088 |
(parseTree notNil and:[parseTree ~~ #Error and:[ parseTree isMessage ]]) ifTrue:[ |
|
5089 |
selector := parseTree selector. |
|
5090 |
||
5091 |
selector == #'removeSelector:' ifTrue:[ |
|
7953 | 5092 |
sameAndOutcome := self compareRemoveSelectorChange:parseTree. |
5093 |
isSame := sameAndOutcome key. |
|
5094 |
outcome := sameAndOutcome value. |
|
5095 |
]. |
|
5096 |
selector == #'package:' ifTrue:[ |
|
5097 |
sameAndOutcome := self comparePackageChange:parseTree. |
|
5098 |
isSame := sameAndOutcome key. |
|
5099 |
outcome := sameAndOutcome value. |
|
6357 | 5100 |
]. |
5101 |
selector == #'category:' ifTrue:[ |
|
7953 | 5102 |
sameAndOutcome := self compareCategoryChange:parseTree. |
5103 |
isSame := sameAndOutcome key. |
|
5104 |
outcome := sameAndOutcome value. |
|
6357 | 5105 |
]. |
5106 |
selector == #'comment:' ifTrue:[ |
|
7953 | 5107 |
sameAndOutcome := self compareCommentChange:parseTree. |
5108 |
isSame := sameAndOutcome key. |
|
5109 |
outcome := sameAndOutcome value. |
|
6357 | 5110 |
]. |
5111 |
||
5112 |
selector == #'instanceVariableNames:' ifTrue:[ |
|
7953 | 5113 |
sameAndOutcome := self compareInstanceVariableNamesChange:parseTree. |
5114 |
isSame := sameAndOutcome key. |
|
5115 |
outcome := sameAndOutcome value. |
|
6357 | 5116 |
]. |
5117 |
||
5118 |
(Class definitionSelectors includes:selector) |
|
5119 |
"/ selector == #'subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:' |
|
5120 |
ifTrue:[ |
|
9888 | 5121 |
[ |
5122 |
superClass := parseTree receiver evaluate. |
|
5123 |
] on:Parser undefinedVariableError do:[:ex| ]. |
|
6357 | 5124 |
superClass isBehavior ifFalse:[ |
5125 |
outcome := 'Cannot compare this change\\(superclass not loaded).'. |
|
5126 |
isSame := nil. |
|
5127 |
] ifTrue:[ |
|
5128 |
(self checkClassIsLoaded:superClass) ifTrue:[ |
|
5129 |
thisClassSym := (parseTree arguments at:1) evaluate. |
|
5130 |
||
5131 |
(selector endsWith:':privateIn:') ifTrue:[ |
|
11475
b6fdfe902263
changed: #compareChange:showResult:
Stefan Vogel <sv@exept.de>
parents:
11397
diff
changeset
|
5132 |
Parser undefinedVariableError catch:[ |
b6fdfe902263
changed: #compareChange:showResult:
Stefan Vogel <sv@exept.de>
parents:
11397
diff
changeset
|
5133 |
ownerClass := (parseTree arguments at:5) evaluate. |
b6fdfe902263
changed: #compareChange:showResult:
Stefan Vogel <sv@exept.de>
parents:
11397
diff
changeset
|
5134 |
ownerClass isBehavior ifTrue:[ |
b6fdfe902263
changed: #compareChange:showResult:
Stefan Vogel <sv@exept.de>
parents:
11397
diff
changeset
|
5135 |
thisClass := ownerClass privateClassesAt:thisClassSym. |
b6fdfe902263
changed: #compareChange:showResult:
Stefan Vogel <sv@exept.de>
parents:
11397
diff
changeset
|
5136 |
]. |
6357 | 5137 |
]. |
5138 |
] ifFalse:[ |
|
5139 |
thisClass := (self nameSpaceForApply) at:thisClassSym ifAbsent:nil. |
|
5140 |
]. |
|
5141 |
thisClass isNil ifTrue:[ |
|
5142 |
outcome := 'Change defines the class: ' , thisClassSym allBold. |
|
5143 |
isSame := false. |
|
5144 |
] ifFalse:[ |
|
5145 |
(isLoaded := self checkClassIsLoaded:thisClass) ifFalse:[ |
|
5146 |
outcome := 'Cannot compare this change\\(compare requires class to be loaded).'. |
|
5147 |
isSame := nil. |
|
5148 |
] ifTrue:[ |
|
5149 |
superClassHere := thisClass superclass name. |
|
5150 |
superClassInChange := parseTree receiver name. |
|
5151 |
superClassHere ~~ superClassInChange ifTrue:[ |
|
5152 |
outcome := 'Superclass is different.'. |
|
5153 |
isSame := false. |
|
5154 |
] ifFalse:[ |
|
5155 |
varsHere := thisClass instanceVariableString asCollectionOfWords. |
|
5156 |
varsInChange := (parseTree arguments at:2) evaluate asCollectionOfWords. |
|
5157 |
varsHere = varsInChange ifTrue:[ |
|
5158 |
thisClass classVariableString asCollectionOfWords = (parseTree arguments at:3) evaluate asCollectionOfWords ifTrue:[ |
|
9689
72819fbf329a
changed: #compareChange:showResult:
Claus Gittinger <cg@exept.de>
parents:
9621
diff
changeset
|
5159 |
((thisClass sharedPoolNames size == 0) and:[(parseTree arguments at:4) evaluate = '']) ifTrue:[ |
6357 | 5160 |
((selector endsWith:':category:') |
5161 |
and:[thisClass category ~= (parseTree arguments at:5) evaluate]) ifTrue:[ |
|
5162 |
outcome := 'Category is different'. |
|
5163 |
isSame := false. |
|
5164 |
] ifFalse:[ |
|
5165 |
outcome := 'Change has no effect\\(same definition)'. |
|
5166 |
isSame := true. |
|
5167 |
] |
|
4296
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5168 |
"/ thisClass category = (parseTree arguments at:5) evaluate ifTrue:[ |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5169 |
"/ outcome := 'Change has no effect\\(same definition)'. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5170 |
"/ isSame := true. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5171 |
"/ ] ifFalse:[ |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5172 |
"/ outcome := 'Category is different'. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5173 |
"/ isSame := false. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5174 |
"/ ] |
6357 | 5175 |
] ifFalse:[ |
5176 |
outcome := 'SharedPool definition is different'. |
|
5177 |
isSame := false. |
|
5178 |
]. |
|
5179 |
] ifFalse:[ |
|
5180 |
outcome := 'ClassVariable definition is different'. |
|
5181 |
isSame := false. |
|
5182 |
] |
|
5183 |
] ifFalse:[ |
|
5184 |
outcome := 'InstanceVariable definition is different'. |
|
5185 |
isSame := false. |
|
12825 | 5186 |
addedVars := varsInChange reject:[:eachVar | (varsHere includes:eachVar)]. |
5187 |
removedVars := varsHere reject:[:eachVar | (varsInChange includes:eachVar)]. |
|
6357 | 5188 |
addedVars isEmpty ifTrue:[ |
5189 |
removedVars isEmpty ifTrue:[ |
|
5190 |
outcome := 'Change reorders instanceVariable(s)'. |
|
5191 |
] ifFalse:[ |
|
5192 |
removedVars := removedVars collect:[:eachVar | '''' , eachVar , '''']. |
|
5193 |
outcome := 'Change removes instanceVariable(s): ' , (removedVars asStringWith:Character space) allBold. |
|
5194 |
] |
|
5195 |
] ifFalse:[ |
|
5196 |
removedVars isEmpty ifTrue:[ |
|
5197 |
addedVars := addedVars collect:[:eachVar | '''' , eachVar , '''']. |
|
5198 |
outcome := 'Change adds instanceVariable(s): ' , (addedVars asStringWith:Character space) allBold. |
|
5199 |
]. |
|
5200 |
]. |
|
5201 |
] |
|
5202 |
] |
|
5203 |
] |
|
5204 |
] |
|
5205 |
] |
|
5206 |
] |
|
5207 |
] |
|
5208 |
] |
|
255 | 5209 |
] ifTrue:[ |
15016 | 5210 |
Class nameSpaceQuerySignal |
5211 |
answer:(self nameSpaceForApply) |
|
5212 |
do:[ |
|
5213 |
parseTree := self parseExpression:chunk. |
|
5214 |
]. |
|
5215 |
||
6357 | 5216 |
(parseTree notNil |
5217 |
and:[parseTree ~~ #Error |
|
5218 |
and:[parseTree isMessage]]) ifTrue:[ |
|
5219 |
"/ Squeak support (#methodsFor:***) |
|
5220 |
(#( |
|
5221 |
#methodsFor: |
|
5222 |
#privateMethodsFor: |
|
5223 |
#publicMethodsFor: |
|
5224 |
#ignoredMethodsFor: |
|
5225 |
#protectedMethodsFor: |
|
5226 |
||
5227 |
#methodsFor:stamp: "/ Squeak support |
|
5228 |
#methodsFor "/ Dolphin support |
|
5229 |
#methods "/ STV support |
|
5230 |
) |
|
5231 |
includes:parseTree selector) ifTrue:[ |
|
9888 | 5232 |
[ |
5233 |
thisClass := parseTree receiver evaluate. |
|
5234 |
] on:Parser undefinedVariableError do:[:ex| |
|
5235 |
outcome := 'Cannot compare this change\\(compare requires class to be loaded).'. |
|
5236 |
isSame := nil. |
|
5237 |
]. |
|
5238 |
thisClass notNil ifTrue:[ |
|
5239 |
(thisClass isKindOf:UndefinedVariable) ifTrue:[ |
|
6357 | 5240 |
|thisName path| |
5241 |
||
5242 |
thisName := thisClass name. |
|
5243 |
path := thisName asCollectionOfSubstringsSeparatedByAll:'::'. |
|
5244 |
1 to:path size do:[:length | |
|
5245 |
|ownerName owner| |
|
5246 |
||
5247 |
ownerName := (path copyTo:length) asStringCollection asStringWith:'::'. |
|
6820
4e8815b9e661
Do not autoload class when comparing changes.
Stefan Vogel <sv@exept.de>
parents:
6682
diff
changeset
|
5248 |
owner := Smalltalk loadedClassNamed:ownerName. |
6357 | 5249 |
(owner notNil and:[owner isBehavior and:[owner isLoaded not]]) ifTrue:[ |
5250 |
self checkClassIsLoaded:owner. |
|
5251 |
]. |
|
5252 |
]. |
|
9888 | 5253 |
thisClass := parseTree receiver evaluate. |
6357 | 5254 |
]. |
5255 |
||
5256 |
thisClass isBehavior ifTrue:[ |
|
5257 |
parseTree selector == #methodsFor ifTrue:[ |
|
5258 |
cat := 'Dolphin methods'. |
|
5259 |
] ifFalse:[ |
|
5260 |
parseTree selector == #methods ifTrue:[ |
|
5261 |
cat := 'STV methods'. |
|
5262 |
] ifFalse:[ |
|
5263 |
cat := parseTree arg1 evaluate. |
|
5264 |
]. |
|
5265 |
]. |
|
5266 |
newSource := aStream nextChunk. |
|
5267 |
||
15016 | 5268 |
isSame := self |
5269 |
compareMethodSource:newSource |
|
5270 |
withVersionInClass:thisClass |
|
5271 |
into:[:outcomeResult :beepResult :oldSourceResult| |
|
5272 |
outcome := outcomeResult. |
|
5273 |
beep := beepResult. |
|
5274 |
oldSource := oldSourceResult. |
|
5275 |
]. |
|
5276 |
||
5277 |
isSame isNil ifTrue:[ |
|
5278 |
showDiff := false. |
|
5279 |
] ifFalse:[ |
|
5280 |
showDiff := isSame not. |
|
6357 | 5281 |
]. |
15016 | 5282 |
|
6357 | 5283 |
doShowResult ifTrue:[ |
5284 |
(showDiff and:[oldSource notNil and:[newSource notNil]]) ifTrue:[ |
|
8102 | 5285 |
d := DiffCodeView |
6639 | 5286 |
openOn:oldSource label:(resources string:'Current version (in image)') |
5287 |
and:newSource label:(resources string:'Change version'). |
|
6357 | 5288 |
d label:'method differences'. |
5289 |
] |
|
5290 |
] |
|
5291 |
] ifFalse:[ |
|
5292 |
beep := true. |
|
5293 |
outcome := 'Class does not exist.'. |
|
5294 |
isSame := nil. |
|
5295 |
] |
|
9888 | 5296 |
]] ifFalse:[ |
6357 | 5297 |
beep := true. |
5298 |
outcome := 'Not comparable.'. |
|
5299 |
isSame := nil. |
|
5300 |
] |
|
5301 |
] ifFalse:[ |
|
5302 |
beep := true. |
|
5303 |
outcome := 'Not comparable.'. |
|
5304 |
isSame := nil. |
|
5305 |
] |
|
255 | 5306 |
]. |
5307 |
aStream close. |
|
2835 | 5308 |
|
5309 |
doShowResult ifTrue:[ |
|
6357 | 5310 |
showDiff ifFalse:[ |
5311 |
outcome := (resources stringWithCRs:outcome). |
|
5312 |
beep ifTrue:[ |
|
5313 |
self warn:outcome. |
|
5314 |
] ifFalse:[ |
|
5315 |
self information:outcome. |
|
5316 |
] |
|
5317 |
]. |
|
255 | 5318 |
]. |
2835 | 5319 |
^ isSame. |
255 | 5320 |
|
9689
72819fbf329a
changed: #compareChange:showResult:
Claus Gittinger <cg@exept.de>
parents:
9621
diff
changeset
|
5321 |
"Created: / 24-11-1995 / 14:30:46 / cg" |
16372 | 5322 |
"Modified: / 01-05-2016 / 18:25:32 / cg" |
255 | 5323 |
! |
5324 |
||
7953 | 5325 |
compareCommentChange:parseTree |
5326 |
|thisClass| |
|
5327 |
||
9888 | 5328 |
[ |
5329 |
thisClass := parseTree receiver evaluate. |
|
5330 |
] on:Parser undefinedVariableError do:[:ex| ]. |
|
5331 |
||
7953 | 5332 |
thisClass isBehavior ifTrue:[ |
5333 |
(self checkClassIsLoaded:thisClass) ifTrue:[ |
|
5334 |
(thisClass comment = parseTree arg1 evaluate) ifTrue:[ |
|
5335 |
^ true -> 'Change has no effect\\(same comment)'. |
|
5336 |
] ifFalse:[ |
|
5337 |
^ false -> 'Comment is different'. |
|
5338 |
] |
|
5339 |
] ifFalse:[ |
|
5340 |
^ nil -> 'Cannot compare this change (compare requires class to be loaded).'. |
|
5341 |
] |
|
5342 |
]. |
|
5343 |
^ nil -> 'Cannot compare this change (class not present)'. |
|
5344 |
! |
|
5345 |
||
5346 |
compareInstanceVariableNamesChange:parseTree |
|
5347 |
|receiverExpression thisClass varsHere varsInChange | |
|
5348 |
||
5349 |
receiverExpression := parseTree receiver. |
|
5350 |
receiverExpression isMessage ifTrue:[ |
|
5351 |
receiverExpression selector == #class ifTrue:[ |
|
9888 | 5352 |
[ |
5353 |
thisClass := receiverExpression evaluate. |
|
5354 |
] on:Parser undefinedVariableError do:[:ex| |
|
5355 |
^ nil -> 'Class is not loaded'. |
|
5356 |
]. |
|
5357 |
||
7953 | 5358 |
varsHere := thisClass instanceVariableString asCollectionOfWords. |
5359 |
varsInChange := (parseTree arguments at:1) evaluate asCollectionOfWords. |
|
5360 |
varsHere = varsInChange ifTrue:[ |
|
5361 |
^ true -> 'Change has no effect\\(same definition)'. |
|
5362 |
] ifFalse:[ |
|
5363 |
^ false -> 'Class-instanceVariable definition is different'. |
|
5364 |
]. |
|
5365 |
]. |
|
5366 |
]. |
|
5367 |
^ nil -> 'Unhandled receiver' |
|
5368 |
! |
|
5369 |
||
15016 | 5370 |
compareMethodSource:newSource withVersionInClass:thisClass into:aThreeArgBlock |
5371 |
"returns true/false/nil if same,different,undecided; |
|
5372 |
also provides a message and a beep-boolean via the passed in block" |
|
5373 |
||
17579 | 5374 |
<ignore: RBReturnsBooleanAndOtherRule rationale: 'done by purpose' author: 'cg'> |
5375 |
||
15016 | 5376 |
|parser sel oldMethod oldSource outcome t1 t2 isLoaded| |
5377 |
||
5378 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
|
5379 |
do:[ |
|
5380 |
parser := Parser parseMethod:newSource in:thisClass. |
|
5381 |
]. |
|
5382 |
(parser isNil or:[parser == #Error]) ifTrue:[ |
|
5383 |
outcome := 'Change is unparsable (parse error).'. |
|
5384 |
aThreeArgBlock value:outcome value:true "beep" value:nil. |
|
5385 |
^ nil. |
|
5386 |
]. |
|
5387 |
||
5388 |
sel := parser selector. |
|
5389 |
oldMethod := thisClass compiledMethodAt:sel. |
|
5390 |
oldMethod isNil ifTrue:[ |
|
5391 |
(isLoaded := self checkClassIsLoaded:thisClass) ifFalse:[ |
|
5392 |
outcome := 'Cannot compare this change\\(compare requires class to be loaded).'. |
|
5393 |
] ifTrue:[ |
|
5394 |
outcome := 'Method does not exist.'. |
|
5395 |
]. |
|
5396 |
aThreeArgBlock value:outcome value:true "beep" value:nil. |
|
5397 |
^ nil. |
|
5398 |
]. |
|
5399 |
||
5400 |
oldSource := oldMethod source. |
|
5401 |
oldSource isNil ifTrue:[ |
|
5402 |
outcome := 'No source for compare.'. |
|
5403 |
aThreeArgBlock value:outcome value:true "beep" value:nil. |
|
5404 |
^ nil. |
|
5405 |
]. |
|
5406 |
(oldSource = newSource) ifTrue:[ |
|
5407 |
outcome := 'Same source'. |
|
5408 |
aThreeArgBlock value:outcome value:false "beep" value:oldSource. |
|
5409 |
^ true. |
|
5410 |
]. |
|
5411 |
||
5412 |
"/ |
|
5413 |
"/ compare for tabulator <-> space changes |
|
5414 |
"/ before showing diff ... |
|
5415 |
"/ |
|
5416 |
t1 := oldSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
5417 |
t2 := newSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
5418 |
t1 = t2 ifTrue:[ |
|
5419 |
outcome := 'Same source'. |
|
5420 |
aThreeArgBlock value:outcome value:false "beep" value:oldSource. |
|
5421 |
^ true. |
|
5422 |
]. |
|
5423 |
||
5424 |
"/ |
|
5425 |
"/ check if only historyLine diffs |
|
5426 |
"/ |
|
5427 |
(HistoryManager notNil |
|
5428 |
and:[HistoryManager isActive]) ifTrue:[ |
|
5429 |
(HistoryManager withoutHistoryLines:newSource) |
|
5430 |
= |
|
5431 |
(HistoryManager withoutHistoryLines:oldSource) |
|
5432 |
ifTrue:[ |
|
5433 |
outcome := 'Same source (history only)'. |
|
5434 |
aThreeArgBlock value:outcome value:false "beep" value:oldSource. |
|
5435 |
^ true. |
|
5436 |
] |
|
5437 |
]. |
|
5438 |
||
5439 |
outcome := 'Source changed.'. |
|
5440 |
aThreeArgBlock value:outcome value:false "beep" value:oldSource. |
|
5441 |
^ false. |
|
17579 | 5442 |
|
5443 |
"Modified: / 16-07-2017 / 13:32:05 / cg" |
|
15016 | 5444 |
! |
5445 |
||
7953 | 5446 |
comparePackageChange:parseTree |
9888 | 5447 |
|receiverExpression method thisClass| |
7953 | 5448 |
|
5449 |
receiverExpression := parseTree receiver. |
|
5450 |
receiverExpression isMessage ifTrue:[ |
|
5451 |
receiverExpression selector == #compiledMethodAt: ifTrue:[ |
|
9888 | 5452 |
[ |
5453 |
thisClass := receiverExpression receiver evaluate. |
|
5454 |
] on:Parser undefinedVariableError do:[:ex| ]. |
|
5455 |
(thisClass isBehavior |
|
7953 | 5456 |
and:[(method := receiverExpression evaluate) isMethod]) ifTrue:[ |
5457 |
method package = parseTree arg1 evaluate ifTrue:[ |
|
5458 |
^ true -> 'Change has no effect\\(same package)'. |
|
5459 |
] ifFalse:[ |
|
8000 | 5460 |
^ false -> ('Package is different (''<1p>'' vs. ''<2p>'')' expandMacrosWith:method package with:parseTree arg1 evaluate). |
7953 | 5461 |
] |
5462 |
] ifFalse:[ |
|
5463 |
^ nil -> 'There is no such method'. |
|
5464 |
] |
|
5465 |
] |
|
5466 |
]. |
|
5467 |
^ nil -> 'Unhandled receiver' |
|
5468 |
! |
|
5469 |
||
5470 |
compareRemoveSelectorChange:parseTree |
|
5471 |
|thisClass selector| |
|
5472 |
||
9888 | 5473 |
[ |
5474 |
thisClass := parseTree receiver evaluate. |
|
5475 |
] on:Parser undefinedVariableError do:[:ex| ]. |
|
5476 |
||
7953 | 5477 |
thisClass isBehavior ifTrue:[ |
5478 |
(self checkClassIsLoaded:thisClass) ifTrue:[ |
|
5479 |
selector := (parseTree arg1 evaluate). |
|
5480 |
(thisClass includesSelector:selector) ifTrue:[ |
|
8000 | 5481 |
^ false -> ('Change removes the #' , selector , ' method from ' , thisClass name). |
7953 | 5482 |
] ifFalse:[ |
8000 | 5483 |
^ true -> ('Change has no effect\\(there is no method for #' , selector , ' in ' , thisClass name , ')'). |
7953 | 5484 |
] |
5485 |
] ifFalse:[ |
|
5486 |
^ nil -> 'Cannot compare this change (compare requires class to be loaded).'. |
|
5487 |
] |
|
5488 |
]. |
|
5489 |
^ nil -> 'Cannot compare this change (class not present)'. |
|
5490 |
! |
|
5491 |
||
1359 | 5492 |
compressForClass:aClassNameOrNil |
6288 | 5493 |
"compress the change-set; |
1359 | 5494 |
this replaces multiple method-changes by the last (i.e. the most recent) change. |
5495 |
If the class argument is nil, compress for all classes. |
|
5496 |
otherwise, only changes for that class are compressed." |
|
5497 |
||
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5498 |
self |
6288 | 5499 |
compressForClass:aClassNameOrNil selector:nil |
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5500 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5501 |
"Modified: / 19.11.2001 / 22:04:12 / cg" |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5502 |
! |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5503 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5504 |
compressForClass:aClassNameOrNil selector:selectorToCompressOrNil |
6288 | 5505 |
"compress the change-set; |
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5506 |
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
|
5507 |
If the class argument is nil, compress for all classes. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5508 |
otherwise, only changes for that class are compressed." |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5509 |
|
6288 | 5510 |
|lbl aStream searchIndex anyMore deleteSet index |
7507 | 5511 |
str snapshotProto snapshotPrefix snapshotNameIndex| |
5512 |
||
5513 |
changeFileName notNil ifTrue:[ |
|
5514 |
aStream := changeFileName asFilename readStreamOrNil. |
|
5515 |
aStream isNil ifTrue:[^ self]. |
|
5516 |
]. |
|
1359 | 5517 |
|
4762 | 5518 |
lbl := 'compressing'. |
1359 | 5519 |
aClassNameOrNil isNil ifTrue:[ |
7507 | 5520 |
selectorToCompressOrNil notNil ifTrue:[ |
5521 |
lbl := lbl , ' for ' , selectorToCompressOrNil. |
|
5522 |
] |
|
1359 | 5523 |
] ifFalse:[ |
7507 | 5524 |
selectorToCompressOrNil isNil ifTrue:[ |
5525 |
lbl := lbl , ' for ' , aClassNameOrNil. |
|
5526 |
] ifFalse:[ |
|
5527 |
lbl := lbl , ' for ' , aClassNameOrNil , '>>' , selectorToCompressOrNil. |
|
5528 |
] |
|
1359 | 5529 |
]. |
6288 | 5530 |
lbl := lbl , '...'. |
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5531 |
self newLabel:lbl. |
1359 | 5532 |
|
5533 |
CompressSnapshotInfo == true ifTrue:[ |
|
7507 | 5534 |
" |
5535 |
get a prototype snapshot record (to be independent of |
|
5536 |
the actual format .. |
|
5537 |
" |
|
16877 | 5538 |
str := WriteStream on:''. |
7507 | 5539 |
Class addChangeRecordForSnapshot:'foo' to:str. |
5540 |
snapshotProto := str contents. |
|
5541 |
snapshotPrefix := snapshotProto copyTo:10. |
|
5542 |
snapshotNameIndex := snapshotProto findString:'foo'. |
|
1359 | 5543 |
]. |
5544 |
||
5545 |
self withExecuteCursorDo:[ |
|
7507 | 5546 |
|numChanges classes selectors types excla sawExcla |
5547 |
chunk aParseTree parseTreeChunk |
|
5548 |
thisClass thisSelector codeChunk codeParser |
|
5549 |
compressThis fileName| |
|
5550 |
||
5551 |
numChanges := self numberOfChanges. |
|
5552 |
classes := Array new:numChanges. |
|
5553 |
selectors := Array new:numChanges. |
|
5554 |
types := Array new:numChanges. |
|
5555 |
||
5556 |
"starting at the end, get the change class and change selector; |
|
5557 |
collect all in classes / selectors" |
|
5558 |
||
5559 |
aStream notNil ifTrue:[ |
|
5560 |
excla := aStream class chunkSeparator. |
|
5561 |
numChanges to:1 by:-1 do:[:changeNr | |
|
16372 | 5562 |
aStream position:((changeInfoList at:changeNr) position)-1. |
7507 | 5563 |
sawExcla := aStream peekFor:excla. |
5564 |
chunk := aStream nextChunk. |
|
5565 |
sawExcla ifTrue:[ |
|
5566 |
"optimize a bit if multiple methods for same category arrive" |
|
5567 |
(chunk = parseTreeChunk) ifFalse:[ |
|
8665 | 5568 |
aParseTree := self parseExpression:chunk. |
7507 | 5569 |
parseTreeChunk := chunk |
5570 |
]. |
|
5571 |
(aParseTree notNil |
|
5572 |
and:[(aParseTree ~~ #Error) |
|
5573 |
and:[aParseTree isMessage]]) ifTrue:[ |
|
5574 |
(#( |
|
5575 |
#methodsFor: |
|
5576 |
#privateMethodsFor: |
|
5577 |
#publicMethodsFor: |
|
5578 |
#ignoredMethodsFor: |
|
5579 |
#protectedMethodsFor: |
|
5580 |
#methodsFor:stamp: "/ Squeak support |
|
5581 |
#methodsFor "/ Dolphin support |
|
5582 |
#methods "/ STV support |
|
5583 |
) |
|
5584 |
includes:aParseTree selector) ifTrue:[ |
|
5585 |
codeChunk := aStream nextChunk. |
|
9543
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5586 |
[ |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5587 |
thisClass := aParseTree receiver evaluate. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5588 |
codeParser := Parser |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5589 |
parseMethodSpecification:codeChunk |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5590 |
in:thisClass |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5591 |
ignoreErrors:true |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5592 |
ignoreWarnings:true. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5593 |
(codeParser notNil and:[codeParser ~~ #Error]) ifTrue:[ |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5594 |
selectors at:changeNr put:(codeParser selector). |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5595 |
classes at:changeNr put:thisClass. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5596 |
types at:changeNr put:#methodsFor |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5597 |
] |
18133 | 5598 |
] on:ParseError do:[:ex| |
9543
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5599 |
"ignore chunk" |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5600 |
ex return. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5601 |
]. |
7507 | 5602 |
] |
5603 |
] |
|
5604 |
] ifFalse:[ |
|
8665 | 5605 |
aParseTree := self parseExpression:chunk. |
7507 | 5606 |
parseTreeChunk := chunk. |
5607 |
(aParseTree notNil |
|
5608 |
and:[(aParseTree ~~ #Error) |
|
5609 |
and:[aParseTree isMessage]]) ifTrue:[ |
|
5610 |
(aParseTree selector == #removeSelector:) ifTrue:[ |
|
9543
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5611 |
[ |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5612 |
thisClass := aParseTree receiver evaluate. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5613 |
selectors at:changeNr put:(aParseTree arg1 value). |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5614 |
classes at:changeNr put:thisClass. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5615 |
types at:changeNr put:#removeSelector |
18133 | 5616 |
] on:ParseError do:[:ex| |
9543
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5617 |
"ignore chunk" |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5618 |
ex return. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5619 |
]. |
7507 | 5620 |
] |
5621 |
] ifFalse:[ |
|
5622 |
CompressSnapshotInfo == true ifTrue:[ |
|
5623 |
(chunk startsWith:snapshotPrefix) ifTrue:[ |
|
13314 | 5624 |
str := chunk readStream position:snapshotNameIndex-1. |
7507 | 5625 |
fileName := str upTo:(Character space). |
5626 |
" |
|
5627 |
kludge to allow use of match-check below |
|
5628 |
" |
|
5629 |
selectors at:changeNr put:snapshotPrefix. |
|
5630 |
classes at:changeNr put:fileName. |
|
5631 |
] |
|
5632 |
] |
|
5633 |
] |
|
5634 |
]. |
|
5635 |
]. |
|
5636 |
aStream close. |
|
5637 |
] ifFalse:[ |
|
5638 |
numChanges to:1 by:-1 do:[:changeNr | |
|
5639 |
|change| |
|
5640 |
||
5641 |
classes at:changeNr put:(self classOfChange:changeNr ifAbsent:[:className| nil]). |
|
5642 |
selectors at:changeNr put:(self selectorOfMethodChange:changeNr). |
|
5643 |
]. |
|
5644 |
]. |
|
5645 |
||
5646 |
"for all changes, look for another class/selector occurrence later |
|
5647 |
in the list and, if there is one, add change number to the delete set" |
|
5648 |
||
5649 |
deleteSet := OrderedCollection new. |
|
5650 |
1 to:self numberOfChanges-1 do:[:changeNr | |
|
5651 |
thisClass := classes at:changeNr. |
|
5652 |
||
5653 |
compressThis := false. |
|
5654 |
aClassNameOrNil isNil ifTrue:[ |
|
5655 |
compressThis := true |
|
5656 |
] ifFalse:[ |
|
5657 |
"/ skipping unloaded/unknown classes |
|
5658 |
thisClass isBehavior ifTrue:[ |
|
5659 |
compressThis := aClassNameOrNil = thisClass theNonMetaclass name. |
|
5660 |
] |
|
5661 |
]. |
|
5662 |
compressThis ifTrue:[ |
|
5663 |
thisSelector := selectors at:changeNr. |
|
5664 |
compressThis := (selectorToCompressOrNil isNil or:[thisSelector == selectorToCompressOrNil]). |
|
5665 |
compressThis ifTrue:[ |
|
5666 |
searchIndex := changeNr. |
|
5667 |
anyMore := true. |
|
5668 |
[anyMore] whileTrue:[ |
|
5669 |
searchIndex := classes indexOf:thisClass startingAt:(searchIndex + 1). |
|
5670 |
(searchIndex ~~ 0) ifTrue:[ |
|
5671 |
((selectors at:searchIndex) == thisSelector) ifTrue:[ |
|
5672 |
thisClass notNil ifTrue:[ |
|
5673 |
deleteSet add:changeNr. |
|
5674 |
anyMore := false |
|
5675 |
] |
|
5676 |
] |
|
5677 |
] ifFalse:[ |
|
5678 |
anyMore := false |
|
5679 |
] |
|
5680 |
]. |
|
5681 |
]. |
|
5682 |
]. |
|
5683 |
]. |
|
5684 |
||
5685 |
"finally delete what has been found" |
|
5686 |
||
5687 |
(deleteSet size > 0) ifTrue:[ |
|
18059 | 5688 |
self unselect. |
7507 | 5689 |
index := deleteSet size. |
5690 |
[index > 0] whileTrue:[ |
|
5691 |
self silentDeleteChange:(deleteSet at:index). |
|
5692 |
index := index - 1 |
|
5693 |
]. |
|
18059 | 5694 |
self updateChangeList. |
7507 | 5695 |
" |
5696 |
scroll back a bit, if we are left way behind the list |
|
5697 |
" |
|
5698 |
changeListView firstLineShown > self numberOfChanges ifTrue:[ |
|
5699 |
changeListView makeLineVisible:self numberOfChanges |
|
5700 |
]. |
|
5701 |
self clearCodeView |
|
5702 |
] |
|
1359 | 5703 |
]. |
5704 |
self newLabel:''. |
|
5705 |
||
7507 | 5706 |
"Created: / 19-11-2001 / 22:03:42 / cg" |
16372 | 5707 |
"Modified: / 01-05-2016 / 19:23:54 / cg" |
1359 | 5708 |
! |
5709 |
||
255 | 5710 |
deleteChange:changeNr |
5711 |
"delete a change" |
|
5712 |
||
5713 |
self deleteChangesFrom:changeNr to:changeNr |
|
5714 |
! |
|
5715 |
||
5716 |
deleteChangesFrom:start to:stop |
|
5717 |
"delete a range of changes" |
|
5718 |
||
18059 | 5719 |
self unselect. |
255 | 5720 |
stop to:start by:-1 do:[:changeNr | |
18059 | 5721 |
self silentDeleteInternalChange:changeNr. |
255 | 5722 |
]. |
6255 | 5723 |
changeListView removeFromIndex:start toIndex:stop. |
744
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
5724 |
|
1070
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
5725 |
"/ changeListView contentsChanged. |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
5726 |
"/ changeListView redrawFromLine:start. |
255 | 5727 |
|
744
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
5728 |
"/ self setChangeList |
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
5729 |
|
1648 | 5730 |
"Modified: / 18.5.1998 / 14:22:27 / cg" |
255 | 5731 |
! |
5732 |
||
202 | 5733 |
makeChangeAPatch:changeNr |
5734 |
"append change to patchfile" |
|
5735 |
||
5736 |
self appendChange:changeNr toFile:'patches' |
|
5737 |
! |
|
5738 |
||
5739 |
makeChangePermanent:changeNr |
|
5740 |
"rewrite the source file where change changeNr lies" |
|
5741 |
||
5742 |
self notify:'this is not yet implemented' |
|
5743 |
! |
|
5744 |
||
73 | 5745 |
silentDeleteChange:changeNr |
5746 |
"delete a change do not update changeListView" |
|
57 | 5747 |
|
73 | 5748 |
anyChanges := true. |
16372 | 5749 |
changeInfoList removeIndex:changeNr. |
5750 |
"/ changeChunks removeIndex:changeNr. |
|
5751 |
"/ changePositions size >= changeNr ifTrue:[ changePositions removeIndex:changeNr ]. |
|
5752 |
"/ changeClassNames size >= changeNr ifTrue:[ changeClassNames removeIndex:changeNr ]. |
|
5753 |
"/ changeSelectors size >= changeNr ifTrue:[ changeSelectors removeIndex:changeNr ]. |
|
5754 |
"/ changeHeaderLines size >= changeNr ifTrue:[ changeHeaderLines removeIndex:changeNr ]. |
|
5755 |
"/ changeTimeStamps size >= changeNr ifTrue:[ changeTimeStamps removeIndex:changeNr ]. |
|
5756 |
"/ changeIsFollowupMethodChange size >= changeNr ifTrue:[ changeIsFollowupMethodChange removeIndex:changeNr ]. |
|
5757 |
||
5758 |
"Modified: / 01-05-2016 / 19:20:40 / cg" |
|
45 | 5759 |
! |
5760 |
||
202 | 5761 |
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
|
5762 |
"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
|
5763 |
Return the number of deleted changes." |
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5764 |
|
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5765 |
|thisClassName index numDeleted| |
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5766 |
|
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5767 |
numDeleted := 0. |
202 | 5768 |
index := stop. |
5769 |
[index >= start] whileTrue:[ |
|
6288 | 5770 |
thisClassName := self classNameOfChange:index. |
5771 |
thisClassName = aClassName ifTrue:[ |
|
5772 |
self silentDeleteChange:index. |
|
5773 |
numDeleted := numDeleted + 1. |
|
5774 |
]. |
|
5775 |
index := index - 1 |
|
1428
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5776 |
]. |
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5777 |
^ numDeleted |
51 | 5778 |
|
45 | 5779 |
! |
5780 |
||
3607 | 5781 |
silentDeleteChangesFor:aClassName selector:selector from:start to:stop |
5782 |
"delete changes for given class/selector in a range. |
|
5783 |
Return the number of deleted changes." |
|
5784 |
||
5785 |
|thisClassName index numDeleted| |
|
5786 |
||
5787 |
numDeleted := 0. |
|
5788 |
index := stop. |
|
5789 |
[index >= start] whileTrue:[ |
|
17600 | 5790 |
thisClassName := self realClassNameOfChange:index. |
5791 |
thisClassName = aClassName ifTrue:[ |
|
5792 |
(self selectorOfMethodChange:index) == selector ifTrue:[ |
|
5793 |
self silentDeleteChange:index. |
|
5794 |
numDeleted := numDeleted + 1. |
|
5795 |
] |
|
5796 |
]. |
|
5797 |
index := index - 1 |
|
3607 | 5798 |
]. |
5799 |
^ numDeleted |
|
5800 |
! |
|
5801 |
||
2511 | 5802 |
silentDeleteChangesForClassAndPrivateClasses:aClassName from:start to:stop |
5803 |
"delete changes for a given class and its private classes in a range. |
|
5804 |
Return the number of deleted changes." |
|
5805 |
||
5806 |
|thisClassName index numDeleted| |
|
5807 |
||
5808 |
numDeleted := 0. |
|
5809 |
index := stop. |
|
5810 |
[index >= start] whileTrue:[ |
|
6288 | 5811 |
thisClassName := self ownerClassNameOfChange:index. |
5812 |
thisClassName = aClassName ifTrue:[ |
|
5813 |
self silentDeleteChange:index. |
|
5814 |
numDeleted := numDeleted + 1. |
|
5815 |
]. |
|
5816 |
index := index - 1 |
|
2511 | 5817 |
]. |
5818 |
^ numDeleted |
|
5819 |
||
5820 |
! |
|
5821 |
||
12428 | 5822 |
silentDeleteChangesForNamespace:aNamespace from:start to:stop |
5823 |
"delete changes for a given namespace in a range. |
|
5824 |
Return the number of deleted changes." |
|
5825 |
||
5826 |
|thisNamespace index numDeleted| |
|
5827 |
||
5828 |
numDeleted := 0. |
|
5829 |
index := stop. |
|
5830 |
[index >= start] whileTrue:[ |
|
5831 |
thisNamespace := self namespaceOfChange:index. |
|
5832 |
thisNamespace = aNamespace ifTrue:[ |
|
5833 |
self silentDeleteChange:index. |
|
5834 |
numDeleted := numDeleted + 1. |
|
5835 |
]. |
|
5836 |
index := index - 1 |
|
5837 |
]. |
|
5838 |
^ numDeleted |
|
5839 |
! |
|
5840 |
||
1070
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
5841 |
silentDeleteInternalChange:changeNr |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
5842 |
"delete a change do not update changeListView" |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
5843 |
|
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
5844 |
anyChanges := true. |
16372 | 5845 |
changeInfoList removeIndex:changeNr. |
5846 |
"/ changeChunks removeIndex:changeNr. |
|
5847 |
"/ changePositions size >= changeNr ifTrue:[changePositions removeIndex:changeNr]. |
|
5848 |
"/ changeClassNames size >= changeNr ifTrue:[changeClassNames removeIndex:changeNr]. |
|
5849 |
"/ changeSelectors size >= changeNr ifTrue:[ changeSelectors removeIndex:changeNr ]. |
|
5850 |
"/ changeTimeStamps size >= changeNr ifTrue:[changeTimeStamps removeIndex:changeNr]. |
|
5851 |
"/ changeIsFollowupMethodChange size >= changeNr ifTrue:[changeIsFollowupMethodChange removeIndex:changeNr]. |
|
5852 |
||
5853 |
"Created: / 07-03-1997 / 16:28:32 / cg" |
|
5854 |
"Modified: / 26-02-1998 / 18:20:48 / stefan" |
|
5855 |
"Modified: / 01-05-2016 / 19:20:59 / cg" |
|
4487 | 5856 |
! |
5857 |
||
18059 | 5858 |
silentDeleteMethodCategoryChangesFor:aClassName selector:selector from:start to:stop |
5859 |
"delete method category changes for given class/selector in a range. |
|
5860 |
Return the number of deleted changes." |
|
5861 |
||
5862 |
|thisClassName index numDeleted| |
|
5863 |
||
5864 |
numDeleted := 0. |
|
5865 |
index := stop. |
|
5866 |
[index >= start] whileTrue:[ |
|
5867 |
thisClassName := self realClassNameOfChange:index. |
|
5868 |
thisClassName = aClassName ifTrue:[ |
|
5869 |
(self selectorOfMethodCategoryChange:index) == selector ifTrue:[ |
|
5870 |
self silentDeleteChange:index. |
|
5871 |
numDeleted := numDeleted + 1. |
|
5872 |
] |
|
5873 |
]. |
|
5874 |
index := index - 1 |
|
5875 |
]. |
|
5876 |
^ numDeleted |
|
5877 |
! |
|
5878 |
||
5879 |
silentDeleteMethodChangesFor:aClassName selector:selector from:start to:stop |
|
5880 |
"delete method changes for given class/selector in a range. |
|
5881 |
Return the number of deleted changes." |
|
5882 |
||
5883 |
|thisClassName index numDeleted| |
|
5884 |
||
5885 |
numDeleted := 0. |
|
5886 |
index := stop. |
|
5887 |
[index >= start] whileTrue:[ |
|
5888 |
thisClassName := self realClassNameOfChange:index. |
|
5889 |
thisClassName = aClassName ifTrue:[ |
|
5890 |
(self selectorOfMethodChange:index) == selector ifTrue:[ |
|
5891 |
self silentDeleteChange:index. |
|
5892 |
numDeleted := numDeleted + 1. |
|
5893 |
] |
|
5894 |
]. |
|
5895 |
index := index - 1 |
|
5896 |
]. |
|
5897 |
^ numDeleted |
|
5898 |
! |
|
5899 |
||
4487 | 5900 |
updateDiffView |
5901 |
self withSelectedChangesDo:[:changeNr | |
|
6288 | 5902 |
self updateDiffViewFor:changeNr. |
5903 |
^ self. |
|
4487 | 5904 |
]. |
5905 |
||
5906 |
diffView text1:'' text2:'' |
|
5907 |
! |
|
5908 |
||
5909 |
updateDiffViewFor:changeNr |
|
5910 |
|aStream chunk sawExcla parseTree thisClass cat oldSource newSource |
|
8675
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5911 |
parser sel showDiff selector oldMethod i| |
4487 | 5912 |
|
5913 |
aStream := self streamForChange:changeNr. |
|
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
5914 |
aStream isNil ifTrue:[ |
6317 | 5915 |
^ self |
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
5916 |
]. |
4487 | 5917 |
|
5918 |
showDiff := false. |
|
5919 |
||
5920 |
(self changeIsFollowupMethodChange:changeNr) ifFalse:[ |
|
6317 | 5921 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
5922 |
chunk := aStream nextChunk. |
|
4487 | 5923 |
] ifTrue:[ |
16372 | 5924 |
chunk := self changeChunkAt:changeNr. |
6317 | 5925 |
sawExcla := true. |
4487 | 5926 |
]. |
5927 |
||
4857 | 5928 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
5929 |
do:[ |
|
8665 | 5930 |
parseTree := self parseExpression:chunk. |
6317 | 5931 |
(parseTree notNil and:[parseTree ~~ #Error and:[ parseTree isMessage ]]) ifTrue:[ |
5932 |
selector := parseTree selector. |
|
5933 |
] |
|
4857 | 5934 |
]. |
5935 |
||
5936 |
selector isNil ifTrue:[ |
|
6317 | 5937 |
newSource := chunk. |
5938 |
oldSource := 'Not comparable.'. |
|
4857 | 5939 |
] ifFalse:[ |
6317 | 5940 |
sawExcla ifFalse:[ |
5941 |
"/ not a method-change |
|
5942 |
newSource := chunk. |
|
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
5943 |
oldSource := self currentSourceForParseTree:parseTree. |
6317 | 5944 |
] ifTrue:[ |
5945 |
"/ a method-change |
|
5946 |
||
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5947 |
(self class methodDefinitionSelectors includes:selector) ifTrue:[ |
6317 | 5948 |
newSource := aStream nextChunk. |
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
5949 |
thisClass := self classFromEvaluatingTree:parseTree receiver. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
5950 |
"/ Error |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
5951 |
"/ handle:[ ] |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
5952 |
"/ do:[ |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
5953 |
"/ thisClass := parseTree receiver evaluate. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
5954 |
"/ ]. |
6378 | 5955 |
thisClass isBehavior ifFalse:[ |
5956 |
thisClass := self classOfChange:changeNr. |
|
5957 |
]. |
|
6317 | 5958 |
thisClass isBehavior ifTrue:[ |
5959 |
(thisClass isLoaded |
|
5960 |
or:[ autoloadAsRequired value |
|
5961 |
and:[self checkClassIsLoaded:thisClass]]) ifFalse:[ |
|
5962 |
oldSource := 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
5963 |
] ifTrue:[ |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5964 |
selector numArgs == 0 ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5965 |
cat := '* as yet uncategorized *'. |
6532 | 5966 |
cat := selector. |
6317 | 5967 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5968 |
cat := parseTree arg1 evaluate. |
6317 | 5969 |
]. |
5970 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
|
5971 |
do:[ |
|
7709 | 5972 |
parser := Parser new. |
6639 | 5973 |
Error catch:[ |
7709 | 5974 |
parser |
5975 |
parseMethod:newSource in:thisClass |
|
5976 |
ignoreErrors:true ignoreWarnings:true. |
|
6317 | 5977 |
] |
5978 |
]. |
|
7709 | 5979 |
sel := parser selector. |
5980 |
(sel notNil) ifTrue:[ |
|
6317 | 5981 |
oldMethod := thisClass compiledMethodAt:sel. |
5982 |
oldMethod notNil ifTrue:[ |
|
5983 |
(oldMethod category = cat) ifFalse:[ |
|
6447 | 5984 |
"/ Transcript showCR:'category changed.'. |
6317 | 5985 |
]. |
5986 |
oldSource := oldMethod source. |
|
5987 |
(oldSource = newSource) ifFalse:[ |
|
5988 |
oldSource isNil ifTrue:[ |
|
5989 |
oldSource := 'No source for compare.'. |
|
5990 |
] ifFalse:[ |
|
5991 |
"/ |
|
5992 |
"/ compare for tabulator <-> space changes |
|
5993 |
"/ before showing diff ... |
|
5994 |
"/ |
|
5995 |
oldSource := oldSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
5996 |
newSource := newSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
5997 |
oldSource = newSource ifFalse:[ |
|
5998 |
"/ |
|
5999 |
"/ check if only historyLine diffs |
|
6000 |
"/ |
|
6001 |
(HistoryManager notNil |
|
6002 |
and:[HistoryManager isActive]) ifTrue:[ |
|
6003 |
oldSource := oldSource asStringCollection asString. |
|
6004 |
newSource := newSource asStringCollection asString. |
|
6005 |
(HistoryManager withoutHistoryLines:oldSource) |
|
6006 |
= |
|
6007 |
(HistoryManager withoutHistoryLines:newSource) |
|
6008 |
ifTrue:[ |
|
6009 |
oldSource := (HistoryManager withoutHistoryLines:oldSource). |
|
6010 |
newSource := (HistoryManager withoutHistoryLines:newSource). |
|
6011 |
] |
|
6012 |
]. |
|
6013 |
] |
|
6014 |
] |
|
6015 |
] |
|
6016 |
] ifFalse:[ |
|
6017 |
oldSource := 'Method does not exist.'. |
|
6018 |
] |
|
6019 |
] ifFalse:[ |
|
6020 |
oldSource := 'Change is unparsable (parse error).'. |
|
6021 |
]. |
|
6022 |
]. |
|
6023 |
] ifFalse:[ |
|
6024 |
oldSource := 'Class does not exist.'. |
|
6025 |
] |
|
6026 |
] ifFalse:[ |
|
6027 |
newSource := chunk. "/ aStream contents. |
|
6028 |
oldSource := 'Not comparable.'. |
|
6029 |
] |
|
6030 |
] |
|
4487 | 6031 |
]. |
6032 |
aStream close. |
|
6033 |
||
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
6034 |
oldSource := oldSource ? ''. |
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
6035 |
newSource := newSource ? ''. |
8675
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6036 |
|
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6037 |
oldSource := oldSource asStringCollection asString. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6038 |
newSource := newSource asStringCollection asString. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6039 |
|
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6040 |
"/ unify cr, crlf and lf into lf |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6041 |
(oldSource includes:Character return) ifTrue: [ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6042 |
i := oldSource indexOf:Character return. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6043 |
(oldSource at:i+1) == Character nl ifTrue:[ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6044 |
"/ crnl endings |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6045 |
oldSource := oldSource copyReplaceString:(String crlf) withString:(String lf). |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6046 |
] ifFalse:[ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6047 |
"/ cr endings |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6048 |
oldSource := oldSource copyReplaceAll:Character return with:Character nl. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6049 |
]. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6050 |
]. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6051 |
|
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6052 |
"/ unify cr, crlf and lf into lf |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6053 |
(newSource includes:Character return) ifTrue: [ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6054 |
i := newSource indexOf:Character return. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6055 |
(newSource at:i+1) == Character nl ifTrue:[ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6056 |
"/ crnl endings |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6057 |
newSource := newSource copyReplaceString:(String crlf) withString:(String lf). |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6058 |
] ifFalse:[ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6059 |
"/ cr endings |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6060 |
newSource := newSource copyReplaceAll:Character return with:Character nl. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6061 |
]. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6062 |
]. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6063 |
|
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
6064 |
(oldSource = newSource |
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
6065 |
or:[ oldSource asStringCollection withTabsExpanded = newSource asStringCollection withTabsExpanded]) ifTrue:[ |
6317 | 6066 |
self makeDiffViewInvisible |
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
6067 |
] ifFalse:[ |
6317 | 6068 |
self makeDiffViewVisible. |
6069 |
diffView text1:oldSource text2:newSource. |
|
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
6070 |
]. |
4487 | 6071 |
|
7709 | 6072 |
"Created: / 24-11-1995 / 14:30:46 / cg" |
16372 | 6073 |
"Modified: / 01-05-2016 / 18:26:01 / cg" |
202 | 6074 |
! ! |
0 | 6075 |
|
202 | 6076 |
!ChangesBrowser methodsFor:'termination'! |
51 | 6077 |
|
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6078 |
askIfChangesAreToBeWrittenBack |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6079 |
|action again| |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6080 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6081 |
anyChanges ifFalse:[^ self]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6082 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6083 |
again := true. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6084 |
[again] whileTrue:[ |
6357 | 6085 |
action := OptionBox |
6086 |
request:(resources stringWithCRs:'The modified changelist has not been written back to the change file.\\Write change file before closing ?') |
|
6087 |
label:'ChangesBrowser' |
|
6088 |
image:(WarningBox iconBitmap) |
|
6089 |
buttonLabels:(resources array:#('Cancel' 'Don''t Write' 'Write')) |
|
6090 |
values:#(#abort #ignore #save) |
|
6091 |
default:#save |
|
6092 |
onCancel:#abort. |
|
6093 |
||
6094 |
again := false. |
|
6095 |
action == #abort ifTrue:[AbortSignal raise. ^ self]. |
|
6096 |
action == #save ifTrue:[ |
|
6097 |
again := self writeBackChanges not |
|
6098 |
]. |
|
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6099 |
]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6100 |
! |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6101 |
|
1787 | 6102 |
closeRequest |
18159 | 6103 |
"window manager wants me to go away" |
1787 | 6104 |
|
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6105 |
self askIfChangesAreToBeWrittenBack. |
1787 | 6106 |
super closeRequest |
18159 | 6107 |
|
6108 |
"Modified (comment): / 28-05-2018 / 09:49:47 / Claus Gittinger" |
|
1787 | 6109 |
! |
6110 |
||
202 | 6111 |
saveAndTerminate |
6112 |
"update the changes file and quit. |
|
17026 | 6113 |
Don't depend on this being sent, not all window managers |
202 | 6114 |
send it; instead, they simply destroy the view." |
28 | 6115 |
|
202 | 6116 |
anyChanges ifTrue:[ |
17026 | 6117 |
self writeBackChanges. |
0 | 6118 |
]. |
1787 | 6119 |
super saveAndTerminate |
6120 |
||
6121 |
"Modified: / 3.8.1998 / 19:54:00 / cg" |
|
0 | 6122 |
! ! |
6123 |
||
73 | 6124 |
!ChangesBrowser methodsFor:'user interaction'! |
51 | 6125 |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6126 |
askForSearch:msg initialAnswer:initial thenSearchUsing:searchBlock2 onCancel:cancelBlock |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6127 |
|searchString directionHolder searchBlock| |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6128 |
|
6288 | 6129 |
searchString := self |
15674 | 6130 |
askForSearchString:msg |
6131 |
initialAnswer:initial |
|
6132 |
directionInto:(directionHolder := ValueHolder new). |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6133 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6134 |
searchString isNil ifTrue:[ |
15674 | 6135 |
^ cancelBlock value |
6136 |
]. |
|
17382 | 6137 |
lastSearchString := searchString. |
6138 |
||
15674 | 6139 |
directionHolder value == #first ifTrue:[ |
6140 |
self findFirstForClass:searchString. |
|
6141 |
^ self. |
|
6142 |
]. |
|
6143 |
directionHolder value == #last ifTrue:[ |
|
6144 |
self findLastForClass:searchString. |
|
6145 |
^ self. |
|
6146 |
]. |
|
6147 |
||
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6148 |
searchBlock := [:changeNr | searchBlock2 value:searchString value:changeNr]. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6149 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6150 |
directionHolder value == #backward ifTrue:[ |
15674 | 6151 |
changeNrShown isNil ifTrue:[ |
6152 |
changeNrShown := self numberOfChanges. |
|
6153 |
]. |
|
6154 |
self findPreviousForWhich:searchBlock |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6155 |
] ifFalse:[ |
15674 | 6156 |
changeNrShown isNil ifTrue:[ |
6157 |
changeNrShown := 0. |
|
6158 |
]. |
|
6159 |
self findNextForWhich:searchBlock |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6160 |
]. |
17382 | 6161 |
|
6162 |
"Modified: / 10-02-2017 / 20:40:59 / cg" |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6163 |
! |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6164 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6165 |
askForSearchString:msg initialAnswer:initial directionInto:aValueHolder |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6166 |
"common code to open a search box" |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6167 |
|
17394 | 6168 |
|searchString direction choices current| |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6169 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6170 |
direction := #forward. |
17394 | 6171 |
choices := OrderedCollection new. |
6172 |
||
6173 |
changeNrShown notNil ifTrue:[ |
|
6174 |
current := self classNameOfChange:changeNrShown. |
|
6175 |
initial ~= current ifTrue:[ |
|
6176 |
(choices includes:current) ifFalse:[ |
|
6177 |
choices addFirst:current |
|
6178 |
]. |
|
6179 |
]. |
|
6180 |
]. |
|
6181 |
lastSearchString notNil ifTrue:[ |
|
6182 |
initial ~= lastSearchString ifTrue:[ |
|
6183 |
(choices includes:lastSearchString) ifFalse:[ |
|
6184 |
choices addFirst:lastSearchString |
|
6185 |
]. |
|
6186 |
]. |
|
6187 |
]. |
|
6188 |
||
15449 | 6189 |
"/ take a normal request box, but add an additional 'previous' button |
6190 |
Dialog modifyingBoxWith:[:box | |
|
15674 | 6191 |
|nextButton prevButton firstButton lastButton| |
15449 | 6192 |
|
13343 | 6193 |
nextButton := box okButton. |
15674 | 6194 |
|
6195 |
firstButton := Button label:(resources string:'First'). |
|
6196 |
firstButton action:[direction := #first. box okPressed.]. |
|
6197 |
box addButton:firstButton after:nextButton. |
|
6198 |
||
6199 |
lastButton := Button label:(resources string:'Last'). |
|
6200 |
lastButton action:[direction := #last. box okPressed.]. |
|
6201 |
box addButton:lastButton after:nextButton. |
|
6202 |
||
13343 | 6203 |
prevButton := Button label:(resources string:'Previous'). |
6204 |
prevButton action:[direction := #backward. box okPressed.]. |
|
6205 |
box addButton:prevButton after:nextButton. |
|
15674 | 6206 |
|
13343 | 6207 |
nextButton label:(resources string:'Next'). |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6208 |
] do:[ |
13343 | 6209 |
searchString := Dialog |
6210 |
request:msg |
|
17394 | 6211 |
list:choices |
13343 | 6212 |
initialAnswer:initial |
17394 | 6213 |
]. |
6214 |
||
6215 |
searchString isEmptyOrNil ifTrue:[ |
|
13343 | 6216 |
^ nil |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6217 |
]. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6218 |
aValueHolder value:direction. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6219 |
^ searchString |
15449 | 6220 |
|
6221 |
" |
|
6222 |
self new askForSearchString:'foo' initialAnswer:'bla' directionInto:(false asValue) |
|
6223 |
" |
|
17394 | 6224 |
|
6225 |
"Modified: / 12-02-2017 / 11:18:11 / cg" |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6226 |
! |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6227 |
|
221 | 6228 |
autoUpdate:aBoolean |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
6229 |
"enabled/disable automatic update from the change-file (for monitoring)" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
6230 |
|
6216 | 6231 |
autoUpdate value:aBoolean |
221 | 6232 |
|
6233 |
"Created: 3.12.1995 / 14:14:24 / cg" |
|
6234 |
"Modified: 3.12.1995 / 14:20:45 / cg" |
|
6235 |
! |
|
6236 |
||
6216 | 6237 |
autoloadAsRequired:aBoolean |
6238 |
"enabled/disable automatic load of unloaded classes" |
|
6239 |
||
6240 |
autoloadAsRequired value:aBoolean |
|
6241 |
! |
|
6242 |
||
3211 | 6243 |
changeSelection:lineNrCollection |
0 | 6244 |
"show a change in the codeView" |
6245 |
||
11048 | 6246 |
|chunk lineNr lineNumbers| |
3211 | 6247 |
|
6248 |
lineNrCollection isInteger ifTrue:[ |
|
11048 | 6249 |
lineNr := lineNrCollection. |
6250 |
lineNumbers := Array with:lineNr. |
|
3211 | 6251 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6252 |
changeListView multipleSelectOk ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6253 |
lineNrCollection size == 1 ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6254 |
lineNr := lineNrCollection first. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6255 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6256 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6257 |
lineNr := lineNrCollection |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6258 |
]. |
11048 | 6259 |
lineNumbers := lineNrCollection. |
6260 |
]. |
|
6261 |
||
6262 |
self changeListSelectionHolder value:lineNumbers. |
|
16467 | 6263 |
|
2293 | 6264 |
lineNr isNil ifTrue:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6265 |
codeView contents:nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6266 |
codeView initializeDoITAction. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6267 |
changeNrShown := nil. |
16467 | 6268 |
infoHolder value:nil. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6269 |
^ self |
2293 | 6270 |
]. |
6271 |
||
16467 | 6272 |
changeNrShown := lineNr. |
6273 |
self sensor |
|
6274 |
enqueueMessage:#updateSourceCodeAfterChangedSelection for:self arguments:nil; |
|
6275 |
enqueueMessage:#updateInfoAfterChangedSelection for:self arguments:nil. |
|
6276 |
^ self. |
|
6277 |
||
3211 | 6278 |
"/ display the changes code |
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
6279 |
chunk := self sourceOfChange:lineNr. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
6280 |
chunk isNil ifTrue:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6281 |
codeView initializeDoITAction. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6282 |
^ self |
2044 | 6283 |
]. |
8391 | 6284 |
|
0 | 6285 |
codeView contents:chunk. |
13 | 6286 |
codeView acceptAction:[:theCode | self doApply "noChangesAllowed"]. |
2043
66b5276b2760
set self in changesBrowsers doIt.
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
6287 |
codeView doItAction:[:theCode | |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6288 |
|clsName cls| |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6289 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6290 |
clsName := self classNameOfChange:lineNr. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6291 |
clsName notNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6292 |
clsName := clsName asSymbolIfInterned. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6293 |
clsName notNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6294 |
cls := Smalltalk at:clsName ifAbsent:nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6295 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6296 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6297 |
Compiler |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6298 |
evaluate:theCode |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6299 |
in:nil |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6300 |
receiver:cls |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6301 |
notifying:self |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6302 |
logged:true |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6303 |
ifFail:nil |
2043
66b5276b2760
set self in changesBrowsers doIt.
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
6304 |
]. |
15 | 6305 |
changeNrShown := lineNr. |
0 | 6306 |
|
4487 | 6307 |
self showingDiffs value ifTrue:[ |
8391 | 6308 |
self withWaitCursorDo:[ |
6309 |
AbortOperationRequest catch:[ |
|
6310 |
self updateDiffViewFor:changeNrShown. |
|
6311 |
] |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6312 |
] |
4487 | 6313 |
]. |
6314 |
||
11048 | 6315 |
"Modified: / 03-01-2012 / 15:30:23 / cg" |
51 | 6316 |
! |
6317 |
||
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6318 |
classOfChange:changeNr |
3806
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
6319 |
^ self |
6386 | 6320 |
classOfChange:changeNr |
6321 |
ifAbsent:[:className | |
|
6322 |
|msg| |
|
6323 |
||
6324 |
className isNil ifTrue:[ |
|
6325 |
msg := 'Could not extract classname from change'. |
|
6326 |
] ifFalse:[ |
|
6327 |
msg := 'Class not found: ''' , className , ''''. |
|
6328 |
]. |
|
8320
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6329 |
Transcript showCR:msg. |
6386 | 6330 |
"/ self warn:msg. |
6331 |
nil |
|
6332 |
] |
|
3806
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
6333 |
! |
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
6334 |
|
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
6335 |
classOfChange:changeNr ifAbsent:exceptionBlock |
18059 | 6336 |
"answer the class that is subject to the change at changeNr. |
7620
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6337 |
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
|
6338 |
|
8272
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
6339 |
|className cls isMeta nameSpaceForApply path ownerName owner| |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6340 |
|
5014 | 6341 |
className := self realClassNameOfChange:changeNr. |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6342 |
className isNil ifTrue:[ |
18059 | 6343 |
^ exceptionBlock valueWithOptionalArgument:nil |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6344 |
]. |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6345 |
|
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6346 |
isMeta := false. |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6347 |
(className endsWith:' class') ifTrue:[ |
12704
6f20f7d39e75
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12656
diff
changeset
|
6348 |
className := className copyButLast:6. |
6378 | 6349 |
isMeta := true. |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6350 |
]. |
3472 | 6351 |
|
8272
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
6352 |
autoloadAsRequired value ifTrue:[ |
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
6353 |
path := className asCollectionOfSubstringsSeparatedByAll:'::'. |
8320
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6354 |
path size >= 2 ifTrue:[ |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6355 |
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
|
6356 |
"/ 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
|
6357 |
"/ Transcript showCR:'loading owner'. |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6358 |
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
|
6359 |
owner := Smalltalk classNamed:ownerName. |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6360 |
owner notNil ifTrue:[ |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6361 |
owner autoload. |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6362 |
]. |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6363 |
]. |
8272
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
6364 |
]. |
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
6365 |
]. |
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
6366 |
|
7620
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6367 |
nameSpaceForApply := self nameSpaceForApply. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6368 |
autoloadAsRequired value ifTrue:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6369 |
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
|
6370 |
] ifFalse:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6371 |
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
|
6372 |
]. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6373 |
(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
|
6374 |
"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
|
6375 |
autoloadAsRequired value ifTrue:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6376 |
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
|
6377 |
] ifFalse:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6378 |
cls := Smalltalk loadedClassNamed:className |
6378 | 6379 |
]. |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6380 |
]. |
7620
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6381 |
|
6378 | 6382 |
cls isNil ifTrue:[ |
18059 | 6383 |
^ exceptionBlock valueWithOptionalArgument:className |
6378 | 6384 |
]. |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6385 |
isMeta ifTrue:[ |
6378 | 6386 |
cls := cls class |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6387 |
]. |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6388 |
^ cls |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6389 |
! |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6390 |
|
1471 | 6391 |
doubleClickOnChange:lineNr |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
6392 |
"action performed when a change-list entry is doubleClicked" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
6393 |
|
1471 | 6394 |
self doBrowse |
6395 |
||
6396 |
"Created: / 6.2.1998 / 13:08:49 / cg" |
|
6397 |
! |
|
6398 |
||
202 | 6399 |
noChangesAllowed |
6400 |
"show a warning that changes cannot be changed" |
|
93 | 6401 |
|
3211 | 6402 |
self warn:'Changes are not allowed to be changed.' |
0 | 6403 |
! |
6404 |
||
202 | 6405 |
saveClass:aClassName from:startNr |
6406 |
"user wants changes from current to end to be appended to a file" |
|
51 | 6407 |
|
202 | 6408 |
|changeNr fileName| |
51 | 6409 |
|
202 | 6410 |
changeNr := changeListView selection. |
6411 |
changeNr notNil ifTrue:[ |
|
9604 | 6412 |
fileName := Dialog |
6413 |
requestFileNameForSave:(resources string:'Append changes for class to:') |
|
6414 |
default:(lastSaveFileName ? '') |
|
6415 |
ok:(resources string:'Append') |
|
6416 |
abort:(resources string:'Abort') |
|
6417 |
pattern:'*.chg'. |
|
6418 |
||
6419 |
fileName notNil ifTrue:[ |
|
6420 |
lastSaveFileName := fileName. |
|
11685 | 6421 |
self withWriteCursorDo:[ |
9604 | 6422 |
startNr to:(self numberOfChanges) do:[:changeNr | |
6423 |
|thisClassName| |
|
6424 |
||
6425 |
thisClassName := self classNameOfChange:changeNr. |
|
6426 |
thisClassName = aClassName ifTrue:[ |
|
6427 |
self setSingleSelection:changeNr. |
|
6428 |
(self appendChange:changeNr toFile:fileName) ifFalse:[ |
|
6429 |
^ self |
|
6430 |
] |
|
6431 |
] |
|
6432 |
] |
|
6433 |
] |
|
6434 |
]. |
|
202 | 6435 |
] |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
6436 |
|
11685 | 6437 |
"Modified: / 27-07-2012 / 09:46:04 / cg" |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
6438 |
! |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
6439 |
|
11477 | 6440 |
selectionChanged |
12946 | 6441 |
self halt:'should not be here' |
11048 | 6442 |
|
6443 |
"Created: / 03-01-2012 / 15:26:36 / cg" |
|
16467 | 6444 |
! |
6445 |
||
6446 |
updateInfoAfterChangedSelection |
|
6447 |
"update the info label" |
|
6448 |
||
17172 | 6449 |
|selection lineNr selectorOrNil className nonMetaClassName metaClassName |
16476 | 6450 |
nClassChanges nMethodChanges uniqueSelectors |
17172 | 6451 |
lastLineNr firstLineNr |
6452 |
countForClassBeforeCurrent countForClassAfterLast countForClassAndSelectorAfterLast |
|
18186 | 6453 |
moreInfo countInfo selectorInfo| |
16467 | 6454 |
|
6455 |
selection := lineNr := changeListView selection. |
|
6456 |
selection isNumber ifFalse:[ |
|
6457 |
lineNr := nil. |
|
6458 |
selection notEmptyOrNil ifTrue:[ |
|
6459 |
lineNr := selection first |
|
6460 |
]. |
|
6461 |
]. |
|
6462 |
||
6463 |
lineNr isNil ifTrue:[ |
|
6464 |
infoHolder value:nil. |
|
6465 |
^ self |
|
6466 |
]. |
|
6467 |
||
6468 |
"/ |
|
6469 |
"/ now, this info is computed so fast, |
|
6470 |
"/ we can do it each time the selection changes |
|
6471 |
"/ (can we?) |
|
6472 |
className := self realClassNameOfChange:lineNr. |
|
16478 | 6473 |
className isNil ifTrue:[ |
6474 |
infoHolder value:nil. |
|
6475 |
^ self |
|
6476 |
]. |
|
17172 | 6477 |
selectorOrNil := self selectorOfMethodChange:lineNr. |
16478 | 6478 |
|
16476 | 6479 |
nonMetaClassName := (className endsWith:' class') |
6480 |
ifTrue:[ className copyButLast:' class' size ] |
|
6481 |
ifFalse:[ className ]. |
|
6482 |
metaClassName := nonMetaClassName,' class'. |
|
6483 |
||
16467 | 6484 |
nClassChanges := nMethodChanges := 0. |
6485 |
uniqueSelectors := Set new. |
|
16476 | 6486 |
lastLineNr := firstLineNr := nil. |
17172 | 6487 |
countForClassAfterLast := 0. |
6488 |
countForClassBeforeCurrent := 0. |
|
6489 |
countForClassAndSelectorAfterLast := 0. |
|
16467 | 6490 |
|
6491 |
"/ count them all |
|
6492 |
1 to:changeInfoList size do:[:i | |
|
16476 | 6493 |
|sel nameOfChange| |
17420 | 6494 |
|
6495 |
changeInfoList at:i. |
|
16476 | 6496 |
nameOfChange := self realClassNameOfChange:i. |
6497 |
((nameOfChange = nonMetaClassName) or:[nameOfChange = metaClassName]) ifTrue:[ |
|
17172 | 6498 |
sel := self selectorOfMethodChange:i. |
6499 |
||
16467 | 6500 |
lastLineNr := i. |
16476 | 6501 |
firstLineNr := firstLineNr ? i. |
17172 | 6502 |
i > lineNr ifTrue:[ |
6503 |
countForClassAfterLast := countForClassAfterLast + 1. |
|
6504 |
(nameOfChange = className |
|
6505 |
and:[ selectorOrNil notNil |
|
6506 |
and:[sel == selectorOrNil]]) ifTrue:[ |
|
6507 |
countForClassAndSelectorAfterLast := countForClassAndSelectorAfterLast + 1. |
|
16476 | 6508 |
]. |
17172 | 6509 |
] ifFalse:[ |
6510 |
i < lineNr ifTrue:[ |
|
6511 |
countForClassBeforeCurrent := countForClassBeforeCurrent + 1 |
|
6512 |
] |
|
6513 |
]. |
|
16467 | 6514 |
nClassChanges := nClassChanges + 1. |
17172 | 6515 |
sel notNil ifTrue:[ |
16467 | 6516 |
uniqueSelectors add:sel. |
6517 |
nMethodChanges := nMethodChanges + 1. |
|
6518 |
]. |
|
6519 |
]. |
|
6520 |
]. |
|
6521 |
lastLineNr == lineNr ifTrue:[ |
|
16476 | 6522 |
firstLineNr == lineNr ifTrue:[ |
6523 |
moreInfo := resources string:'. This is the only one for this class '. |
|
6524 |
] ifFalse:[ |
|
6525 |
moreInfo := resources string:'. This is the last for this class '. |
|
6526 |
] |
|
16467 | 6527 |
] ifFalse:[ |
16476 | 6528 |
firstLineNr == lineNr ifTrue:[ |
6529 |
moreInfo := resources string:'. This is the first for this class'. |
|
6530 |
]. |
|
17172 | 6531 |
countForClassAfterLast > 0 ifTrue:[ |
6532 |
moreInfo := (moreInfo ? ''),(resources string:'. %1 more for this class' with:countForClassAfterLast). |
|
6533 |
countForClassAndSelectorAfterLast > 0 ifTrue:[ |
|
17419 | 6534 |
moreInfo := moreInfo,(resources string:', %1 for selector' with:countForClassAndSelectorAfterLast). |
17172 | 6535 |
]. |
16467 | 6536 |
]. |
6537 |
]. |
|
18186 | 6538 |
|
6539 |
countInfo := resources string:'%1 changes. %2 for %3 ' |
|
6540 |
with:(changeInfoList size) |
|
6541 |
with:nClassChanges |
|
6542 |
with:className. |
|
6543 |
||
17381 | 6544 |
uniqueSelectors size == 1 ifTrue:[ |
6545 |
nMethodChanges == 1 ifTrue:[ |
|
18186 | 6546 |
selectorInfo := (resources string:'(1 for #''%1'')' |
6547 |
with:uniqueSelectors first) allBold |
|
17381 | 6548 |
] ifFalse:[ |
18186 | 6549 |
selectorInfo := (resources string:'(%1 methods / for #''%2'')' |
6550 |
with:nMethodChanges |
|
6551 |
with:uniqueSelectors first) allBold |
|
6552 |
]. |
|
18110 | 6553 |
] ifFalse:[ |
18186 | 6554 |
(nMethodChanges == 0 and:[uniqueSelectors isEmptyOrNil]) ifTrue:[ |
6555 |
selectorInfo := resources string:'(0 methods)' |
|
6556 |
] ifFalse:[ |
|
6557 |
selectorInfo := (resources string:'(%1 methods / %5 selectors)' |
|
6558 |
with:nMethodChanges |
|
6559 |
with:uniqueSelectors size) allBold |
|
6560 |
]. |
|
6561 |
]. |
|
6562 |
infoHolder value:(countInfo,selectorInfo,moreInfo). |
|
17381 | 6563 |
|
17420 | 6564 |
"Modified: / 19-02-2017 / 13:37:19 / cg" |
18186 | 6565 |
"Modified: / 08-06-2018 / 12:09:44 / Claus Gittinger" |
16467 | 6566 |
! |
6567 |
||
6568 |
updateSourceCodeAfterChangedSelection |
|
6569 |
"show a change in the codeView" |
|
6570 |
||
6571 |
|selection lineNr chunk| |
|
6572 |
||
6573 |
selection := lineNr := changeListView selection. |
|
6574 |
selection isNumber ifFalse:[ |
|
6575 |
lineNr := nil. |
|
6576 |
selection notEmptyOrNil ifTrue:[ |
|
6577 |
lineNr := selection first |
|
6578 |
]. |
|
6579 |
]. |
|
6580 |
||
6581 |
lineNr isNil ifTrue:[ |
|
6582 |
^ self |
|
6583 |
]. |
|
6584 |
||
6585 |
"/ display the changes code |
|
6586 |
chunk := self sourceOfChange:lineNr. |
|
6587 |
chunk isNil ifTrue:[ |
|
6588 |
codeView initializeDoITAction. |
|
6589 |
^ self |
|
6590 |
]. |
|
6591 |
||
6592 |
codeView contents:chunk. |
|
6593 |
codeView acceptAction:[:theCode | self doApply "noChangesAllowed"]. |
|
6594 |
codeView doItAction:[:theCode | |
|
6595 |
|clsName cls| |
|
6596 |
||
6597 |
clsName := self classNameOfChange:lineNr. |
|
6598 |
clsName notNil ifTrue:[ |
|
6599 |
clsName := clsName asSymbolIfInterned. |
|
6600 |
clsName notNil ifTrue:[ |
|
6601 |
cls := Smalltalk at:clsName ifAbsent:nil. |
|
6602 |
] |
|
6603 |
]. |
|
6604 |
Compiler |
|
6605 |
evaluate:theCode |
|
6606 |
in:nil |
|
6607 |
receiver:cls |
|
6608 |
notifying:self |
|
6609 |
logged:true |
|
6610 |
ifFail:nil |
|
6611 |
]. |
|
6612 |
||
6613 |
||
6614 |
changeNrShown := lineNr. |
|
6615 |
||
6616 |
self showingDiffs value ifTrue:[ |
|
6617 |
self withWaitCursorDo:[ |
|
6618 |
AbortOperationRequest catch:[ |
|
6619 |
self updateDiffViewFor:changeNrShown. |
|
6620 |
] |
|
6621 |
] |
|
6622 |
]. |
|
202 | 6623 |
! ! |
0 | 6624 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6625 |
!ChangesBrowser::ChangeFileReader methodsFor:'accessing'! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6626 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6627 |
autoCompare:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6628 |
autoCompare := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6629 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6630 |
|
7620
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6631 |
autoloadAsRequired |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6632 |
^ autoloadAsRequired |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6633 |
! |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6634 |
|
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6635 |
autoloadAsRequired:something |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6636 |
autoloadAsRequired := something. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6637 |
! |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6638 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6639 |
browser:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6640 |
browser := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6641 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6642 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6643 |
changeChunks |
18054 | 6644 |
self breakPoint:#cg. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6645 |
^ changeChunks |
16372 | 6646 |
|
6647 |
"Modified: / 01-05-2016 / 19:10:52 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6648 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6649 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6650 |
changeClassNames |
18054 | 6651 |
self breakPoint:#cg. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6652 |
^ changeClassNames |
16372 | 6653 |
|
6654 |
"Modified: / 01-05-2016 / 19:10:47 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6655 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6656 |
|
6516
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6657 |
changeFileName |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6658 |
^ changeFileName |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6659 |
! |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6660 |
|
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6661 |
changeFileName:something |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6662 |
changeFileName := something. |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6663 |
! |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6664 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6665 |
changeHeaderLines |
18054 | 6666 |
self breakPoint:#cg. |
16372 | 6667 |
^ changeHeaderLines |
6668 |
||
6669 |
"Modified: / 01-05-2016 / 19:10:41 / cg" |
|
6670 |
! |
|
6671 |
||
6672 |
changeInfo |
|
6673 |
^ changeInfo |
|
6674 |
||
6675 |
"Created: / 01-05-2016 / 19:10:05 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6676 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6677 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6678 |
changeIsFollowupMethodChange |
18054 | 6679 |
self breakPoint:#cg. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6680 |
^ changeIsFollowupMethodChange |
16372 | 6681 |
|
6682 |
"Modified: / 01-05-2016 / 19:10:24 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6683 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6684 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6685 |
changePositions |
18054 | 6686 |
self breakPoint:#cg. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6687 |
^ changePositions |
16372 | 6688 |
|
6689 |
"Modified: / 01-05-2016 / 19:10:29 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6690 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6691 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6692 |
changeTimeStamps |
18054 | 6693 |
self breakPoint:#cg. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6694 |
^ changeTimeStamps |
16372 | 6695 |
|
6696 |
"Modified: / 01-05-2016 / 19:10:34 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6697 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6698 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6699 |
enforcedNameSpace:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6700 |
enforcedNameSpace := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6701 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6702 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6703 |
inStream:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6704 |
inStream := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6705 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6706 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6707 |
noColoring:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6708 |
noColoring := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6709 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6710 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6711 |
tabSpec:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6712 |
tabSpec := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6713 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6714 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6715 |
thisIsAClassSource |
7360 | 6716 |
^ thisIsAClassSource ? false |
6717 |
||
6718 |
"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
|
6719 |
! ! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6720 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6721 |
!ChangesBrowser::ChangeFileReader methodsFor:'private'! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6722 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6723 |
contractClass:className selector:selector to:maxLen |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6724 |
"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
|
6725 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6726 |
|s l| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6727 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6728 |
s := className , ' ', selector. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6729 |
s size > maxLen ifTrue:[ |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6730 |
l := maxLen - 1 - selector size max:20. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6731 |
s := (className contractTo:l) , ' ' , selector. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6732 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6733 |
s size > maxLen ifTrue:[ |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6734 |
l := maxLen - 1 - className size max:20. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6735 |
s := className , ' ', (selector contractTo:l). |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6736 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6737 |
s size > maxLen ifTrue:[ |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6738 |
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
|
6739 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6740 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6741 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6742 |
^ s |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6743 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6744 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6745 |
extractClassAndClassNameFromParseTree:rec |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6746 |
|isUnaryMessage className changeClass| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6747 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6748 |
isUnaryMessage := rec isUnaryMessage. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6749 |
|
9019 | 6750 |
Error |
6751 |
handle:[:ex | ^ '?' -> nil] |
|
6843 | 6752 |
do:[ |
9019 | 6753 |
isUnaryMessage ifTrue:[ |
6754 |
className := rec receiver name. |
|
6755 |
] ifFalse:[ |
|
6756 |
className := rec name. |
|
6757 |
]. |
|
6843 | 6758 |
]. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6759 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6760 |
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
|
6761 |
autoloadAsRequired value ifTrue:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6762 |
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
|
6763 |
] ifFalse:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6764 |
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
|
6765 |
]. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6766 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6767 |
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
|
6768 |
autoloadAsRequired value ifTrue:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6769 |
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
|
6770 |
] ifFalse:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6771 |
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
|
6772 |
]. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6773 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6774 |
isUnaryMessage ifTrue:[ |
6843 | 6775 |
changeClass notNil ifTrue:[ |
6776 |
changeClass := changeClass class. |
|
6777 |
]. |
|
6778 |
className := className , ' class'. |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6779 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6780 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6781 |
^ className -> changeClass |
6843 | 6782 |
|
6783 |
"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
|
6784 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6785 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6786 |
nameSpaceForApply |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6787 |
^ browser nameSpaceForApply |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6788 |
! ! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6789 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6790 |
!ChangesBrowser::ChangeFileReader methodsFor:'reading'! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6791 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6792 |
addHeaderLineForChangeType:changeType changeString:changeString changeDelta:changeDelta timeStampInfo:timeStampInfo |
16372 | 6793 |
changeHeaderLines add:(self headerLineForChangeType:changeType changeString:changeString changeDelta:changeDelta timeStampInfo:timeStampInfo) |
6794 |
||
6795 |
"Modified: / 01-05-2016 / 19:07:49 / cg" |
|
6796 |
! |
|
6797 |
||
18059 | 6798 |
colorizeAsCommentChange:changeType |
6799 |
|c| |
|
6800 |
||
6801 |
NoColoring ~~ true ifTrue:[ |
|
6802 |
c := changeType allItalic. |
|
6803 |
"/ changeString := changeString allItalic. |
|
6804 |
c emphasisAllAdd:(#color -> UserPreferences current commentColor). |
|
6805 |
^ c |
|
6806 |
]. |
|
6807 |
^ changeType |
|
6808 |
! |
|
6809 |
||
16372 | 6810 |
headerLineForChangeType:changeType changeString:changeString changeDelta:changeDelta timeStampInfo:timeStampInfo |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6811 |
|entry| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6812 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6813 |
entry := MultiColListEntry new. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6814 |
entry tabulatorSpecification:tabSpec. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6815 |
entry colAt:1 put:changeDelta. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6816 |
entry colAt:2 put:changeString. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6817 |
entry colAt:3 put:changeType. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6818 |
timeStampInfo notNil ifTrue:[ |
12599
827681c8f7d4
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
6819 |
entry colAt:4 put:(browser timeStampPrintStringOf:timeStampInfo). |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6820 |
]. |
16372 | 6821 |
^ entry |
6822 |
||
6823 |
"Created: / 01-05-2016 / 19:07:20 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6824 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6825 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6826 |
processChunk |
16372 | 6827 |
|info| |
6828 |
||
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6829 |
(chunkText startsWith:'''---- timestamp ') ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6830 |
timeStampInfo := (chunkText copyFrom:16 to:(chunkText size - 6)) withoutSpaces. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6831 |
^ self. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6832 |
]. |
11234 | 6833 |
(chunkText asLowercase startsWith:'''---- encoding: ') ifTrue:[ |
6834 |
^ self. |
|
6835 |
]. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6836 |
|
16372 | 6837 |
changeInfo add:(info := |
6838 |
ChangesBrowser::ChangeInfo new |
|
6839 |
position:chunkPosition chunk:chunkText className:nil selector:nil headerLine:nil |
|
6840 |
timestamp:timeStampInfo isFollowupChange:false). |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6841 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6842 |
headerLine := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6843 |
changeDelta := ' '. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6844 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6845 |
sawExcla ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6846 |
self processNonMethodChunk |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6847 |
] ifTrue:[ |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6848 |
self processMethodChunkIfNone: |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6849 |
[ |
16372 | 6850 |
changeInfo removeLast. |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6851 |
] |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6852 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6853 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6854 |
changeString notNil ifTrue:[ |
16372 | 6855 |
"/ self addHeaderLineForChangeType:changeType changeString:changeString changeDelta:changeDelta timeStampInfo:timeStampInfo. |
6856 |
info headerLine:(self headerLineForChangeType:changeType changeString:changeString changeDelta:changeDelta timeStampInfo:timeStampInfo) |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6857 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6858 |
headerLine notNil ifTrue:[ |
17723 | 6859 |
changeHeaderLines add:headerLine. |
16372 | 6860 |
info headerLine:headerLine. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6861 |
] |
16372 | 6862 |
]. |
6863 |
||
6864 |
"Modified: / 01-05-2016 / 19:13:59 / cg" |
|
17723 | 6865 |
"Modified: / 27-10-2017 / 14:34:51 / stefan" |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6866 |
! |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6867 |
|
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6868 |
processMethodChunkIfNone:emptyBlock |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6869 |
"sawExcla" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6870 |
|
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6871 |
|askedForEditingClassSource changeClass category anyMethod |
15012 | 6872 |
sel p rec clsName done first text methodPos |
16372 | 6873 |
singleJunkOnly methodChunks classCategoryChunks methodCategoryChunks singleInfo methodSelector nameAndClass |
6874 |
info| |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6875 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6876 |
singleJunkOnly := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6877 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6878 |
classCategoryChunks := methodCategoryChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6879 |
singleInfo := false. |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6880 |
anyMethod := false. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6881 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6882 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6883 |
method definitions actually consist of |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6884 |
two (or more) chunks; skip next chunk(s) |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6885 |
up to an empty one. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6886 |
The system only writes one chunk, |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6887 |
and we cannot handle more in this ChangesBrowser .... |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6888 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6889 |
clsName := nil. |
8665 | 6890 |
|
18136 | 6891 |
(chunkText includesString:'§') ifTrue:[ |
18054 | 6892 |
self halt:'should no longer happen' |
6893 |
]. |
|
17094 | 6894 |
|
8665 | 6895 |
p := browser parseExpression:chunkText inNameSpace:(self nameSpaceForApply). |
6835
87e0844b7e12
Avoid debugger on timestamp information whenn doing autocompare
Stefan Vogel <sv@exept.de>
parents:
6820
diff
changeset
|
6896 |
(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
|
6897 |
rec := p receiver. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6898 |
sel := p selector. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6899 |
(ChangesBrowser methodDefinitionSelectors includes:sel) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6900 |
methodChunks := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6901 |
nameAndClass := self extractClassAndClassNameFromParseTree:rec. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6902 |
clsName := nameAndClass key. changeClass := nameAndClass value. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6903 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6904 |
sel == #categoriesForClass ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6905 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6906 |
classCategoryChunks := true. |
18059 | 6907 |
changeType := self colorizeAsCommentChange:'(class category change)'. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6908 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6909 |
sel == #categoriesFor: ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6910 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6911 |
methodCategoryChunks := true. |
18059 | 6912 |
changeType := self colorizeAsCommentChange:'(category change)'. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6913 |
methodSelector := (p args at:1) evaluate. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6914 |
] ifFalse:[ |
6532 | 6915 |
(sel numArgs == 0) ifTrue:[ |
6916 |
category := '* As yet uncategorized *'. |
|
6917 |
category := sel. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6918 |
] ifFalse:[ |
6532 | 6919 |
category := (p args at:1) evaluate. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6920 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6921 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6922 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6923 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6924 |
sel == #'methodsFor:stamp:' ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6925 |
"/ Squeak timeStamp |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6926 |
timeStampInfo := (p args at:2) evaluate. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6927 |
singleInfo := true |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6928 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6929 |
sel == #'commentStamp:prior:' ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6930 |
singleJunkOnly := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6931 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6932 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6933 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6934 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6935 |
sel == #reorganize ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6936 |
singleJunkOnly := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6937 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6938 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6939 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6940 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6941 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6942 |
done := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6943 |
first := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6944 |
[done] whileFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6945 |
changeDelta := ' '. |
13314 | 6946 |
methodPos := inStream position + 1. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6947 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6948 |
text := inStream nextChunk. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6949 |
done := text isEmptyOrNil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6950 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6951 |
done ifFalse:[ |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6952 |
anyMethod := true. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6953 |
first ifFalse:[ |
16372 | 6954 |
info := ChangesBrowser::ChangeInfo new |
6955 |
position:methodPos chunk:chunkText className:clsName |
|
6956 |
selector:nil headerLine:nil timestamp:timeStampInfo isFollowupChange:true. |
|
6957 |
changeInfo add:info. |
|
6958 |
||
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6959 |
askedForEditingClassSource ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6960 |
thisIsAClassSource := (changeFileName asFilename hasSuffix:'st'). |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6961 |
askedForEditingClassSource := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6962 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6963 |
] ifTrue:[ |
16372 | 6964 |
changeInfo last className:clsName |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6965 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6966 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6967 |
first := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6968 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6969 |
(classCategoryChunks or:[methodCategoryChunks]) ifTrue:[ |
6639 | 6970 |
text := text firstLine. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6971 |
classCategoryChunks ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6972 |
changeClass isNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6973 |
changeDelta := '?'. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6974 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6975 |
changeClass category = text ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6976 |
changeDelta := '='. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6977 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6978 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6979 |
changeString := clsName , ' category: ' , text storeString. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6980 |
]ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6981 |
changeString := '(' , clsName , ' compiledMethodAt:' , methodSelector storeString , ') category: ' , text storeString. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6982 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6983 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6984 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6985 |
try to find the selector |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6986 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6987 |
methodSelector := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6988 |
clsName notNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6989 |
methodChunks ifTrue:[ |
17094 | 6990 |
p := Parser for:(ReadStream on:text) in:nil. |
6991 |
p ignoreErrors:true. |
|
6992 |
p ignoreWarnings:true. |
|
6993 |
p parserFlags allowDollarInIdentifier:true. |
|
6994 |
p parserFlags allowParagraphInIdentifier:true. |
|
6995 |
p parseMethodSpec. |
|
6996 |
methodSelector := p selector. |
|
6997 |
"/ p := Parser |
|
6998 |
"/ parseMethodSpecification:text |
|
6999 |
"/ in:nil |
|
7000 |
"/ ignoreErrors:true |
|
7001 |
"/ ignoreWarnings:true. |
|
7002 |
"/ (p notNil and:[p ~~ #Error]) ifTrue:[ |
|
7003 |
"/ methodSelector := p selector. |
|
7004 |
"/ ] |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7005 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7006 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7007 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7008 |
methodSelector isNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7009 |
changeString := (chunkText contractTo:maxLen). |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7010 |
changeType := '(change)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7011 |
headerLine := chunkText , ' (change)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7012 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7013 |
changeString := self contractClass:clsName selector:methodSelector to:maxLen. |
18059 | 7014 |
changeType := ('{ ' , category , ' }'). |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7015 |
headerLine := clsName , ' ' , methodSelector , ' ' , '(change category: ''' , category , ''')'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7016 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7017 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7018 |
autoCompare value ifTrue:[ |
17047 | 7019 |
changeDelta := ChangeDeltaInformation |
7020 |
changeDeltaFor:text changeClass:changeClass selector:methodSelector. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7021 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7022 |
]. |
17047 | 7023 |
changeInfo last |
7024 |
headerLine:(self headerLineForChangeType:changeType |
|
7025 |
changeString:changeString |
|
7026 |
changeDelta:changeDelta |
|
7027 |
timeStampInfo:timeStampInfo). |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7028 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7029 |
changeString := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7030 |
headerLine := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7031 |
singleJunkOnly ifTrue:[done := true] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7032 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7033 |
singleInfo ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7034 |
timeStampInfo := nil |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7035 |
]. |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
7036 |
anyMethod ifFalse:[ |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
7037 |
emptyBlock value |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
7038 |
]. |
16372 | 7039 |
|
17094 | 7040 |
"Modified: / 21-11-2016 / 23:32:29 / cg" |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7041 |
! |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7042 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7043 |
processNonMethodChunk |
18059 | 7044 |
|s changeClass sel cls parseTree rec clsName ownerTree ownerName |
7045 |
m nameAndClass args instVarsArg classVarsArg categoryArg |
|
7046 |
lastInfo newCategory| |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7047 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7048 |
(chunkText startsWith:'''---- snap') ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7049 |
self processSnapshotChunk. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7050 |
^ self |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7051 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7052 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7053 |
headerLine := chunkText , ' (doIt)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7054 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7055 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7056 |
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
|
7057 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7058 |
((chunkText startsWith:'''---- file') |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7059 |
or:[(chunkText startsWith:'''---- check')]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7060 |
changeType := ''. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7061 |
timeStampInfo := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7062 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7063 |
changeType := '(doIt)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7064 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7065 |
changeString := (chunkText contractTo:maxLen) withoutSeparators. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7066 |
|
18059 | 7067 |
parseTree := browser parseExpression:fullChunkText inNameSpace:Smalltalk. |
7068 |
(parseTree notNil and:[parseTree ~~ #Error]) ifTrue:[ |
|
7069 |
parseTree isMessage ifTrue:[ |
|
7070 |
sel := parseTree selector. |
|
7071 |
rec := parseTree receiver. |
|
7072 |
args := parseTree args. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7073 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7074 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7075 |
sel := nil. |
18123 | 7076 |
Error handle:[:ex | |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7077 |
changeType := '(???)'. |
18123 | 7078 |
] do:[ |
7079 |
(Scanner new scanTokens:fullChunkText) size == 0 ifTrue:[ |
|
7080 |
"/ a comment only |
|
7081 |
changeType := self colorizeAsCommentChange:'(comment)'. |
|
7082 |
] ifFalse:[ |
|
7083 |
changeType := '(???)'. |
|
7084 |
] |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7085 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7086 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7087 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7088 |
(sel == #comment:) ifTrue:[ |
18059 | 7089 |
changeType := self colorizeAsCommentChange:'(comment)'. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7090 |
clsName := rec name. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7091 |
changeClass := (self nameSpaceForApply) classNamed:clsName. |
16372 | 7092 |
(changeInfo last) className:clsName. |
18059 | 7093 |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7094 |
autoCompare value ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7095 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7096 |
changeDelta := '?' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7097 |
] ifFalse:[ |
15087 | 7098 |
(changeClass comment = (args at:1) evaluate) ifTrue:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7099 |
changeDelta := '='. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7100 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7101 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7102 |
]. |
15087 | 7103 |
"/ sel := nil. |
7104 |
^ self. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7105 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7106 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7107 |
(sel == #removeSelector:) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7108 |
nameAndClass := self extractClassAndClassNameFromParseTree:rec. |
18059 | 7109 |
clsName := nameAndClass key. |
7110 |
changeClass := nameAndClass value. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7111 |
|
15087 | 7112 |
sel := (args at:1) evaluate. |
16372 | 7113 |
(changeInfo last) className:clsName. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7114 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7115 |
autoCompare value ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7116 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7117 |
changeDelta := '?' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7118 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7119 |
(changeClass includesSelector:sel asSymbol) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7120 |
changeDelta := '-'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7121 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7122 |
changeDelta := '='. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7123 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7124 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7125 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7126 |
changeType := '(remove)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7127 |
changeString := self contractClass:clsName selector:sel to:maxLen. |
15087 | 7128 |
"/ sel := nil. |
7129 |
^ self. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7130 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7131 |
|
18059 | 7132 |
(parseTree notNil |
7133 |
and:[parseTree ~~ #Error |
|
7134 |
and:[parseTree isMessage |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7135 |
and:[rec isMessage |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7136 |
and:[rec selector == #compiledMethodAt:]]]]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7137 |
nameAndClass := self extractClassAndClassNameFromParseTree:rec receiver. |
18059 | 7138 |
clsName := nameAndClass key. |
7139 |
changeClass := nameAndClass value. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7140 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7141 |
(sel == #category:) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7142 |
sel := (rec args at:1) evaluate. |
18059 | 7143 |
changeType := self colorizeAsCommentChange:'(category change)'. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7144 |
changeString := self contractClass:clsName selector:sel to:maxLen. |
18059 | 7145 |
newCategory := (args at:1) evaluate. |
7146 |
||
7147 |
"/ make it a category change |
|
7148 |
lastInfo := changeInfo last. |
|
7149 |
lastInfo className:clsName. |
|
7150 |
lastInfo selector:sel. |
|
7151 |
lastInfo categoryIfCategoryChange:newCategory. |
|
7152 |
||
15012 | 7153 |
autoCompare value ifTrue:[ |
7154 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
|
7155 |
changeDelta := '?' |
|
7156 |
] ifFalse:[ |
|
7157 |
m := changeClass compiledMethodAt:sel asSymbol. |
|
18059 | 7158 |
m isNil ifTrue:[ |
7159 |
"/ mhm - the method does not (no longer=) exist |
|
7160 |
changeDelta := '?' |
|
7161 |
] ifFalse:[ |
|
7162 |
m category = newCategory ifTrue:[ |
|
15012 | 7163 |
changeDelta := '='. |
7164 |
] |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7165 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7166 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7167 |
]. |
15087 | 7168 |
^ self. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7169 |
]. |
18059 | 7170 |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7171 |
(sel == #privacy:) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7172 |
sel := (rec args at:1) evaluate. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7173 |
changeType := '(privacy change)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7174 |
changeString := self contractClass:clsName selector:sel to:maxLen. |
16372 | 7175 |
(changeInfo last) className:clsName. |
18059 | 7176 |
|
15012 | 7177 |
autoCompare value ifTrue:[ |
7178 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
|
7179 |
changeDelta := '?' |
|
7180 |
] ifFalse:[ |
|
7181 |
changeDelta := ' ' |
|
7182 |
] |
|
7183 |
]. |
|
15087 | 7184 |
^ self. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7185 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7186 |
sel := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7187 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7188 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7189 |
(Class definitionSelectors includes:sel) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7190 |
changeType := '(class definition)'. |
15087 | 7191 |
clsName := (args at:1) evaluate. |
16372 | 7192 |
(changeInfo last) className:clsName. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7193 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7194 |
"/ is it a private-class ? |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7195 |
('*privateIn:' match:sel) ifTrue:[ |
15087 | 7196 |
ownerTree := args last. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7197 |
ownerName := ownerTree name asString. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7198 |
clsName := ownerName , '::' , clsName |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7199 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7200 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7201 |
changeString := clsName. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7202 |
NoColoring ~~ true ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7203 |
changeType := changeType allBold. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7204 |
changeString := changeString allBold. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7205 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7206 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7207 |
autoCompare value ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7208 |
cls := (self nameSpaceForApply) at:clsName asSymbol ifAbsent:nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7209 |
cls isNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7210 |
changeDelta := '+'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7211 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7212 |
(cls definitionSelector = sel |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7213 |
or:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7214 |
"/ could be an ST/V, VAge or Dolphin definition |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7215 |
cls definitionSelector = (sel , 'category:') |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7216 |
]) |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7217 |
ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7218 |
((cls superclass isNil |
18059 | 7219 |
and:[rec isLiteral |
7220 |
and:[rec evaluate isNil]]) |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7221 |
or:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7222 |
cls superclass notNil |
18059 | 7223 |
and:[rec isLiteral not |
7224 |
and:[cls superclass name = rec name]] |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7225 |
]) ifTrue:[ |
15087 | 7226 |
(sel == #'variableByteSubclass:classVariableNames:poolDictionaries:category:') |
7227 |
ifTrue:[ |
|
7228 |
"/ VSE definition message |
|
7229 |
instVarsArg := ''. |
|
7230 |
classVarsArg := (args at:2) evaluate. |
|
7231 |
categoryArg := (args at:4) evaluate. |
|
7232 |
] ifFalse:[ |
|
7233 |
instVarsArg := (args at:2) evaluate. |
|
7234 |
classVarsArg := (args at:3) evaluate. |
|
7235 |
categoryArg := (args at:5) evaluate. |
|
7236 |
]. |
|
7237 |
cls instanceVariableString asCollectionOfWords = instVarsArg asCollectionOfWords ifTrue:[ |
|
7238 |
cls classVariableString asCollectionOfWords = classVarsArg asCollectionOfWords ifTrue:[ |
|
7239 |
cls definitionSelector = (sel , 'category:') |
|
7240 |
ifTrue:[ |
|
7241 |
"/ ST/V, VAge or Dolphin definition |
|
7242 |
changeDelta := '='. |
|
7243 |
] ifFalse:[ |
|
7244 |
cls category = categoryArg ifTrue:[ |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7245 |
changeDelta := '='. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7246 |
] ifFalse:[ |
18059 | 7247 |
changeType := self colorizeAsCommentChange:'(class category change)'. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7248 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7249 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7250 |
] |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7251 |
] |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7252 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7253 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7254 |
] |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7255 |
]. |
15087 | 7256 |
"/ sel := nil. |
7257 |
^ self. |
|
7258 |
]. |
|
7259 |
||
7260 |
(#( |
|
7261 |
#'primitiveDefinitions:' |
|
7262 |
#'primitiveFunctions:' |
|
7263 |
#'primitiveVariables:' |
|
7264 |
) includes:sel) ifTrue:[ |
|
7265 |
changeType := '(class definition)'. |
|
7266 |
clsName := rec name. |
|
7267 |
^ self. |
|
7268 |
]. |
|
7269 |
||
7270 |
((sel == #instanceVariableNames:) |
|
7271 |
and:[rec isMessage |
|
7272 |
and:[rec selector == #class]]) ifTrue:[ |
|
7273 |
clsName := rec receiver name. |
|
7274 |
changeClass := (self nameSpaceForApply) classNamed:clsName. |
|
7275 |
changeType := '(class definition)'. |
|
16372 | 7276 |
(changeInfo last) className:clsName. |
15087 | 7277 |
|
7278 |
autoCompare value ifTrue:[ |
|
7279 |
changeClass isNil ifTrue:[ |
|
7280 |
changeDelta := '?'. |
|
7281 |
] ifFalse:[ |
|
18059 | 7282 |
s := (args at:1) evaluate. |
15087 | 7283 |
s = changeClass class instanceVariableString ifTrue:[ |
7284 |
changeDelta := '='. |
|
7285 |
] |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7286 |
] |
15087 | 7287 |
]. |
7288 |
^ self. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7289 |
]. |
9548 | 7290 |
|
16372 | 7291 |
"Modified: / 01-05-2016 / 19:19:54 / cg" |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7292 |
! |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7293 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7294 |
processSnapshotChunk |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7295 |
changeType := ''. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7296 |
headerLine := chunkText. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7297 |
changeString := (chunkText contractTo:maxLen) withoutSeparators. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7298 |
timeStampInfo := nil. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7299 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7300 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7301 |
readChangesFile |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7302 |
"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
|
7303 |
and a list of chunk-positions (changePositions). |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7304 |
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
|
7305 |
the cols are: |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7306 |
1 delta (only if comparing) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7307 |
'+' -> new method (w.r.t. current state) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7308 |
'-' -> removed method (w.r.t. current state) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7309 |
'?' -> class does not exist currently |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7310 |
'=' -> 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
|
7311 |
'~' -> 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
|
7312 |
2 class/selector |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7313 |
3 type of change |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7314 |
doit |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7315 |
method |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7316 |
category change |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7317 |
4 timestamp |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7318 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7319 |
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
|
7320 |
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
|
7321 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7322 |
|excla| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7323 |
|
16372 | 7324 |
changeInfo := OrderedCollection new. |
7325 |
||
7326 |
"/ changeChunks := OrderedCollection new. |
|
7327 |
"/ changeClassNames := OrderedCollection new. |
|
7328 |
"/ changeHeaderLines := OrderedCollection new. |
|
7329 |
"/ changePositions := OrderedCollection new. |
|
7330 |
"/ changeTimeStamps := OrderedCollection new. |
|
7331 |
"/ changeIsFollowupMethodChange := OrderedCollection new. |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7332 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7333 |
excla := inStream class chunkSeparator. |
9515 | 7334 |
maxLen := 100. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7335 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7336 |
[inStream atEnd] whileFalse:[ |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7337 |
" |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7338 |
get a chunk (separated by excla) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7339 |
" |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7340 |
inStream skipSeparators. |
13314 | 7341 |
chunkPosition := inStream position + 1. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7342 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7343 |
sawExcla := inStream peekFor:excla. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7344 |
chunkText := fullChunkText := inStream nextChunk. |
7619
95943c1bc289
Ignore empty chunks when reading from changes file
Stefan Vogel <sv@exept.de>
parents:
7618
diff
changeset
|
7345 |
chunkText notEmptyOrNil ifTrue:[ |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7346 |
self processChunk. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7347 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7348 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7349 |
|
9515 | 7350 |
"Modified: / 27-08-1995 / 23:06:55 / claus" |
16372 | 7351 |
"Modified: / 01-05-2016 / 18:33:36 / cg" |
7352 |
! ! |
|
7353 |
||
18059 | 7354 |
!ChangesBrowser::ChangeInfo class methodsFor:'documentation'! |
7355 |
||
7356 |
documentation |
|
7357 |
" |
|
7358 |
documentation to be added. |
|
7359 |
||
7360 |
[author:] |
|
7361 |
cg |
|
7362 |
||
7363 |
[instance variables:] |
|
7364 |
||
7365 |
[class variables:] |
|
7366 |
||
7367 |
[see also:] |
|
7368 |
||
7369 |
" |
|
7370 |
! ! |
|
7371 |
||
16372 | 7372 |
!ChangesBrowser::ChangeInfo methodsFor:'accessing'! |
7373 |
||
18059 | 7374 |
categoryIfCategoryChange |
7375 |
^ categoryIfCategoryChange |
|
7376 |
! |
|
7377 |
||
7378 |
categoryIfCategoryChange:something |
|
7379 |
categoryIfCategoryChange := something. |
|
7380 |
! |
|
7381 |
||
16372 | 7382 |
chunk |
7383 |
^ chunk |
|
7384 |
! |
|
7385 |
||
7386 |
className |
|
7387 |
^ className |
|
7388 |
! |
|
7389 |
||
7390 |
className:something |
|
7391 |
className := something. |
|
7392 |
! |
|
7393 |
||
7394 |
headerLine |
|
7395 |
^ headerLine |
|
7396 |
! |
|
7397 |
||
7398 |
headerLine:something |
|
7399 |
headerLine := something. |
|
7400 |
! |
|
7401 |
||
7402 |
isFollowupChange |
|
7403 |
^ isFollowupChange |
|
7404 |
! |
|
7405 |
||
18059 | 7406 |
isMethodCategoryChange |
7407 |
^ categoryIfCategoryChange notNil |
|
7408 |
! |
|
7409 |
||
16372 | 7410 |
position |
7411 |
^ position |
|
7412 |
! |
|
7413 |
||
7414 |
position:positionArg chunk:chunkArg className:classNameArg selector:selectorArg headerLine:headerLineArg |
|
7415 |
timestamp:timestampArg isFollowupChange:isFollowupChangeArg |
|
7416 |
||
7417 |
position := positionArg. |
|
7418 |
chunk := chunkArg. |
|
7419 |
className := classNameArg. |
|
7420 |
selector := selectorArg. |
|
7421 |
headerLine := headerLineArg. |
|
7422 |
timestamp := timestampArg. |
|
7423 |
isFollowupChange := isFollowupChangeArg. |
|
7424 |
||
7425 |
"Created: / 01-05-2016 / 19:01:03 / cg" |
|
7426 |
! |
|
7427 |
||
7428 |
selector |
|
7429 |
^ selector |
|
7430 |
! |
|
7431 |
||
7432 |
selector:something |
|
7433 |
selector := something. |
|
7434 |
! |
|
7435 |
||
7436 |
timestamp |
|
7437 |
^ timestamp |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7438 |
! ! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7439 |
|
761 | 7440 |
!ChangesBrowser class methodsFor:'documentation'! |
202 | 7441 |
|
7442 |
version |
|
15683 | 7443 |
^ '$Header$' |
8978 | 7444 |
! |
7445 |
||
7446 |
version_CVS |
|
15683 | 7447 |
^ '$Header$' |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
7448 |
! ! |
12428 | 7449 |