author | Claus Gittinger <cg@exept.de> |
Mon, 20 Jan 2020 21:02:47 +0100 | |
changeset 19422 | c6ca1c3e0fd7 |
parent 19395 | e269a7cf908a |
child 19512 | 3fe02dbbb6dc |
permissions | -rw-r--r-- |
19263 | 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 |
19288 | 29 |
rightCodeLabelHolder menuPanel toolbarMenu classNameMap' |
17848 | 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 |
|
18596 | 210 |
'Delete this and all previous versions of the selected change' |
211 |
||
16022 | 212 |
) |
17565 | 213 |
|
17597 | 214 |
"Modified: / 25-07-2017 / 10:55:55 / cg" |
18596 | 215 |
"Modified: / 15-02-2019 / 12:29:30 / Claus Gittinger" |
16022 | 216 |
! ! |
217 |
||
218 |
!ChangesBrowser class methodsFor:'menu specs'! |
|
10681 | 219 |
|
3202 | 220 |
menuSpec |
221 |
"This resource specification was automatically generated |
|
222 |
by the MenuEditor of ST/X." |
|
223 |
||
224 |
"Do not manually edit this!! If it is corrupted, |
|
225 |
the MenuEditor may not be able to read the specification." |
|
226 |
||
10719 | 227 |
|
3202 | 228 |
" |
229 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#menuSpec |
|
230 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser menuSpec)) startUp |
|
231 |
" |
|
232 |
||
233 |
<resource: #menu> |
|
234 |
||
7360 | 235 |
^ |
6216 | 236 |
#(Menu |
7096 | 237 |
( |
238 |
(MenuItem |
|
239 |
label: 'File' |
|
17093 | 240 |
submenuChannel: menuSpecFile |
7096 | 241 |
) |
242 |
(MenuItem |
|
18252 | 243 |
label: 'Change_subst' |
17093 | 244 |
submenuChannel: menuSpecChange |
7096 | 245 |
) |
246 |
(MenuItem |
|
247 |
label: 'Search' |
|
17093 | 248 |
submenuChannel: menuSpecSearch |
7096 | 249 |
) |
250 |
(MenuItem |
|
251 |
label: 'Browse' |
|
17093 | 252 |
submenuChannel: menuSpecBrowse |
7096 | 253 |
) |
254 |
(MenuItem |
|
255 |
label: 'Settings' |
|
17093 | 256 |
submenuChannel: menuSpecSettings |
7096 | 257 |
) |
258 |
(MenuItem |
|
7463
e8e74bdbfbda
support '?' as help (for now: controlled by resources)
Claus Gittinger <cg@exept.de>
parents:
7415
diff
changeset
|
259 |
label: 'MENU_Help' |
17093 | 260 |
submenuChannel: menuSpecHelp |
261 |
) |
|
262 |
) |
|
263 |
nil |
|
264 |
nil |
|
265 |
) |
|
17096 | 266 |
|
267 |
"Modified: / 21-11-2016 / 23:46:22 / cg" |
|
18252 | 268 |
"Modified: / 01-07-2018 / 09:24:30 / Claus Gittinger" |
17093 | 269 |
! |
270 |
||
271 |
menuSpecBrowse |
|
272 |
"This resource specification was automatically generated |
|
273 |
by the MenuEditor of ST/X." |
|
274 |
||
275 |
"Do not manually edit this!! If it is corrupted, |
|
276 |
the MenuEditor may not be able to read the specification." |
|
277 |
||
278 |
||
279 |
" |
|
280 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#menuSpecBrowse |
|
281 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser menuSpecBrowse)) startUp |
|
282 |
" |
|
283 |
||
284 |
<resource: #menu> |
|
285 |
||
286 |
^ |
|
287 |
#(Menu |
|
288 |
( |
|
289 |
(MenuItem |
|
290 |
enabled: hasSingleSelection |
|
291 |
label: 'Class' |
|
292 |
itemValue: doBrowse |
|
293 |
) |
|
294 |
(MenuItem |
|
295 |
label: '-' |
|
296 |
) |
|
297 |
(MenuItem |
|
298 |
label: 'Senders...' |
|
299 |
itemValue: doBrowseSenders |
|
300 |
) |
|
301 |
(MenuItem |
|
302 |
label: 'Implementors...' |
|
303 |
itemValue: doBrowseImplementors |
|
304 |
) |
|
305 |
) |
|
306 |
nil |
|
307 |
nil |
|
308 |
) |
|
309 |
! |
|
310 |
||
311 |
menuSpecChange |
|
312 |
"This resource specification was automatically generated |
|
313 |
by the MenuEditor of ST/X." |
|
314 |
||
315 |
"Do not manually edit this!! If it is corrupted, |
|
316 |
the MenuEditor may not be able to read the specification." |
|
317 |
||
318 |
||
319 |
" |
|
320 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#menuSpecChange |
|
321 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser menuSpecChange)) startUp |
|
322 |
" |
|
323 |
||
324 |
<resource: #menu> |
|
325 |
||
326 |
^ |
|
327 |
#(Menu |
|
328 |
( |
|
329 |
(MenuItem |
|
330 |
enabled: hasSelection |
|
331 |
label: 'Apply' |
|
332 |
itemValue: doApply |
|
333 |
) |
|
334 |
(MenuItem |
|
335 |
enabled: hasSingleSelection |
|
336 |
label: 'Apply to End' |
|
337 |
itemValue: doApplyRest |
|
338 |
) |
|
339 |
(MenuItem |
|
340 |
enabled: hasSingleSelection |
|
341 |
label: 'Apply from Begin' |
|
342 |
itemValue: doApplyFromBeginning |
|
343 |
) |
|
344 |
(MenuItem |
|
345 |
enabled: hasSingleSelection |
|
346 |
label: 'Apply for Class to End' |
|
347 |
itemValue: doApplyClassRest |
|
348 |
) |
|
349 |
(MenuItem |
|
350 |
enabled: hasSingleSelection |
|
351 |
label: 'Apply for Class from Begin' |
|
352 |
itemValue: doApplyClassFromBeginning |
|
353 |
) |
|
354 |
(MenuItem |
|
355 |
enabled: hasNoSelection |
|
356 |
label: 'Apply All' |
|
357 |
itemValue: doApplyAll |
|
358 |
) |
|
359 |
(MenuItem |
|
360 |
enabled: hasSingleSelection |
|
361 |
label: 'Apply to Conflict or End' |
|
362 |
itemValue: doApplyToConflictOrEnd |
|
363 |
) |
|
364 |
(MenuItem |
|
365 |
label: '-' |
|
366 |
) |
|
367 |
(MenuItem |
|
368 |
enabled: hasSelection |
|
369 |
label: 'Delete' |
|
370 |
itemValue: doDelete |
|
371 |
) |
|
372 |
(MenuItem |
|
373 |
enabled: hasSingleSelection |
|
374 |
label: 'Delete to End' |
|
375 |
itemValue: doDeleteRest |
|
376 |
) |
|
377 |
(MenuItem |
|
378 |
enabled: hasSingleSelection |
|
379 |
label: 'Delete from Begin' |
|
380 |
itemValue: doDeleteFromBeginning |
|
381 |
) |
|
382 |
(MenuItem |
|
383 |
enabled: hasSingleSelection |
|
384 |
label: 'Delete for Class to End' |
|
385 |
itemValue: doDeleteClassRest |
|
386 |
) |
|
387 |
(MenuItem |
|
388 |
enabled: hasSingleSelection |
|
389 |
label: 'Delete for Class from Begin' |
|
390 |
itemValue: doDeleteClassFromBeginning |
|
391 |
) |
|
392 |
(MenuItem |
|
393 |
enabled: hasSelection |
|
394 |
label: 'Delete all for Class' |
|
395 |
itemValue: doDeleteClassAll |
|
396 |
isVisible: hasNoMultiSelection |
|
397 |
) |
|
398 |
(MenuItem |
|
399 |
enabled: hasSelection |
|
400 |
label: 'Delete all for Class && its Private Classes' |
|
401 |
itemValue: doDeleteClassAndPrivateClassesAll |
|
402 |
isVisible: hasNoMultiSelection |
|
403 |
) |
|
404 |
(MenuItem |
|
405 |
enabled: hasSelection |
|
406 |
label: 'Delete all for Namespace' |
|
407 |
itemValue: doDeleteAllForNamespace |
|
408 |
) |
|
409 |
(MenuItem |
|
410 |
enabled: hasSelection |
|
411 |
label: 'Delete all for Classes' |
|
412 |
itemValue: doDeleteClassAll |
|
413 |
isVisible: hasMultiSelection |
|
414 |
) |
|
415 |
(MenuItem |
|
416 |
enabled: hasSelection |
|
417 |
label: 'Delete all for Classes && their Private Classes' |
|
418 |
itemValue: doDeleteClassAndPrivateClassesAll |
|
419 |
isVisible: hasMultiSelection |
|
420 |
) |
|
421 |
(MenuItem |
|
422 |
label: '-' |
|
423 |
) |
|
424 |
(MenuItem |
|
425 |
enabled: hasSelection |
|
18233 | 426 |
label: 'Delete older Versions of Selected Change' |
17093 | 427 |
itemValue: doDeleteClassSelectorOlder |
428 |
isVisible: hasNoMultiSelectionHolder |
|
429 |
) |
|
430 |
(MenuItem |
|
431 |
enabled: hasSelection |
|
18233 | 432 |
label: 'Delete older Versions of all Selected Changes' |
17093 | 433 |
itemValue: doDeleteClassSelectorOlder |
434 |
isVisible: hasMultiSelectionHolder |
|
435 |
) |
|
436 |
(MenuItem |
|
437 |
enabled: hasSelection |
|
18233 | 438 |
label: 'Delete all Versions of Selected Change' |
17093 | 439 |
itemValue: doDeleteClassSelectorAll |
440 |
isVisible: hasNoMultiSelectionHolder |
|
441 |
) |
|
442 |
(MenuItem |
|
443 |
enabled: hasSelection |
|
18233 | 444 |
label: 'Delete all Versions of all Selected Changes' |
17093 | 445 |
itemValue: doDeleteClassSelectorAll |
446 |
isVisible: hasMultiSelectionHolder |
|
447 |
) |
|
448 |
(MenuItem |
|
449 |
label: '-' |
|
450 |
) |
|
451 |
(MenuItem |
|
452 |
enabled: hasSingleSelection |
|
453 |
label: 'Compare with Current' |
|
454 |
itemValue: doCompare |
|
455 |
) |
|
456 |
(MenuItem |
|
17096 | 457 |
enabled: hasSingleSelection |
458 |
label: 'Copy to Clipboard' |
|
459 |
itemValue: doCopyToClipboard |
|
460 |
) |
|
461 |
(MenuItem |
|
17093 | 462 |
label: '-' |
463 |
) |
|
464 |
(MenuItem |
|
465 |
enabled: hasSelection |
|
466 |
label: 'Make Change a Patch' |
|
467 |
itemValue: doMakePatch |
|
468 |
) |
|
469 |
) |
|
470 |
nil |
|
471 |
nil |
|
472 |
) |
|
17096 | 473 |
|
474 |
"Modified: / 21-11-2016 / 23:46:42 / cg" |
|
18233 | 475 |
"Modified: / 21-06-2018 / 09:11:40 / Claus Gittinger" |
17093 | 476 |
! |
477 |
||
478 |
menuSpecFile |
|
479 |
"This resource specification was automatically generated |
|
480 |
by the MenuEditor of ST/X." |
|
481 |
||
482 |
"Do not manually edit this!! If it is corrupted, |
|
483 |
the MenuEditor may not be able to read the specification." |
|
484 |
||
485 |
||
486 |
" |
|
487 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#menuSpecFile |
|
488 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser menuSpecFile)) startUp |
|
489 |
" |
|
490 |
||
491 |
<resource: #menu> |
|
492 |
||
493 |
^ |
|
494 |
#(Menu |
|
495 |
( |
|
496 |
(MenuItem |
|
497 |
label: 'Compress' |
|
498 |
itemValue: doCompress |
|
499 |
isVisible: notEditingClassSource |
|
500 |
) |
|
501 |
(MenuItem |
|
502 |
enabled: hasSingleSelection |
|
503 |
label: 'Compress for Class' |
|
504 |
itemValue: doCompressClass |
|
505 |
isVisible: notEditingClassSource |
|
506 |
) |
|
507 |
(MenuItem |
|
508 |
enabled: hasSingleSelection |
|
509 |
label: 'Compress for Class && Selector' |
|
510 |
itemValue: doCompressSelector |
|
511 |
isVisible: notEditingClassSource |
|
512 |
) |
|
513 |
(MenuItem |
|
514 |
label: 'Compare and Compress' |
|
515 |
itemValue: doCompareAndCompress |
|
516 |
isVisible: notEditingClassSource |
|
517 |
) |
|
518 |
(MenuItem |
|
519 |
label: '-' |
|
520 |
isVisible: notEditingClassSource |
|
521 |
) |
|
522 |
(MenuItem |
|
18059 | 523 |
label: 'Cleanup' |
524 |
itemValue: doCleanup |
|
525 |
isVisible: notEditingClassSource |
|
526 |
) |
|
527 |
(MenuItem |
|
528 |
label: '-' |
|
529 |
isVisible: notEditingClassSource |
|
530 |
) |
|
531 |
(MenuItem |
|
17093 | 532 |
enabled: hasSingleSelection |
533 |
label: 'Fileout && Delete all Changes for Class' |
|
534 |
itemValue: doFileoutAndDeleteClassAll |
|
535 |
isVisible: notEditingClassSource |
|
536 |
) |
|
537 |
(MenuItem |
|
538 |
enabled: hasSelection |
|
539 |
label: 'CheckIn && Delete all Changes for Class' |
|
540 |
itemValue: doCheckinAndDeleteClassAll |
|
541 |
isVisible: notEditingClassSource |
|
542 |
) |
|
543 |
(MenuItem |
|
544 |
label: '-' |
|
545 |
isVisible: notEditingClassSource |
|
546 |
) |
|
547 |
(MenuItem |
|
548 |
enabled: hasSelection |
|
549 |
label: 'Save In...' |
|
550 |
itemValue: doSave |
|
551 |
) |
|
552 |
(MenuItem |
|
553 |
enabled: hasSingleSelection |
|
554 |
label: 'Save to End In...' |
|
555 |
itemValue: doSaveRest |
|
556 |
) |
|
557 |
(MenuItem |
|
558 |
enabled: hasSingleSelection |
|
559 |
label: 'Save for Class to End In...' |
|
560 |
itemValue: doSaveClassRest |
|
561 |
) |
|
562 |
(MenuItem |
|
563 |
enabled: hasSingleSelection |
|
564 |
label: 'Save all for Class In...' |
|
565 |
itemValue: doSaveClassAll |
|
566 |
) |
|
567 |
(MenuItem |
|
568 |
label: '-' |
|
569 |
) |
|
570 |
(MenuItem |
|
571 |
label: 'Writeback ClassFile' |
|
572 |
itemValue: doWriteBack |
|
573 |
isVisible: editingClassSource |
|
574 |
) |
|
575 |
(MenuItem |
|
576 |
label: 'Writeback ChangeFile' |
|
577 |
itemValue: doWriteBack |
|
578 |
isVisible: notEditingClassSource |
|
579 |
) |
|
580 |
(MenuItem |
|
581 |
label: '-' |
|
582 |
) |
|
583 |
(MenuItem |
|
584 |
label: 'Update' |
|
585 |
itemValue: doUpdate |
|
586 |
) |
|
587 |
(MenuItem |
|
588 |
label: '-' |
|
589 |
) |
|
590 |
(MenuItem |
|
591 |
label: 'Exit' |
|
592 |
itemValue: menuExit |
|
593 |
) |
|
594 |
) |
|
595 |
nil |
|
596 |
nil |
|
597 |
) |
|
598 |
! |
|
599 |
||
600 |
menuSpecHelp |
|
601 |
"This resource specification was automatically generated |
|
602 |
by the MenuEditor of ST/X." |
|
603 |
||
604 |
"Do not manually edit this!! If it is corrupted, |
|
605 |
the MenuEditor may not be able to read the specification." |
|
606 |
||
607 |
||
608 |
" |
|
609 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#menuSpecHelp |
|
610 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser menuSpecHelp)) startUp |
|
611 |
" |
|
612 |
||
613 |
<resource: #menu> |
|
614 |
||
615 |
^ |
|
616 |
#(Menu |
|
617 |
( |
|
618 |
(MenuItem |
|
619 |
label: 'ChangesBrowser Documentation' |
|
620 |
itemValue: openHTMLDocument: |
|
621 |
argument: 'tools/cbrowser/TOP.html' |
|
622 |
) |
|
623 |
(MenuItem |
|
624 |
label: '-' |
|
625 |
) |
|
626 |
(MenuItem |
|
627 |
label: 'About ChangesBrowser...' |
|
628 |
itemValue: openAboutThisApplication |
|
629 |
) |
|
630 |
) |
|
631 |
nil |
|
632 |
nil |
|
633 |
) |
|
634 |
! |
|
635 |
||
636 |
menuSpecSearch |
|
637 |
"This resource specification was automatically generated |
|
638 |
by the MenuEditor of ST/X." |
|
639 |
||
640 |
"Do not manually edit this!! If it is corrupted, |
|
641 |
the MenuEditor may not be able to read the specification." |
|
642 |
||
643 |
||
644 |
" |
|
645 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#menuSpecSearch |
|
646 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser menuSpecSearch)) startUp |
|
647 |
" |
|
648 |
||
649 |
<resource: #menu> |
|
650 |
||
651 |
^ |
|
652 |
#(Menu |
|
653 |
( |
|
654 |
(MenuItem |
|
655 |
label: 'Class...' |
|
656 |
itemValue: findClass |
|
657 |
) |
|
658 |
(MenuItem |
|
659 |
enabled: hasSelection |
|
660 |
label: 'First for Class' |
|
661 |
itemValue: findFirstForClass |
|
662 |
) |
|
663 |
(MenuItem |
|
664 |
enabled: hasSelection |
|
665 |
label: 'Previous for Class' |
|
666 |
itemValue: findPreviousForClass |
|
667 |
) |
|
668 |
(MenuItem |
|
669 |
enabled: hasSelection |
|
670 |
label: 'Next for Class' |
|
671 |
itemValue: findNextForClass |
|
672 |
) |
|
673 |
(MenuItem |
|
674 |
enabled: hasSelection |
|
675 |
label: 'Last for Class' |
|
676 |
itemValue: findLastForClass |
|
677 |
) |
|
678 |
(MenuItem |
|
679 |
label: '-' |
|
680 |
) |
|
681 |
(MenuItem |
|
682 |
label: 'Selector...' |
|
683 |
itemValue: findSelector |
|
684 |
) |
|
685 |
(MenuItem |
|
686 |
enabled: hasSelection |
|
687 |
label: 'Previous for Selector' |
|
688 |
itemValue: findPreviousForSelector |
|
689 |
) |
|
690 |
(MenuItem |
|
691 |
enabled: hasSelection |
|
692 |
label: 'Next for Selector' |
|
693 |
itemValue: findNextForSelector |
|
694 |
) |
|
695 |
(MenuItem |
|
696 |
label: '-' |
|
697 |
) |
|
698 |
(MenuItem |
|
699 |
label: 'String...' |
|
700 |
itemValue: findString |
|
701 |
) |
|
702 |
(MenuItem |
|
703 |
enabled: hasSelection |
|
704 |
label: 'Previous with String' |
|
705 |
itemValue: findPreviousForString |
|
706 |
) |
|
707 |
(MenuItem |
|
708 |
enabled: hasSelection |
|
709 |
label: 'Next with String' |
|
710 |
itemValue: findNextForString |
|
711 |
) |
|
712 |
(MenuItem |
|
713 |
label: '-' |
|
714 |
) |
|
715 |
(MenuItem |
|
716 |
enabled: hasSelection |
|
717 |
label: 'Previous Difference' |
|
718 |
itemValue: findPreviousDifference |
|
719 |
) |
|
720 |
(MenuItem |
|
721 |
enabled: hasSelection |
|
722 |
label: 'Next Difference' |
|
723 |
itemValue: findNextDifference |
|
724 |
) |
|
725 |
(MenuItem |
|
726 |
label: '-' |
|
727 |
) |
|
728 |
(MenuItem |
|
729 |
enabled: hasSelection |
|
730 |
label: 'Previous Snapshot' |
|
731 |
itemValue: findPreviousSnapshot |
|
732 |
) |
|
733 |
(MenuItem |
|
734 |
enabled: hasSelection |
|
735 |
label: 'Next Snapshot' |
|
736 |
itemValue: findNextSnapshot |
|
737 |
) |
|
738 |
(MenuItem |
|
739 |
label: 'Last Snapshot' |
|
740 |
itemValue: findLastSnapshot |
|
741 |
) |
|
742 |
) |
|
743 |
nil |
|
744 |
nil |
|
745 |
) |
|
746 |
! |
|
747 |
||
748 |
menuSpecSettings |
|
749 |
"This resource specification was automatically generated |
|
750 |
by the MenuEditor of ST/X." |
|
751 |
||
752 |
"Do not manually edit this!! If it is corrupted, |
|
753 |
the MenuEditor may not be able to read the specification." |
|
754 |
||
755 |
||
756 |
" |
|
757 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#menuSpecSettings |
|
758 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser menuSpecSettings)) startUp |
|
759 |
" |
|
760 |
||
761 |
<resource: #menu> |
|
762 |
||
763 |
^ |
|
19288 | 764 |
#(Menu |
765 |
(MenuItem |
|
766 |
label: 'Auto Compare' |
|
767 |
indication: autoCompare |
|
768 |
) |
|
769 |
(MenuItem |
|
770 |
label: 'Autoload As Required' |
|
771 |
indication: autoloadAsRequired |
|
772 |
) |
|
773 |
(MenuItem |
|
774 |
label: 'Show Diffs' |
|
775 |
indication: showingDiffs |
|
776 |
) |
|
777 |
(MenuItem |
|
778 |
label: 'Auto Update' |
|
779 |
indication: autoUpdate |
|
780 |
) |
|
781 |
(MenuItem |
|
782 |
label: '-' |
|
783 |
) |
|
784 |
(MenuItem |
|
785 |
label: 'Add to ChangeSet when Applying' |
|
786 |
indication: updateChangeSet |
|
787 |
) |
|
788 |
(MenuItem |
|
789 |
label: 'Ignore Public/Private in Categories (Dolphin code)' |
|
790 |
itemValue: ignorePublicPrivateCategories: |
|
791 |
isVisible: false |
|
792 |
indication: ignorePublicPrivateCategories |
|
793 |
) |
|
794 |
(MenuItem |
|
795 |
label: '-' |
|
796 |
) |
|
797 |
(MenuItem |
|
798 |
label: 'Apply into Package...' |
|
799 |
itemValue: setEnforcedPackage |
|
800 |
) |
|
801 |
(MenuItem |
|
802 |
label: 'Apply into NameSpace...' |
|
803 |
itemValue: setEnforcedNameSpace |
|
804 |
) |
|
805 |
(MenuItem |
|
806 |
label: 'Class Mapping...' |
|
807 |
itemValue: doAddToClassMap |
|
808 |
) |
|
809 |
(MenuItem |
|
810 |
label: '-' |
|
811 |
) |
|
812 |
(MenuItem |
|
813 |
label: 'Settings...' |
|
814 |
itemValue: openSettingsDialog |
|
815 |
) |
|
816 |
) |
|
10681 | 817 |
! |
818 |
||
819 |
toolbarMenuSpec |
|
820 |
"This resource specification was automatically generated |
|
821 |
by the MenuEditor of ST/X." |
|
822 |
||
823 |
"Do not manually edit this!! If it is corrupted, |
|
824 |
the MenuEditor may not be able to read the specification." |
|
825 |
||
826 |
||
827 |
" |
|
828 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#toolbarMenuSpec |
|
829 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser toolbarMenuSpec)) startUp |
|
830 |
" |
|
831 |
||
832 |
<resource: #menu> |
|
833 |
||
834 |
^ |
|
835 |
#(Menu |
|
836 |
( |
|
837 |
(MenuItem |
|
838 |
activeHelpKey: applyChange |
|
839 |
enabled: hasSelectionHolder |
|
840 |
label: 'Apply' |
|
841 |
itemValue: doApply |
|
842 |
translateLabel: true |
|
843 |
isButton: true |
|
844 |
labelImage: (ResourceRetriever ToolbarIconLibrary executeMethod20x20Icon) |
|
845 |
) |
|
846 |
(MenuItem |
|
847 |
label: '-' |
|
848 |
) |
|
849 |
(MenuItem |
|
850 |
activeHelpKey: deleteAllForClass |
|
851 |
enabled: hasSelectionHolder |
|
15016 | 852 |
isVisible: canDeleteChanges |
10681 | 853 |
label: 'Delete all for Class' |
854 |
itemValue: doDeleteClassAll |
|
855 |
translateLabel: true |
|
856 |
isButton: true |
|
857 |
labelImage: (ResourceRetriever ToolbarIconLibrary deleteClass24x24Icon) |
|
858 |
) |
|
13991 | 859 |
(MenuItem |
16022 | 860 |
activeHelpKey: deleteForClassFromBegin |
861 |
enabled: hasSelectionHolder |
|
862 |
isVisible: canDeleteChanges |
|
863 |
label: 'Delete for Class from Beginning' |
|
864 |
itemValue: doDeleteClassFromBeginning |
|
865 |
translateLabel: true |
|
866 |
isButton: true |
|
867 |
labelImage: (ResourceRetriever ToolbarIconLibrary deleteClassFromStart24x24Icon) |
|
868 |
) |
|
869 |
(MenuItem |
|
13991 | 870 |
activeHelpKey: deleteForClassToEnd |
871 |
enabled: hasSelectionHolder |
|
15016 | 872 |
isVisible: canDeleteChanges |
13991 | 873 |
label: 'Delete for Class to End' |
874 |
itemValue: doDeleteClassRest |
|
875 |
translateLabel: true |
|
876 |
isButton: true |
|
877 |
labelImage: (ResourceRetriever ToolbarIconLibrary deleteClassToEnd24x24Icon) |
|
878 |
) |
|
17565 | 879 |
(MenuItem |
880 |
label: '-' |
|
881 |
) |
|
882 |
(MenuItem |
|
883 |
activeHelpKey: deleteClassSelectorAll |
|
884 |
enabled: hasSelectionHolder |
|
885 |
isVisible: canDeleteChanges |
|
18233 | 886 |
label: 'Delete all versions of this change' |
17565 | 887 |
itemValue: doDeleteClassSelectorAll |
888 |
translateLabel: true |
|
889 |
isButton: true |
|
890 |
labelImage: (ResourceRetriever ToolbarIconLibrary deleteMethod24x24Icon) |
|
891 |
) |
|
892 |
(MenuItem |
|
893 |
activeHelpKey: deleteClassSelectorOlder |
|
894 |
enabled: hasSelectionHolder |
|
895 |
isVisible: canDeleteChanges |
|
18596 | 896 |
label: 'Delete this and older versions of this change' |
17565 | 897 |
itemValue: doDeleteClassSelectorOlder |
898 |
translateLabel: true |
|
899 |
isButton: true |
|
900 |
labelImage: (ResourceRetriever ToolbarIconLibrary deleteMethodFromStart24x24Icon) |
|
901 |
) |
|
10681 | 902 |
) |
903 |
nil |
|
904 |
nil |
|
905 |
) |
|
17565 | 906 |
|
907 |
"Modified: / 07-07-2017 / 12:52:28 / cg" |
|
18596 | 908 |
"Modified: / 15-02-2019 / 12:28:27 / Claus Gittinger" |
3202 | 909 |
! ! |
910 |
||
3674 | 911 |
!ChangesBrowser class methodsFor:'private-changeFile access'! |
912 |
||
913 |
readXMLChangesFrom:aStream inBackground:inBackground |
|
914 |
"read an XML source file (format as in campSmalltalk DTD)" |
|
915 |
||
916 |
|changeSet| |
|
917 |
||
918 |
(XML isNil or:[XML::SourceNodeBuilder isNil or:[XML::XMLParser isNil]]) ifTrue:[ |
|
6288 | 919 |
Smalltalk loadPackage:'stx:goodies/xml/vw'. |
920 |
(XML isNil or:[XML::SourceNodeBuilder isNil or:[XML::XMLParser isNil]]) ifTrue:[ |
|
921 |
self error:'Could not load XML package(s) from ''stx:goodies/xml/vw'''. |
|
922 |
] |
|
3674 | 923 |
]. |
924 |
||
925 |
changeSet := ChangeSet new. |
|
6288 | 926 |
XML::SourceScannerNodeBuilder new |
927 |
scanFile:aStream |
|
928 |
do:[:eachChange | |
|
929 |
changeSet addChange:eachChange. |
|
930 |
]. |
|
3674 | 931 |
^ changeSet |
932 |
||
933 |
"/ builder := XML::SourceScannerNodeBuilder new. |
|
934 |
"/ parser := XML::XMLParser on:aStream. |
|
935 |
"/ parser builder:builder. |
|
936 |
"/ parser validate:false. |
|
937 |
"/ parser scanDocument. |
|
938 |
! |
|
939 |
||
940 |
readXMLChangesFromFile:changeFileName inBackground:inBackground |
|
14011 | 941 |
|set| |
942 |
||
943 |
changeFileName asFilename readingFileDo:[:s| |
|
944 |
set := self readXMLChangesFrom:s inBackground:false. |
|
945 |
]. |
|
3674 | 946 |
^ set. |
947 |
! ! |
|
948 |
||
949 |
!ChangesBrowser class methodsFor:'utilities'! |
|
950 |
||
951 |
isXMLFile:aFilename |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
952 |
|stream first| |
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
953 |
|
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
954 |
stream := aFilename asFilename readStreamOrNil. |
3674 | 955 |
stream isNil ifTrue:[^ false]. |
956 |
||
957 |
stream skipSeparators. |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
958 |
first := stream peek. |
3674 | 959 |
stream close. |
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
960 |
^ first == $< |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
961 |
! |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
962 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
963 |
methodDefinitionSelectors |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
964 |
^ #( |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
965 |
#'methodsFor:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
966 |
#'privateMethodsFor:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
967 |
#'publicMethodsFor:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
968 |
#'ignoredMethodsFor:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
969 |
#'protectedMethodsFor:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
970 |
#'methodsFor:stamp:' "/ Squeak support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
971 |
#'commentStamp:prior:' "/ Squeak support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
972 |
#methodsFor "/ Dolphin support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
973 |
#categoriesForClass "/ Dolphin support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
974 |
#'categoriesFor:' "/ Dolphin support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
975 |
#methods "/ STV support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
976 |
#publicMethods "/ STV / V'Age support |
6532 | 977 |
#privateMethods "/ STV / V'Age support |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
978 |
#'methodsForUndefined:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
979 |
) |
3674 | 980 |
! ! |
981 |
||
3202 | 982 |
!ChangesBrowser methodsFor:'aspects'! |
983 |
||
984 |
applyInOriginalNameSpace |
|
985 |
^ applyInOriginalNameSpace |
|
986 |
! |
|
987 |
||
3472 | 988 |
applyNotInOriginalNameSpace |
6288 | 989 |
^ BlockValue forLogicalNot:self applyInOriginalNameSpace |
3472 | 990 |
! |
991 |
||
3202 | 992 |
autoCompare |
993 |
^ autoCompare |
|
994 |
! |
|
995 |
||
996 |
autoUpdate |
|
997 |
"enabled/disable automatic update from the change-file (for monitoring)" |
|
998 |
||
999 |
^ autoUpdate |
|
1000 |
||
1001 |
"Created: 3.12.1995 / 14:14:24 / cg" |
|
1002 |
"Modified: 3.12.1995 / 14:20:45 / cg" |
|
1003 |
! |
|
1004 |
||
6216 | 1005 |
autoloadAsRequired |
1006 |
^ autoloadAsRequired |
|
1007 |
! |
|
1008 |
||
15016 | 1009 |
canDeleteChanges |
1010 |
"makes the delete buttons in the toolbar visible" |
|
1011 |
||
1012 |
^ true. |
|
1013 |
! |
|
1014 |
||
11048 | 1015 |
changeListSelectionHolder |
1016 |
changeListSelectionHolder isNil ifTrue:[ |
|
1017 |
changeListSelectionHolder := nil asValue. |
|
1018 |
]. |
|
1019 |
^ changeListSelectionHolder |
|
1020 |
||
1021 |
"Created: / 03-01-2012 / 15:19:25 / cg" |
|
1022 |
! |
|
1023 |
||
3202 | 1024 |
editingClassSource |
3203 | 1025 |
^ editingClassSource ? false |
3202 | 1026 |
! |
1027 |
||
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1028 |
hasMultiSelection |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1029 |
^ self hasSelection and:[self hasSingleSelection not] |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1030 |
! |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1031 |
|
11028 | 1032 |
hasMultiSelectionHolder |
1033 |
^ [ self hasMultiSelection ] |
|
1034 |
||
1035 |
"Created: / 25-12-2011 / 11:21:52 / cg" |
|
1036 |
! |
|
1037 |
||
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1038 |
hasNoMultiSelection |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1039 |
^ self hasMultiSelection not |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1040 |
! |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1041 |
|
11028 | 1042 |
hasNoMultiSelectionHolder |
1043 |
^ [ self hasNoMultiSelection ] |
|
1044 |
||
1045 |
"Created: / 25-12-2011 / 11:21:20 / cg" |
|
1046 |
! |
|
1047 |
||
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1048 |
hasNoSelection |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1049 |
^ self hasSelection not |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1050 |
! |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1051 |
|
3202 | 1052 |
hasSelection |
17924 | 1053 |
"true if a change is selected" |
1054 |
||
6288 | 1055 |
^ changeListView hasSelection |
3202 | 1056 |
! |
1057 |
||
11048 | 1058 |
hasSelectionHolder |
1059 |
^ BlockValue |
|
1060 |
with:[:v | v notEmptyOrNil ] |
|
1061 |
argument:(self changeListSelectionHolder) |
|
1062 |
||
1063 |
"Created: / 03-01-2012 / 15:15:47 / cg" |
|
1064 |
! |
|
1065 |
||
3211 | 1066 |
hasSingleSelection |
1067 |
changeListView multipleSelectOk ifTrue:[ |
|
6288 | 1068 |
^ changeListView selection size == 1 |
3211 | 1069 |
]. |
1070 |
^ changeListView hasSelection |
|
1071 |
! |
|
1072 |
||
10719 | 1073 |
ignorePublicPrivateCategories |
1074 |
^ ignorePublicPrivateCategories |
|
1075 |
||
1076 |
"Created: / 23-09-2011 / 19:42:46 / cg" |
|
1077 |
! |
|
1078 |
||
18136 | 1079 |
leftCodeLabel:aString |
1080 |
"change the string shown above the left codeView (defaults to: 'Current')" |
|
1081 |
||
1082 |
self leftCodeLabelHolder value:aString |
|
1083 |
||
1084 |
"Created: / 07-12-2017 / 12:28:37 / cg" |
|
1085 |
! |
|
1086 |
||
17848 | 1087 |
leftCodeLabelHolder |
1088 |
"holds the string shown above the left codeView (defaults to: 'Current')" |
|
1089 |
||
1090 |
^ leftCodeLabelHolder |
|
1091 |
||
1092 |
"Created: / 07-12-2017 / 12:28:31 / cg" |
|
1093 |
! |
|
1094 |
||
3202 | 1095 |
notEditingClassSource |
1096 |
^ self editingClassSource not |
|
3211 | 1097 |
! |
1098 |
||
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1099 |
notEditingClassSourceAndNotReadOnly |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1100 |
^ (self editingClassSource or:[readOnly == true]) not |
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 |
|
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1103 |
notReadOnly |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1104 |
^ (readOnly ~~ true) |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1105 |
! |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1106 |
|
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1107 |
readOnly:aBoolean |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1108 |
readOnly := aBoolean |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1109 |
! |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1110 |
|
18136 | 1111 |
rightCodeLabel:aString |
1112 |
"change the string shown above the right codeView (defaults to: 'Change')" |
|
1113 |
||
1114 |
self rightCodeLabelHolder value:aString |
|
1115 |
||
1116 |
"Created: / 07-12-2017 / 12:28:37 / cg" |
|
1117 |
! |
|
1118 |
||
17848 | 1119 |
rightCodeLabelHolder |
1120 |
"holds the string shown above the right codeView (defaults to: 'Change')" |
|
1121 |
||
1122 |
^ rightCodeLabelHolder |
|
1123 |
||
1124 |
"Created: / 07-12-2017 / 12:28:37 / cg" |
|
1125 |
! |
|
1126 |
||
4487 | 1127 |
showingDiffs |
1128 |
showingDiffs isNil ifTrue:[ |
|
6288 | 1129 |
showingDiffs := self showingDiffsDefault asValue. |
1130 |
showingDiffs |
|
1131 |
onChangeEvaluate:[ |
|
1132 |
showingDiffs value ifTrue:[ |
|
1133 |
self updateDiffView. |
|
1134 |
self makeDiffViewVisible |
|
1135 |
] ifFalse:[ |
|
1136 |
self makeDiffViewInvisible |
|
1137 |
]. |
|
1138 |
DefaultShowingDiffs := showingDiffs value. |
|
1139 |
] |
|
4487 | 1140 |
]. |
1141 |
^ showingDiffs |
|
1142 |
! |
|
1143 |
||
4943 | 1144 |
showingDiffsDefault |
1145 |
^ (DefaultShowingDiffs ? true) |
|
1146 |
! |
|
1147 |
||
3211 | 1148 |
theSingleSelection |
1149 |
|sel| |
|
1150 |
||
1151 |
sel := changeListView selection. |
|
1152 |
changeListView multipleSelectOk ifTrue:[ |
|
6288 | 1153 |
sel size == 1 ifTrue:[ |
1154 |
^ sel first |
|
1155 |
]. |
|
1156 |
^ nil |
|
3211 | 1157 |
]. |
1158 |
^ sel. |
|
3319 | 1159 |
! |
1160 |
||
1161 |
updateChangeSet |
|
1162 |
^ updateChangeSet |
|
3202 | 1163 |
! ! |
1164 |
||
202 | 1165 |
!ChangesBrowser methodsFor:'compiler interface'! |
1166 |
||
1167 |
wantChangeLog |
|
1168 |
"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
|
1169 |
be written when compiling. Return false here." |
202 | 1170 |
|
1171 |
^ false |
|
1172 |
! ! |
|
1173 |
||
4869 | 1174 |
!ChangesBrowser methodsFor:'compiler interface-error handling'! |
202 | 1175 |
|
1176 |
correctableError:aString position:relPos to:relEndPos from:aCompiler |
|
12656 | 1177 |
"compiler notifies us of an error - this should really not happen since |
202 | 1178 |
changes ought to be correct (did someone edit the changes file ??). |
1179 |
Show the bad change in the codeView and let codeView hilight the error; |
|
1180 |
no corrections allowed here therefore return false" |
|
1181 |
||
2293 | 1182 |
ShowWarningDialogs == true ifTrue:[ |
12656 | 1183 |
self error:aString position:relPos to:relEndPos from:aCompiler. |
2293 | 1184 |
] ifFalse:[ |
12656 | 1185 |
Transcript showCR:aString. |
2293 | 1186 |
]. |
202 | 1187 |
^ false |
1188 |
! |
|
1189 |
||
2555 | 1190 |
correctableSelectorWarning:aString position:relPos to:relEndPos from:aCompiler |
12656 | 1191 |
"compiler notifies us of a warning" |
2555 | 1192 |
|
1193 |
^ false |
|
1194 |
||
1195 |
"Modified: / 19.1.2000 / 16:25:31 / cg" |
|
1196 |
"Created: / 19.1.2000 / 16:27:23 / cg" |
|
1197 |
! |
|
1198 |
||
9621
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1199 |
correctableWarning:aString position:relPos to:relEndPos from:aCompiler |
12656 | 1200 |
"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
|
1201 |
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
|
1202 |
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
|
1203 |
no corrections allowed here therefore return false" |
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1204 |
|
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1205 |
^ self correctableError:aString position:relPos to:relEndPos from:aCompiler |
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1206 |
|
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1207 |
"Created: / 02-11-2010 / 13:29:52 / cg" |
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1208 |
! |
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1209 |
|
202 | 1210 |
error:aString position:relPos to:relEndPos from:aCompiler |
12656 | 1211 |
"compiler notifies us of an error - this should really not happen since |
202 | 1212 |
changes ought to be correct (did someone edit the changes file ??). |
1213 |
Show the bad change in the codeView and let codeView hilight the error" |
|
1214 |
||
1215 |
|action| |
|
1216 |
||
1217 |
(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
|
1218 |
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
|
1219 |
]. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1220 |
|
12973 | 1221 |
"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
|
1222 |
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
|
1223 |
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
|
1224 |
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
|
1225 |
|box| |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1226 |
|
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1227 |
" |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1228 |
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
|
1229 |
" |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1230 |
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
|
1231 |
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
|
1232 |
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
|
1233 |
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
|
1234 |
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
|
1235 |
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
|
1236 |
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
|
1237 |
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
|
1238 |
]. |
2293 | 1239 |
|
1240 |
"/ action == #shutUp ifTrue:[ |
|
1241 |
"/ aCompiler ignoreWarnings. |
|
6288 | 1242 |
"/ ^ false |
2293 | 1243 |
"/ ]. |
1244 |
||
7783
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1245 |
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
|
1246 |
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
|
1247 |
^ false |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1248 |
]. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1249 |
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
|
1250 |
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
|
1251 |
^ false |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1252 |
]. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1253 |
^ false |
202 | 1254 |
]. |
1255 |
^ codeView error:aString position:relPos to:relEndPos from:aCompiler |
|
373 | 1256 |
|
3436
c4fe19deba58
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3406
diff
changeset
|
1257 |
"Modified: / 16.11.2001 / 17:38:10 / cg" |
202 | 1258 |
! |
1259 |
||
3064 | 1260 |
unusedVariableWarning:aString position:relPos to:relEndPos from:aCompiler |
1261 |
"compiler notifies us of a (or some) unused variables; |
|
1262 |
hilight the error (relPos to relEndPos) and show a Box asking for continue/correct/abort; |
|
1263 |
this method should return true to the compiler if user wants the error |
|
1264 |
to be corrected; false otherwise" |
|
1265 |
||
1266 |
^ false |
|
1267 |
! |
|
1268 |
||
202 | 1269 |
warning:aString position:relPos to:relEndPos from:aCompiler |
12656 | 1270 |
"compiler notifies us of a warning - ignore it" |
202 | 1271 |
|
1272 |
^ self |
|
1273 |
! ! |
|
1274 |
||
2604 | 1275 |
!ChangesBrowser methodsFor:'event handling'! |
202 | 1276 |
|
1277 |
handlesKeyPress:key inView:view |
|
1278 |
"this method is reached via delegation: are we prepared to handle |
|
1279 |
a keyPress in some other view ?" |
|
1280 |
||
1127 | 1281 |
<resource: #keyboard (#Delete #BackSpace #Accept #Find #FindPrev #FindNext)> |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
1282 |
|
202 | 1283 |
view == changeListView ifTrue:[ |
6288 | 1284 |
(key == #Delete |
1285 |
or:[key == #BackSpace |
|
1286 |
or:[key == #Accept |
|
1287 |
or:[key == #Find |
|
1288 |
or:[key == #FindPrev |
|
1289 |
or:[key == #FindNext]]]]]) ifTrue:[^ true]. |
|
202 | 1290 |
]. |
1291 |
^ false |
|
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
1292 |
|
1127 | 1293 |
"Modified: 8.4.1997 / 11:01:42 / cg" |
0 | 1294 |
! |
1295 |
||
202 | 1296 |
keyPress:key x:x y:y view:view |
1297 |
"this method is reached via delegation from the changeListView" |
|
1298 |
||
1127 | 1299 |
<resource: #keyboard (#Delete #BackSpace #Accept #Find #FindPrev #FindNext)> |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
1300 |
|
3249 | 1301 |
(key == #Delete) ifTrue:[ |
13078 | 1302 |
self sensor shiftDown ifTrue:[ |
1303 |
self doDeleteAndSelectPrevious. |
|
1304 |
] ifFalse:[ |
|
1305 |
self doDelete. |
|
1306 |
]. |
|
1307 |
^ self |
|
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
1308 |
]. |
3249 | 1309 |
(key == #BackSpace) ifTrue:[ |
13078 | 1310 |
self doDelete. "/ doDeleteAndSelectPrevious. |
1311 |
^ self |
|
3249 | 1312 |
]. |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
1313 |
(key == #Accept) ifTrue:[ |
13078 | 1314 |
self doApply. |
1315 |
^ self |
|
202 | 1316 |
]. |
1127 | 1317 |
(key == #Find) ifTrue:[ |
13078 | 1318 |
self findClass. |
1319 |
^ self |
|
1127 | 1320 |
]. |
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1321 |
(key == #FindPrev) ifTrue:[ |
13078 | 1322 |
self findPrevious. |
1323 |
^ self |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1324 |
]. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1325 |
(key == #FindNext) ifTrue:[ |
13078 | 1326 |
self findNext. |
1327 |
^ self |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1328 |
]. |
202 | 1329 |
changeListView keyPress:key x:x y:y |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
1330 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
1331 |
"Modified: / 18.6.1998 / 22:15:36 / cg" |
202 | 1332 |
! ! |
1333 |
||
3327 | 1334 |
!ChangesBrowser methodsFor:'help'! |
202 | 1335 |
|
394 | 1336 |
showActivity:someMessage |
502 | 1337 |
"some activityNotification to be forwarded to the user; |
1338 |
show it in the windows title area here." |
|
1339 |
||
11346 | 1340 |
someMessage isNil ifTrue:[ |
1341 |
self newLabel:'' |
|
11347 | 1342 |
] ifFalse:[ |
1343 |
self label:someMessage |
|
1344 |
]. |
|
394 | 1345 |
|
1346 |
"Created: 24.2.1996 / 19:35:42 / cg" |
|
502 | 1347 |
"Modified: 23.4.1996 / 21:39:36 / cg" |
202 | 1348 |
! ! |
1349 |
||
4868 | 1350 |
!ChangesBrowser methodsFor:'initialization & release'! |
202 | 1351 |
|
3202 | 1352 |
autoCompareChanged |
1353 |
"sent from the compare-toggle" |
|
1354 |
||
3534 | 1355 |
|doCompare| |
1356 |
||
13373 | 1357 |
self askIfChangesAreToBeWrittenBack. |
1358 |
||
3534 | 1359 |
doCompare := autoCompare value. |
1360 |
DefaultAutoCompare := doCompare. |
|
1361 |
self setupTabSpec. |
|
1362 |
doCompare ifTrue:[ |
|
13373 | 1363 |
self doUpdate |
3202 | 1364 |
] ifFalse:[ |
13373 | 1365 |
changeListView invalidate. "/ clear; redraw. |
3202 | 1366 |
] |
1367 |
! |
|
1368 |
||
202 | 1369 |
changeListMenu |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1370 |
"return the menu for the change (upper) list" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1371 |
|
586 | 1372 |
<resource: #keyboard ( #Accept #Delete ) > |
1359 | 1373 |
<resource: #programMenu > |
586 | 1374 |
|
3211 | 1375 |
|items m replNext replPrev sel| |
1670
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1376 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
1377 |
self sensor ctrlDown ifTrue:[ |
7360 | 1378 |
"/ notice - findNext/prev shortKeys will search for the same thing again. |
1379 |
items := #( |
|
1380 |
('Search Class...' findClass #Find ) |
|
1381 |
('Previous for this Class' findPreviousForClass #FindPrevClass ) |
|
1382 |
('Next for this Class' findNextForClass #FindNextClass ) |
|
1383 |
('-' ) |
|
1384 |
('Search Selector...' findSelector ) |
|
1385 |
('Previous with this Selector' findPreviousForSelector #FindPrevSelector ) |
|
1386 |
('Next with this Selector' findNextForSelector #FindNextSelector ) |
|
1387 |
('-' ) |
|
1388 |
('Search String...' findString ) |
|
1389 |
('Previous with this String' findPreviousForString #FindPrevString ) |
|
1390 |
('Next with this String' findNextForString #FindNextString ) |
|
1391 |
('-' ) |
|
1392 |
('Previous Snapshot' findPreviousSnapshot #FindPrevSnapshot ) |
|
1393 |
('Next Snapshot' findNextSnapshot #FindNextSnapshot ) |
|
1394 |
). |
|
1395 |
||
1396 |
lastSearchType == #selector ifTrue:[ |
|
1397 |
replNext := #FindNextSelector. |
|
1398 |
replPrev := #FindPrevSelector. |
|
1399 |
] ifFalse:[ |
|
1400 |
lastSearchType == #snapshot ifTrue:[ |
|
1401 |
replNext := #FindNextSnapshot. |
|
1402 |
replPrev := #FindPrevSnapshot. |
|
1403 |
] ifFalse:[ |
|
1404 |
lastSearchType == #string ifTrue:[ |
|
1405 |
replNext := #FindNextString. |
|
1406 |
replPrev := #FindPrevString. |
|
1407 |
] ifFalse:[ |
|
1408 |
replNext := #FindNextClass. |
|
1409 |
replPrev := #FindPrevClass. |
|
1410 |
] |
|
1411 |
] |
|
1412 |
]. |
|
1413 |
items := items deepCopy. |
|
1414 |
items do:[:each | |
|
1415 |
each replaceAll:replNext with:#FindNext. |
|
1416 |
each replaceAll:replPrev with:#FindPrev. |
|
1417 |
each replaceAny:#(FindNextClass FindPrevClass |
|
1418 |
FindNextSelector FindPrevSelector |
|
1419 |
FindNextSnapshot FindPrevSnapshot |
|
1420 |
FindNextString FindPrevString) |
|
1421 |
with:nil. |
|
1422 |
]. |
|
1423 |
||
1424 |
^ PopUpMenu itemList:items resources:resources. |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
1425 |
]. |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
1426 |
|
1670
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1427 |
items := #( |
7360 | 1428 |
('Apply' doApply Accept) |
1429 |
('Apply to End' doApplyRest ) |
|
1430 |
('Apply from Begin' doApplyFromBeginning ) |
|
1431 |
('Apply for Class to End' doApplyClassRest ) |
|
1432 |
('Apply for Class from Begin' doApplyClassFromBeginning ) |
|
1433 |
('Apply All' doApplyAll ) |
|
1434 |
('-' ) |
|
1435 |
('Delete' doDelete Delete) |
|
1436 |
('Delete to End' doDeleteRest ) |
|
1437 |
('Delete for Class to End' doDeleteClassRest ) |
|
1438 |
('Delete for Class from Begin' doDeleteClassFromBeginning ) |
|
1439 |
). |
|
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1440 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1441 |
(self hasSelection and:[self hasSingleSelection not]) ifTrue:[ |
7360 | 1442 |
items := items , |
1443 |
#( |
|
15187 | 1444 |
('Delete all for Classes' doDeleteClassAll ) |
1445 |
('Delete all for Classes & their Private Classes' doDeleteClassAndPrivateClassesAll ) |
|
7360 | 1446 |
). |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1447 |
] ifFalse:[ |
7360 | 1448 |
items := items , |
1449 |
#( |
|
15187 | 1450 |
('Delete all for Class' doDeleteClassAll ) |
1451 |
('Delete all for Class & its Private Classes' doDeleteClassAndPrivateClassesAll ) |
|
7360 | 1452 |
). |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1453 |
]. |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1454 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1455 |
items := items , |
7360 | 1456 |
#( |
1457 |
('-' ) |
|
1458 |
('Compress' doCompress ) |
|
1459 |
('Compress for Class' doCompressClass ) |
|
1460 |
('Compare and Compress' doCompareAndCompress ) |
|
1461 |
('-' ) |
|
1462 |
('Compare with current Version' doCompare ) |
|
1463 |
('Browse Class' doBrowse ) |
|
1464 |
('-' ) |
|
1465 |
('Make Change a Patch' doMakePatch ) |
|
1466 |
). |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1467 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1468 |
editingClassSource ifFalse:[ |
7360 | 1469 |
items := items , #( |
15187 | 1470 |
('Fileout & Delete all for Class' doFileoutAndDeleteClassAll ) |
1471 |
('CheckIn & Delete all for Class' doCheckinAndDeleteClassAll ) |
|
7360 | 1472 |
) |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1473 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1474 |
|
1670
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1475 |
items := items , #( |
7360 | 1476 |
('-' ) |
1477 |
('Save in...' doSave ) |
|
1478 |
('Save to End In...' doSaveRest ) |
|
1479 |
('Save for Class to End In...' doSaveClassRest ) |
|
1480 |
('Save all for Class In...' doSaveClassAll ) |
|
1481 |
('-' ) |
|
1482 |
). |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1483 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1484 |
editingClassSource ifTrue:[ |
7360 | 1485 |
items := items , #( |
1486 |
('Writeback ClassFile' doWriteBack ) |
|
1487 |
) |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1488 |
] ifFalse:[ |
7360 | 1489 |
items := items , #( |
1490 |
('Writeback ChangeFile' doWriteBack ) |
|
1491 |
) |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1492 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1493 |
|
1833
c9b1a30b326d
moved update item to the end
Claus Gittinger <cg@exept.de>
parents:
1788
diff
changeset
|
1494 |
items := items , #( |
7360 | 1495 |
('-' ) |
1496 |
('Update' doUpdate ) |
|
1497 |
). |
|
1670
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1498 |
|
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1499 |
m := PopUpMenu itemList:items resources:resources. |
202 | 1500 |
|
255 | 1501 |
"/ |
1502 |
"/ disable those that require a selected entry |
|
1503 |
"/ |
|
3202 | 1504 |
self hasSelection ifFalse:[ |
7360 | 1505 |
m disableAll:#(doApply doApplyClassRest doApplyRest doDelete doDeleteRest doDeleteClassRest |
1506 |
doDeleteClassFromBeginning doDeleteClassAll doDeleteClassAndPrivateClassesAll |
|
1507 |
doCompare doCompressClass doMakePatch doSaveChangeInFile doMakePermanent |
|
1508 |
doSave doSaveRest doSaveClassAll doSaveClassRest doBrowse |
|
1509 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll) |
|
1368 | 1510 |
] ifTrue:[ |
7360 | 1511 |
sel := self theSingleSelection. |
1512 |
sel isNil ifTrue:[ |
|
1513 |
"/ multiple selections |
|
1514 |
m disableAll:#(doApplyClassRest doApplyRest doDeleteClassRest doDeleteRest |
|
1515 |
doDeleteClassFromBeginning |
|
1516 |
doCompressClass doCompare |
|
1517 |
doSaveClassAll doSaveClassRest doSaveRest doBrowse |
|
1518 |
doFileoutAndDeleteClassAll) |
|
1519 |
] ifFalse:[ |
|
1520 |
(self classNameOfChange:sel) isNil ifTrue:[ |
|
1521 |
m disableAll:#(doApplyClassRest doDeleteClassRest |
|
1522 |
doDeleteClassFromBeginning doDeleteClassAll doDeleteClassAndPrivateClassesAll |
|
1523 |
doCompressClass doCompare doMakePatch |
|
1524 |
doSaveClassAll doSaveClassRest doBrowse |
|
1525 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll) |
|
1526 |
] |
|
1527 |
] |
|
255 | 1528 |
]. |
1529 |
||
1530 |
"/ |
|
1531 |
"/ disable those that do not make sense with autoUpdate |
|
1532 |
"/ ('cause this would be overwritten by next update operation) |
|
1533 |
"/ |
|
3202 | 1534 |
autoUpdate value ifTrue:[ |
7360 | 1535 |
m disableAll:#(doDelete doDeleteRest doDeleteClassRest doDeleteClassAll |
1536 |
doDeleteClassAndPrivateClassesAll doCompress |
|
1537 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll |
|
1538 |
doWriteBack) |
|
202 | 1539 |
]. |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1540 |
readOnly == true ifTrue:[ |
7360 | 1541 |
m disableAll:#(doDelete doDeleteRest doDeleteClassRest doDeleteClassAll |
1542 |
doDeleteClassAndPrivateClassesAll doCompress |
|
1543 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll |
|
1544 |
doWriteBack doSaveBack doUpdate |
|
1545 |
doApplyAll doApplyRest) |
|
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1546 |
]. |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1547 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1548 |
self hasSelection ifTrue:[ |
7360 | 1549 |
m disable:#doApplyAll |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1550 |
]. |
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1551 |
|
202 | 1552 |
^ m |
1553 |
||
7360 | 1554 |
"Modified: / 06-09-1995 / 17:14:22 / claus" |
1555 |
"Modified: / 06-10-2006 / 11:17:06 / cg" |
|
202 | 1556 |
! |
1557 |
||
2114 | 1558 |
destroy |
1559 |
"destroy the receiver; make certain, that boxes are destroyed too" |
|
1560 |
||
1561 |
Processor removeTimedBlock:checkBlock. |
|
1562 |
ObjectMemory removeDependent:self. |
|
1563 |
super destroy |
|
1564 |
! |
|
1565 |
||
202 | 1566 |
initialize |
18429 | 1567 |
|panel infoLabel v upperFrame buttonPanel mH tmH |
9168 | 1568 |
checkBox oldStyle codeViewBox lbl applyInOriginal| |
3202 | 1569 |
|
18252 | 1570 |
leftCodeLabelHolder := (self class resources string:'Current') asValue. |
1571 |
rightCodeLabelHolder := (self class resources string:'Change_subst') asValue. |
|
17848 | 1572 |
|
3211 | 1573 |
"/ oldStyle := true. |
3202 | 1574 |
oldStyle := false. |
202 | 1575 |
|
1576 |
super initialize. |
|
1577 |
||
5702 | 1578 |
changeFileName := ObjectMemory nameForChanges. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
1579 |
encodingIfKnown := nil. |
17968 | 1580 |
autoCompare := (DefaultAutoCompare ? true) asValue. |
3202 | 1581 |
autoCompare onChangeSend:#autoCompareChanged to:self. |
1582 |
autoUpdate := false asValue. |
|
6216 | 1583 |
autoloadAsRequired := false asValue. |
10719 | 1584 |
ignorePublicPrivateCategories := false asValue. |
9168 | 1585 |
|
1586 |
applyInOriginal := true. |
|
1587 |
KeepEnforcedNameSpace == true ifTrue:[ |
|
1588 |
enforcedNameSpace := LastEnforcedNameSpace. |
|
1589 |
applyInOriginal := false. |
|
1590 |
]. |
|
1591 |
||
1592 |
applyInOriginalNameSpace := applyInOriginal asValue. |
|
6288 | 1593 |
applyInOriginalNameSpace |
6357 | 1594 |
onChangeEvaluate:[ |
1595 |
autoCompare value ifTrue:[ |
|
1596 |
self doUpdate |
|
1597 |
]. |
|
1598 |
]. |
|
9168 | 1599 |
|
4897 | 1600 |
updateChangeSet := true "false" asValue. |
8026
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
1601 |
classesNotToBeAutoloaded := Set new. |
221 | 1602 |
|
1099
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1603 |
" |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1604 |
checkBlock is executed by the Processor. |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1605 |
We use #pushEvent: to perform the update |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1606 |
in our windowgroups process. |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1607 |
" |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1608 |
checkBlock := [self pushEvent:#checkIfFileHasChanged]. |
202 | 1609 |
|
3202 | 1610 |
oldStyle ifFalse:[ |
6357 | 1611 |
menuPanel := MenuPanel in:self. |
1612 |
"/ menuPanel level:1. |
|
1613 |
menuPanel verticalLayout:false. |
|
1614 |
menuPanel receiver:self. |
|
1615 |
menuPanel menu:(self pullDownMenu). |
|
1616 |
||
8164
ee17624160a6
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8102
diff
changeset
|
1617 |
mH := menuPanel preferredHeight. |
6357 | 1618 |
menuPanel origin:(0.0 @ 0.0) corner:(1.0 @ (mH)). |
1619 |
mH := mH + 1. |
|
10681 | 1620 |
|
1621 |
toolbarMenu := MenuPanel in:self. |
|
1622 |
toolbarMenu verticalLayout:false. |
|
1623 |
toolbarMenu receiver:self. |
|
1624 |
toolbarMenu menu:(self toolbarMenu). |
|
17899 | 1625 |
toolbarMenu helpSpecProvider:self. "/ for helpTexts |
10681 | 1626 |
|
1627 |
tmH := toolbarMenu preferredHeight. |
|
1628 |
toolbarMenu origin:(0.0 @ mH) corner:(1.0 @ (mH+tmH)). |
|
1629 |
mH := mH + tmH + 1. |
|
18429 | 1630 |
|
1631 |
toolbarMenu delegate:self. |
|
3202 | 1632 |
] ifTrue:[ |
6357 | 1633 |
mH := 0.0 |
3202 | 1634 |
]. |
1635 |
||
16467 | 1636 |
panel := VariableVerticalPanel in:self. |
1637 |
"/ panel origin:(0.0 @ mH) corner:(1.0 @ 1.0) |
|
1638 |
panel layout:(LayoutFrame |
|
1639 |
leftFraction:0.0 offset:0 |
|
1640 |
rightFraction:1.0 offset:0 |
|
1641 |
topFraction:0.0 offset:mH |
|
1642 |
bottomFraction:1.0 offset:-30). |
|
1643 |
panel borderWidth:0. |
|
1644 |
||
1645 |
infoLabel := Label in:self. |
|
1646 |
infoLabel layout:(LayoutFrame |
|
1647 |
leftFraction:0.0 offset:0 |
|
1648 |
rightFraction:1.0 offset:0 |
|
1649 |
topFraction:1.0 offset:-28 |
|
1650 |
bottomFraction:1.0 offset:-2). |
|
1651 |
infoLabel borderWidth:0. |
|
1652 |
infoLabel sizeFixed:true. |
|
1653 |
infoLabel level:-1. |
|
1654 |
infoLabel adjust:#left. |
|
1655 |
infoLabel labelChannel:(infoHolder := '' asValue). |
|
1656 |
||
3202 | 1657 |
upperFrame := panel. |
1658 |
oldStyle ifTrue:[ |
|
6357 | 1659 |
upperFrame := VariableHorizontalPanel origin:(0.0 @ 0.0) corner:(1.0 @ 0.3) in:panel. |
3202 | 1660 |
]. |
202 | 1661 |
|
1662 |
v := HVScrollableView for:SelectionInListView miniScrollerH:true in:upperFrame. |
|
3202 | 1663 |
oldStyle ifTrue:[ |
6357 | 1664 |
v origin:(0.0 @ 0.0) corner:(0.75 @ 1.0). |
3202 | 1665 |
] ifFalse:[ |
6357 | 1666 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.3). |
3202 | 1667 |
]. |
3090 | 1668 |
|
202 | 1669 |
changeListView := v scrolledView. |
1670 |
changeListView delegate:self. |
|
1671 |
changeListView menuHolder:self; menuPerformer:self; menuMessage:#changeListMenu. |
|
1471 | 1672 |
changeListView doubleClickAction:[:line | self doubleClickOnChange:line]. |
3211 | 1673 |
oldStyle ifFalse:[ |
6357 | 1674 |
changeListView multipleSelectOk:true. |
3211 | 1675 |
]. |
202 | 1676 |
|
3202 | 1677 |
oldStyle ifTrue:[ |
6357 | 1678 |
buttonPanel := VerticalPanelView in:upperFrame. |
1679 |
buttonPanel origin:(0.75 @ 0.0) corner:(1.0 @ 1.0). |
|
19237 | 1680 |
buttonPanel horizontalLayout:#leftSpace verticalLayout:#topSpace. |
6357 | 1681 |
|
1682 |
checkBox := CheckBox new model:autoCompare. |
|
1683 |
checkBox label:(resources string:'Auto Compare'). |
|
1684 |
checkBox action:[:val | autoCompare value:val]. |
|
1685 |
buttonPanel addSubView:checkBox. |
|
1686 |
||
1687 |
checkBox := CheckBox new model:autoUpdate. |
|
1688 |
checkBox label:(resources string:'Auto Update'). |
|
1689 |
checkBox action:[:val | autoUpdate value:val]. |
|
1690 |
buttonPanel addSubView:checkBox. |
|
1691 |
||
1692 |
checkBox := CheckBox new. |
|
1693 |
checkBox label:(resources stringWithCRs:'Apply in original NameSpace'). |
|
1694 |
checkBox model:applyInOriginalNameSpace. |
|
1695 |
buttonPanel addSubView:checkBox. |
|
3202 | 1696 |
]. |
2301 | 1697 |
|
3090 | 1698 |
"/ protectExistingMethods := CheckBox new. |
1699 |
"/ protectExistingMethods label:(resources string:'Protect existing code' withCRs). |
|
1700 |
"/ protectExistingMethods model:protectExistingMethods. |
|
1701 |
"/ buttonPanel addSubView:protectExistingMethods. |
|
1702 |
||
4487 | 1703 |
codeViewBox := View in:panel. |
1704 |
codeViewBox origin:(0.0 @ 0.3) corner:(1.0 @ 1.0). |
|
1705 |
||
1706 |
v := HVScrollableView for:CodeView miniScrollerH:true miniScrollerV:false in:codeViewBox. |
|
1707 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
202 | 1708 |
codeView := v scrolledView. |
1996 | 1709 |
codeView readOnly:true. |
202 | 1710 |
|
4487 | 1711 |
diffViewBox := View in:codeViewBox. |
1712 |
diffViewBox origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
1713 |
||
17848 | 1714 |
lbl := Label label:leftCodeLabelHolder value in:diffViewBox. |
1715 |
lbl labelChannel:leftCodeLabelHolder. |
|
4487 | 1716 |
lbl layout:(LayoutFrame |
6357 | 1717 |
leftFraction:0.0 offset:0 |
1718 |
rightFraction:0.5 offset:0 |
|
1719 |
topFraction:0.0 offset:0 |
|
1720 |
bottomFraction:0.0 offset:20). |
|
17848 | 1721 |
lbl := Label label:rightCodeLabelHolder value in:diffViewBox. |
1722 |
lbl labelChannel:rightCodeLabelHolder. |
|
4487 | 1723 |
lbl layout:(LayoutFrame |
6357 | 1724 |
leftFraction:0.5 offset:0 |
1725 |
rightFraction:1.0 offset:0 |
|
1726 |
topFraction:0.0 offset:0 |
|
1727 |
bottomFraction:0.0 offset:20). |
|
4487 | 1728 |
|
1729 |
"/ diffView := DiffTextView in:diffViewBox. |
|
1730 |
"/ diffView layout:(LayoutFrame |
|
1731 |
"/ leftFraction:0.0 offset:0 |
|
1732 |
"/ rightFraction:1.0 offset:0 |
|
1733 |
"/ topFraction:0.0 offset:20 |
|
1734 |
"/ bottomFraction:1.0 offset:0). |
|
1735 |
||
8102 | 1736 |
v := HVScrollableView for:DiffCodeView miniScrollerH:true miniScrollerV:false in:diffViewBox. |
4487 | 1737 |
v layout:(LayoutFrame |
6357 | 1738 |
leftFraction:0.0 offset:0 |
1739 |
rightFraction:1.0 offset:0 |
|
1740 |
topFraction:0.0 offset:20 |
|
1741 |
bottomFraction:1.0 offset:0). |
|
4487 | 1742 |
diffView := v scrolledView. |
1743 |
||
1744 |
self showingDiffs value ifFalse:[ |
|
6357 | 1745 |
self makeDiffViewInvisible |
4487 | 1746 |
]. |
1747 |
||
202 | 1748 |
anyChanges := false. |
1749 |
ObjectMemory addDependent:self. "to get shutdown-update" |
|
1750 |
||
1751 |
tabSpec := TabulatorSpecification new. |
|
1752 |
tabSpec unit:#inch. |
|
1753 |
tabSpec positions:#(-1 0 5 8.5 ). |
|
1754 |
" +/- cls>>sel type info" |
|
1755 |
tabSpec align: #(#left #left #left #left). |
|
1756 |
||
10681 | 1757 |
"Modified: / 27-03-1997 / 11:07:07 / stefan" |
17848 | 1758 |
"Modified: / 07-12-2017 / 12:28:09 / cg" |
18429 | 1759 |
"Modified: / 24-09-2018 / 22:50:40 / Claus Gittinger" |
202 | 1760 |
! |
1761 |
||
1246
9ed3722bd2f2
setup in #postRealize instead of #realize
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
1762 |
postRealize |
3534 | 1763 |
self setupTabSpec. |
202 | 1764 |
self readChangesFileInBackground:true. |
18059 | 1765 |
self updateChangeList. |
16467 | 1766 |
changeListView action:[:lineNrOrCollection | self changeSelection:lineNrOrCollection]. |
202 | 1767 |
Processor addTimedBlock:checkBlock afterSeconds:5. |
1246
9ed3722bd2f2
setup in #postRealize instead of #realize
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
1768 |
|
9ed3722bd2f2
setup in #postRealize instead of #realize
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
1769 |
"Created: 24.7.1997 / 18:06:12 / cg" |
202 | 1770 |
! |
1771 |
||
3202 | 1772 |
pullDownMenu |
1773 |
"return the top (pullDown) menu" |
|
1774 |
||
1775 |
<resource: #programMenu> |
|
1776 |
||
3330 | 1777 |
^ self menuFromSpec:self class menuSpec. |
1778 |
||
1779 |
"/ |m| |
|
1780 |
"/ |
|
1781 |
"/ m := self class menuSpec. |
|
1782 |
"/ m := m decodeAsLiteralArray. |
|
1783 |
"/ m receiver:self. |
|
1784 |
"/ m findGuiResourcesIn:self. |
|
1785 |
"/ ^ m. |
|
3202 | 1786 |
! |
1787 |
||
3534 | 1788 |
setupTabSpec |
1789 |
autoCompare value ifTrue:[ |
|
9515 | 1790 |
tabSpec positions:#(0 0.15 7 9.5 ). |
3534 | 1791 |
] ifFalse:[ |
9515 | 1792 |
"/ |
1793 |
"/ set tabs to hide compare-column |
|
1794 |
"/ |
|
1795 |
tabSpec positions:#(-1 0 7 9.5 ). |
|
3534 | 1796 |
] |
9515 | 1797 |
|
1798 |
"Modified: / 10-07-2010 / 10:59:49 / cg" |
|
3534 | 1799 |
! |
1800 |
||
10681 | 1801 |
toolbarMenu |
1802 |
"return the top (pullDown) menu" |
|
1803 |
||
1804 |
<resource: #programMenu> |
|
1805 |
||
1806 |
^ self menuFromSpec:self class toolbarMenuSpec. |
|
1807 |
||
1808 |
"Created: / 07-09-2011 / 16:03:41 / cg" |
|
1809 |
! |
|
1810 |
||
627 | 1811 |
update:what with:aParameter from:changedObject |
202 | 1812 |
|box| |
1813 |
||
8558
a85166102cb7
Wait for #aboutToQuit change message instead of obsolete #aboutToExit
Stefan Vogel <sv@exept.de>
parents:
8515
diff
changeset
|
1814 |
(what == #aboutToQuit) ifTrue:[ |
6639 | 1815 |
" |
1816 |
smalltalk is about to shut down - |
|
1817 |
- if change list was modified, ask user and save if requested. |
|
1818 |
" |
|
1819 |
anyChanges ifTrue:[ |
|
1820 |
self raiseDeiconified. |
|
1821 |
||
1822 |
box := YesNoBox new. |
|
1823 |
box title:('The modified changelist has not been written back to the change file.\\Write change file before exiting ?') withCRs. |
|
1824 |
box okText:(resources string:'Write') noText:(resources string:'Don''t write'). |
|
1825 |
box yesAction:[self writeBackChanges] |
|
1826 |
noAction:[]. |
|
1827 |
box showAtPointer. |
|
1828 |
box destroy |
|
1829 |
]. |
|
1830 |
^ self |
|
202 | 1831 |
]. |
11048 | 1832 |
|
8558
a85166102cb7
Wait for #aboutToQuit change message instead of obsolete #aboutToExit
Stefan Vogel <sv@exept.de>
parents:
8515
diff
changeset
|
1833 |
super update:what with:aParameter from:changedObject |
627 | 1834 |
|
11048 | 1835 |
"Created: / 15-06-1996 / 15:26:30 / cg" |
1836 |
"Modified: / 24-08-1999 / 09:45:06 / stefan" |
|
1837 |
"Modified: / 03-01-2012 / 15:23:13 / cg" |
|
202 | 1838 |
! ! |
1839 |
||
3202 | 1840 |
!ChangesBrowser methodsFor:'menu actions'! |
1841 |
||
19288 | 1842 |
doAddToClassMap |
1843 |
"add a class name mapping" |
|
1844 |
||
1845 |
|mapping initialNameInChangeFile initialNameInImage| |
|
1846 |
||
1847 |
[:exit | |
|
1848 |
self withSelectedChangesDo:[:changeNr | |
|
1849 |
| className | |
|
1850 |
||
1851 |
className := self classNameOfChange:changeNr. |
|
1852 |
className notNil ifTrue:[ |
|
1853 |
initialNameInChangeFile := className. |
|
1854 |
exit value:nil. |
|
1855 |
] |
|
1856 |
] |
|
1857 |
] valueWithExit. |
|
1858 |
||
1859 |
initialNameInChangeFile notNil ifTrue:[ |
|
1860 |
[:exit | |
|
1861 |
Smalltalk allClassesDo:[:cls | |
|
1862 |
(cls name includesString:initialNameInChangeFile) ifTrue:[ |
|
1863 |
initialNameInImage := cls name. |
|
1864 |
exit value:nil. |
|
1865 |
]. |
|
1866 |
]. |
|
1867 |
] valueWithExit. |
|
1868 |
]. |
|
1869 |
||
1870 |
mapping := Dialog |
|
1871 |
request:'Name in Changefile:' initialAnswer:initialNameInChangeFile |
|
1872 |
and:'Name in Image' initialAnswer:initialNameInImage |
|
1873 |
label:'Add Classname Mapping'. |
|
1874 |
mapping isNil ifTrue:[^ self]. |
|
1875 |
classNameMap isNil ifTrue:[ |
|
1876 |
classNameMap := Dictionary new |
|
1877 |
]. |
|
1878 |
classNameMap at:mapping first put:mapping second |
|
1879 |
! |
|
1880 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1881 |
doApply |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1882 |
"user wants a change to be applied" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1883 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1884 |
self withSelectedChangesDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1885 |
(self applyChange:changeNr) ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1886 |
^ self "/ cancel |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1887 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1888 |
self autoSelect:(changeNr + 1) |
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1892 |
doApplyAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1893 |
"user wants all changes to be applied" |
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 |
self withExecuteCursorDo:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1896 |
|lastNr "{ Class: SmallInteger }" | |
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 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1899 |
lastNr := self numberOfChanges. |
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 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1902 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1903 |
multipleApply := lastNr > 1. |
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 |
1 to:lastNr do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1906 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1907 |
self applyChange:changeNr |
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 |
self autoSelectLast |
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1912 |
"Modified: 21.1.1997 / 22:26:30 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1913 |
! |
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 |
doApplyClassFromBeginning |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1916 |
"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
|
1917 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1918 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1919 |
|thisClassName classNameToApply lastChange |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1920 |
lastNr "{ Class: SmallInteger }" | |
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 |
classNameToApply := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1923 |
classNameToApply notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1924 |
self clearCodeView. |
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 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1927 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1928 |
multipleApply := changeNr ~= 1. |
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 |
1 to:changeNr do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1931 |
thisClassName := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1932 |
thisClassName = classNameToApply ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1933 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1934 |
self applyChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1935 |
lastChange := changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1936 |
]. |
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 |
self autoSelect:changeNr+1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1939 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1940 |
] |
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 |
"Modified: 21.1.1997 / 22:26:04 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1943 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1944 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1945 |
doApplyClassRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1946 |
"user wants all changes for this class from changeNr to be applied" |
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 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1949 |
|thisClassName classNameToApply lastChange |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1950 |
lastNr "{ Class: SmallInteger }" | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1951 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1952 |
classNameToApply := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1953 |
classNameToApply notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1954 |
self clearCodeView. |
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 |
lastNr := self numberOfChanges. |
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 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1959 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1960 |
multipleApply := (lastNr - changeNr) > 1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1961 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1962 |
changeNr to:lastNr do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1963 |
thisClassName := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1964 |
thisClassName = classNameToApply ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1965 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1966 |
self applyChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1967 |
lastChange := changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1968 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1969 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1970 |
self autoSelect:lastChange. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1971 |
] |
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:26:04 / 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 |
doApplyFromBeginning |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1978 |
"user wants all changes from 1 to changeNr to be applied" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1979 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1980 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1981 |
|lastNr "{ Class: SmallInteger }" | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1982 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1983 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1984 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1985 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1986 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1987 |
multipleApply := changeNr ~= 1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1988 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1989 |
1 to:changeNr do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1990 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1991 |
self applyChange:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1992 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1993 |
self autoSelect:changeNr+1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1994 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1995 |
! |
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 |
doApplyRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1998 |
"apply all changes from changeNr to the end" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1999 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2000 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2001 |
|lastNr "{ Class: SmallInteger }" | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2002 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2003 |
self clearCodeView. |
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 |
lastNr := self numberOfChanges. |
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 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2008 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2009 |
multipleApply := (lastNr - changeNr) > 1. |
15087 | 2010 |
AbortAllOperationRequest handle:[:ex | |
2011 |
ex return |
|
2012 |
] do:[ |
|
2013 |
changeNr to:lastNr do:[:changeNr | |
|
2014 |
changeListView setSelection:changeNr. |
|
2015 |
self applyChange:changeNr |
|
2016 |
]. |
|
2017 |
self autoSelect:self numberOfChanges. |
|
2018 |
] |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2019 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2020 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2021 |
"Modified: 21.1.1997 / 22:25:29 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2022 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2023 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2024 |
doApplyToConflictOrEnd |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2025 |
"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
|
2026 |
or the end." |
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 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2029 |
|lastNr "{ Class: SmallInteger }"| |
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 |
self clearCodeView. |
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 |
lastNr := self numberOfChanges. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2034 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2035 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2036 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2037 |
multipleApply := (lastNr - changeNr) > 1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2038 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2039 |
changeNr to:lastNr do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2040 |
| cls sel | |
18059 | 2041 |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2042 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2043 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2044 |
((cls := self classOfChange:changeNr ifAbsent:[:className| nil]) notNil |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2045 |
and:[(sel := self selectorOfMethodChange:changeNr) notNil]) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2046 |
ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2047 |
(cls includesSelector:sel) ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2048 |
self autoSelect:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2049 |
^ self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2050 |
]. |
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 |
self applyChange:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2053 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2054 |
self autoSelect:self numberOfChanges. |
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 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2057 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2058 |
doBrowse |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2059 |
"user wants a browser on the class of a change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2060 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2061 |
self withSingleSelectedChangeDo:[:changeNr | |
17666 | 2062 |
|cls| |
2063 |
||
2064 |
cls := self classOfChange:changeNr. |
|
2065 |
cls notNil ifTrue:[ |
|
2066 |
SystemBrowser default |
|
2067 |
openInClass:cls |
|
2068 |
selector:(self selectorOfMethodChange:changeNr) |
|
2069 |
] |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2070 |
] |
17666 | 2071 |
|
2072 |
"Modified: / 01-09-2017 / 14:20:00 / cg" |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2073 |
! |
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 |
doBrowseImplementors |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2076 |
"open an implementors-browser" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2077 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2078 |
|changeNr initial selector| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2079 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2080 |
(changeNr := self theSingleSelection) notNil ifTrue:[ |
17666 | 2081 |
initial := self selectorOfMethodChange:changeNr. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2082 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2083 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2084 |
selector := Dialog |
17666 | 2085 |
request:'Selector to browse implementors of:' |
2086 |
initialAnswer:(initial ? ''). |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2087 |
selector size ~~ 0 ifTrue:[ |
17666 | 2088 |
SystemBrowser default browseImplementorsMatching:selector. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2089 |
] |
17666 | 2090 |
|
2091 |
"Modified (format): / 01-09-2017 / 14:20:06 / cg" |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2092 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2093 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2094 |
doBrowseSenders |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2095 |
"user wants a browser on the class of a change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2096 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2097 |
|changeNr initial selector| |
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 |
(changeNr := self theSingleSelection) notNil ifTrue:[ |
17666 | 2100 |
initial := self selectorOfMethodChange:changeNr. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2101 |
]. |
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 |
selector := Dialog |
17666 | 2104 |
request:'Selector to browse senders of:' |
2105 |
initialAnswer:(initial ? ''). |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2106 |
selector size ~~ 0 ifTrue:[ |
17666 | 2107 |
SystemBrowser default browseAllCallsOn:selector asSymbol. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2108 |
] |
17666 | 2109 |
|
2110 |
"Modified: / 01-09-2017 / 14:20:13 / cg" |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2111 |
! |
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 |
doCheckinAndDeleteClassAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2114 |
"first checkin the selected changes class then delete all changes |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2115 |
for it." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2116 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2117 |
|classes answer logTitle checkinInfo| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2118 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2119 |
"/ self theSingleSelection isNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2120 |
"/ ^ self information:'Only possible if a single change is selected.'. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2121 |
"/ ]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2122 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2123 |
self withExecuteCursorDo:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2124 |
classes := IdentitySet new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2125 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2126 |
self withSelectedChangesDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2127 |
| className class | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2128 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2129 |
className := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2130 |
className notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2131 |
class := Smalltalk classNamed:className. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2132 |
class isNil ifTrue:[ |
18152 | 2133 |
self proceedableError:'oops - no class: ', className. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2134 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2135 |
class notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2136 |
class := class theNonMetaclass. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2137 |
(classes includes:class) ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2138 |
class isPrivate ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2139 |
(classes includes:class owningClass) ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2140 |
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
|
2141 |
bindWith:class owningClass name allBold) withCRs. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2142 |
answer isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2143 |
answer ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2144 |
classes add:class owningClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2145 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2146 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2147 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2148 |
classes add:class |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2149 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2150 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2151 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2152 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2153 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2154 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2155 |
classes size == 1 ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2156 |
logTitle := classes first name. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2157 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2158 |
logTitle := '%1 classes' bindWith:classes size. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2159 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2160 |
checkinInfo := SourceCodeManagerUtilities default |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2161 |
getCheckinInfoFor:logTitle |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2162 |
initialAnswer:nil. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2163 |
checkinInfo isNil ifTrue:[^ self ]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2164 |
|
18059 | 2165 |
self unselect. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2166 |
classes do:[:eachClass | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2167 |
(SourceCodeManagerUtilities default checkinClass:eachClass withInfo:checkinInfo) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2168 |
ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2169 |
self silentDeleteChangesForClassAndPrivateClasses:eachClass name |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2170 |
from:1 to:(self numberOfChanges). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2171 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2172 |
]. |
18059 | 2173 |
self updateChangeList. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2174 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2175 |
|
18152 | 2176 |
"Modified: / 06-09-1995 / 17:11:16 / claus" |
2177 |
"Modified: / 17-11-2001 / 14:21:13 / cg" |
|
2178 |
"Modified: / 24-05-2018 / 14:55:14 / Claus Gittinger" |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2179 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2180 |
|
18059 | 2181 |
doCleanup |
2182 |
"cleanup the changefile/changeset. |
|
2183 |
actions done: |
|
2184 |
- from the end, find changes which are equal to the current version |
|
18061 | 2185 |
and not in the current changeset (i.e. represents the current version as built from CVS). |
18059 | 2186 |
Then delete it incl. previous versions of it." |
2187 |
||
2188 |
|numChanges nextChangeNr changeNr changeSelector changeClass numDeleted| |
|
2189 |
||
2190 |
numChanges := self numberOfChanges. |
|
2191 |
self unselect. |
|
2192 |
||
2193 |
self withWaitCursorDo:[ |
|
2194 |
"/ find the last method change which is equal |
|
2195 |
changeNr := numChanges. |
|
2196 |
[changeNr > 0] whileTrue:[ |
|
2197 |
nextChangeNr := changeNr - 1. |
|
2198 |
||
2199 |
(changeClass := self classOfChange:changeNr ifAbsent:nil) notNil ifTrue:[ |
|
2200 |
||
2201 |
(changeInfoList at:changeNr) isMethodCategoryChange ifTrue:[ |
|
2202 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
|
2203 |
(changeSelector := self selectorOfMethodCategoryChange:changeNr) notNil ifTrue:[ |
|
2204 |
(ChangeSet current includesChangeForClass:changeClass selector:changeSelector) ifFalse:[ |
|
2205 |
infoHolder value:('Deleting category changes for %1 >> %2' bindWith:changeClass name with:changeSelector). |
|
2206 |
self windowGroup repairDamage. |
|
2207 |
numDeleted := self |
|
2208 |
silentDeleteMethodCategoryChangesFor:changeClass name selector:changeSelector |
|
2209 |
from:1 to:changeNr. |
|
2210 |
"/ self selectChange:changeNr. |
|
2211 |
"/ self doDeleteClassSelectorOlder. |
|
2212 |
nextChangeNr := (changeNr - numDeleted + 1) min:self numberOfChanges. |
|
2213 |
]. |
|
2214 |
]. |
|
2215 |
]. |
|
2216 |
] ifFalse:[ |
|
2217 |
(changeSelector := self selectorOfMethodChange:changeNr) notNil ifTrue:[ |
|
2218 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
|
2219 |
"/ found a method change, which is the same as the current version |
|
2220 |
"/ if in the current changeSet, then do not delete (needs checkin first) |
|
2221 |
(ChangeSet current includesChangeForClass:changeClass selector:changeSelector) ifFalse:[ |
|
2222 |
infoHolder value:('Deleting changes for %1 >> %2' bindWith:changeClass name with:changeSelector). |
|
2223 |
self windowGroup repairDamage. |
|
2224 |
numDeleted := self |
|
2225 |
silentDeleteChangesFor:changeClass name selector:changeSelector |
|
2226 |
from:1 to:changeNr. |
|
2227 |
"/ self selectChange:changeNr. |
|
2228 |
"/ self doDeleteClassSelectorOlder. |
|
2229 |
nextChangeNr := (changeNr - numDeleted + 1) min:self numberOfChanges. |
|
2230 |
]. |
|
2231 |
]. |
|
2232 |
]. |
|
2233 |
]. |
|
2234 |
]. |
|
2235 |
changeNr := nextChangeNr. |
|
2236 |
]. |
|
2237 |
]. |
|
2238 |
self updateChangeList. |
|
2239 |
! |
|
2240 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2241 |
doCompare |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2242 |
"compare change with current system version" |
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 |
classesNotToBeAutoloaded removeAll. |
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 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2247 |
self withExecuteCursorDo:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2248 |
self compareChange:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2249 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2250 |
self newLabel:'' |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2251 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2252 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2253 |
"Modified: 24.2.1996 / 19:37:19 / cg" |
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2256 |
doCompareAndCompress |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2257 |
"remove all changes, which are equivalent to the current image version" |
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 |
|toDelete| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2260 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2261 |
classesNotToBeAutoloaded removeAll. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2262 |
toDelete := OrderedCollection new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2263 |
self withExecuteCursorDo:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2264 |
1 to:self numberOfChanges do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2265 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2266 |
toDelete add:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2267 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2268 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2269 |
]. |
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 |
toDelete reverseDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2272 |
self silentDeleteChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2273 |
]. |
18059 | 2274 |
self updateChangeList. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2275 |
" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2276 |
scroll back a bit, if we are left way behind the list |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2277 |
" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2278 |
changeListView firstLineShown > self numberOfChanges ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2279 |
changeListView makeLineVisible:self numberOfChanges |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2280 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2281 |
self clearCodeView. |
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 |
self newLabel:''. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2284 |
classesNotToBeAutoloaded removeAll. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2285 |
! |
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 |
doCompress |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2288 |
"compress the change-set; this replaces multiple method-changes by the last |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2289 |
(i.e. the most recent) change" |
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 |
self compressForClass:nil |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2292 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2293 |
"Modified: / 29.10.1997 / 01:03:26 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2294 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2295 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2296 |
doCompressClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2297 |
"compress changes for the selected class. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2298 |
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
|
2299 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2300 |
self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2301 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2302 |
self selectedClassNames do:[:classNameToCompress | |
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2303 |
self compressForClass:classNameToCompress. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2304 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2305 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2306 |
"Created: / 29.10.1997 / 01:05:16 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2307 |
"Modified: / 19.11.2001 / 21:55:17 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2308 |
! |
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 |
doCompressSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2311 |
"compress changes for the selected class & selector. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2312 |
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
|
2313 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2314 |
|classSelectorPairs| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2315 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2316 |
self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2317 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2318 |
classSelectorPairs := Set new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2319 |
self withSelectedChangesDo:[:changeNr | |
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2320 |
| classNameToCompress selector | |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2321 |
|
17600 | 2322 |
classNameToCompress := self realClassNameOfChange:changeNr. |
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2323 |
classNameToCompress notNil ifTrue:[ |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2324 |
selector := self selectorOfMethodChange:changeNr. |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2325 |
selector notNil ifTrue:[ |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2326 |
classSelectorPairs add:(classNameToCompress -> selector). |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2327 |
] |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2328 |
] |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2329 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2330 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2331 |
classSelectorPairs do:[:pair | |
17600 | 2332 |
self compressForClass:(pair key) selector:(pair value). |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2333 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2334 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2335 |
"Created: / 19.11.2001 / 21:50:59 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2336 |
"Modified: / 19.11.2001 / 22:10:08 / cg" |
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 |
|
17096 | 2339 |
doCopyToClipboard |
2340 |
"user wants a change text to be copied to the clipboard" |
|
2341 |
||
2342 |
|text| |
|
2343 |
||
2344 |
self withSingleSelectedChangeDo:[:changeNr | |
|
2345 |
text := self sourceOfMethodChange:changeNr. |
|
2346 |
]. |
|
2347 |
text notEmptyOrNil ifTrue:[ |
|
2348 |
self window setClipboardText:text |
|
2349 |
] |
|
2350 |
||
2351 |
"Created: / 21-11-2016 / 23:38:11 / cg" |
|
2352 |
! |
|
2353 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2354 |
doDelete |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2355 |
"delete currently selected change(s)" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2356 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2357 |
|rangeEnd rangeStart firstDeleted| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2358 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2359 |
changeListView selection size <= 5 ifTrue:[ |
16467 | 2360 |
self withSelectedChangesReverseDo:[:changeNr | |
2361 |
self deleteChange:changeNr. |
|
2362 |
self autoSelectOrEnd:changeNr |
|
2363 |
]. |
|
2364 |
self showNumberOfChanges. |
|
2365 |
^ self |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2366 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2367 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2368 |
self withSelectedChangesReverseDo:[:changeNr | |
16467 | 2369 |
rangeEnd isNil ifTrue:[ |
2370 |
rangeEnd := rangeStart := changeNr |
|
2371 |
] ifFalse:[ |
|
2372 |
(changeNr = (rangeEnd + 1)) ifTrue:[ |
|
2373 |
rangeEnd := changeNr |
|
2374 |
] ifFalse:[ |
|
2375 |
(changeNr = (rangeStart - 1)) ifTrue:[ |
|
2376 |
rangeStart := changeNr |
|
2377 |
] ifFalse:[ |
|
2378 |
self deleteChangesFrom:rangeStart to:rangeEnd. |
|
2379 |
firstDeleted := (firstDeleted ? rangeStart) min:rangeStart. |
|
2380 |
rangeStart := rangeEnd := nil. |
|
2381 |
]. |
|
2382 |
]. |
|
2383 |
]. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2384 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2385 |
rangeStart notNil ifTrue:[ |
16467 | 2386 |
self deleteChangesFrom:rangeStart to:rangeEnd. |
2387 |
firstDeleted := (firstDeleted ? rangeStart) min:rangeStart. |
|
2388 |
]. |
|
2389 |
self autoSelectOrEnd:firstDeleted. |
|
2390 |
self showNumberOfChanges |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2391 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2392 |
|
12428 | 2393 |
doDeleteAllForNamespace |
2394 |
"delete all changes for classes with same namespace as currently selected change" |
|
2395 |
||
2396 |
|namespacesToDelete lastChangeNr overAllNumDeletedBefore| |
|
2397 |
||
2398 |
lastChangeNr := -1. |
|
2399 |
namespacesToDelete := Set new. |
|
2400 |
self withSelectedChangesDo:[:changeNr | |
|
2401 |
|namespaceToDelete| |
|
2402 |
||
2403 |
namespaceToDelete := self namespaceOfChange:changeNr. |
|
2404 |
namespaceToDelete notNil ifTrue:[ |
|
2405 |
namespacesToDelete add:namespaceToDelete |
|
2406 |
]. |
|
2407 |
lastChangeNr := lastChangeNr max:changeNr. |
|
2408 |
]. |
|
2409 |
namespacesToDelete isEmpty ifTrue:[^ self]. |
|
2410 |
||
2411 |
overAllNumDeletedBefore := 0. |
|
18059 | 2412 |
self unselect. |
12428 | 2413 |
|
2414 |
self withExecuteCursorDo:[ |
|
2415 |
namespacesToDelete do:[:namespaceToDelete | |
|
2416 |
|numDeletedBefore| |
|
2417 |
||
2418 |
self |
|
2419 |
silentDeleteChangesForNamespace:namespaceToDelete |
|
2420 |
from:lastChangeNr |
|
2421 |
to:(self numberOfChanges). |
|
2422 |
numDeletedBefore := self |
|
2423 |
silentDeleteChangesForNamespace:namespaceToDelete |
|
2424 |
from:1 |
|
2425 |
to:(lastChangeNr-1). |
|
2426 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
2427 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
2428 |
]. |
|
2429 |
]. |
|
2430 |
||
18059 | 2431 |
self updateChangeList. |
16467 | 2432 |
self autoSelectOrEnd:lastChangeNr. |
12428 | 2433 |
! |
2434 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2435 |
doDeleteAndSelectPrevious |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2436 |
"delete currently selected change(s)" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2437 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2438 |
self withSelectedChangesReverseDo:[:changeNr | |
16467 | 2439 |
self deleteChange:changeNr. |
2440 |
self autoSelectOrEnd:changeNr-1 |
|
2441 |
]. |
|
2442 |
||
2443 |
"/mh - don't we need a |
|
2444 |
"/ self setChangeList |
|
2445 |
"/ here? |
|
2446 |
self showNumberOfChanges |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2447 |
! |
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 |
doDeleteClassAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2450 |
"delete all changes with same class as currently selected change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2451 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2452 |
|classNamesToDelete lastChangeNr overAllNumDeletedBefore| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2453 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2454 |
lastChangeNr := -1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2455 |
classNamesToDelete := Set new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2456 |
self withSelectedChangesDo:[:changeNr | |
16467 | 2457 |
|classNameToDelete| |
2458 |
||
2459 |
classNameToDelete := self classNameOfChange:changeNr. |
|
2460 |
classNameToDelete notNil ifTrue:[ |
|
2461 |
classNamesToDelete add:classNameToDelete. |
|
2462 |
]. |
|
2463 |
lastChangeNr := lastChangeNr max:changeNr. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2464 |
]. |
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 |
overAllNumDeletedBefore := 0. |
18059 | 2467 |
self unselect. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2468 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2469 |
self withExecuteCursorDo:[ |
16467 | 2470 |
classNamesToDelete do:[:classNameToDelete | |
2471 |
|numDeletedBefore| |
|
2472 |
||
2473 |
self silentDeleteChangesFor:classNameToDelete |
|
2474 |
from:lastChangeNr |
|
2475 |
to:(self numberOfChanges). |
|
2476 |
numDeletedBefore := self |
|
2477 |
silentDeleteChangesFor:classNameToDelete |
|
2478 |
from:1 |
|
2479 |
to:(lastChangeNr-1). |
|
2480 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
2481 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
2482 |
]. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2483 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2484 |
|
18059 | 2485 |
self updateChangeList. |
16467 | 2486 |
self autoSelectOrEnd:lastChangeNr. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2487 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2488 |
"Created: / 13.12.1995 / 16:07:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2489 |
"Modified: / 28.1.1998 / 20:42:14 / cg" |
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2492 |
doDeleteClassAndPrivateClassesAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2493 |
"delete all changes with same class and private classes |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2494 |
as currently selected change" |
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 |
|lastChangeNr classNamesToDelete overAllNumDeletedBefore| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2497 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2498 |
lastChangeNr := -1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2499 |
classNamesToDelete := Set new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2500 |
self withSelectedChangesDo:[:changeNr | |
16467 | 2501 |
|classNameToDelete| |
2502 |
||
2503 |
classNameToDelete := self ownerClassNameOfChange:changeNr. |
|
2504 |
classNameToDelete notNil ifTrue:[ |
|
2505 |
classNamesToDelete add:classNameToDelete. |
|
2506 |
]. |
|
2507 |
lastChangeNr := lastChangeNr max:changeNr. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2508 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2509 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2510 |
overAllNumDeletedBefore := 0. |
18059 | 2511 |
self unselect. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2512 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2513 |
self withExecuteCursorDo:[ |
16467 | 2514 |
classNamesToDelete do:[:classNameToDelete | |
2515 |
| changeNr numDeletedBefore| |
|
2516 |
||
2517 |
classNameToDelete notNil ifTrue:[ |
|
2518 |
changeListView setSelection:nil. |
|
2519 |
self silentDeleteChangesForClassAndPrivateClasses:classNameToDelete |
|
2520 |
from:lastChangeNr |
|
2521 |
to:(self numberOfChanges). |
|
2522 |
numDeletedBefore := self |
|
2523 |
silentDeleteChangesForClassAndPrivateClasses:classNameToDelete |
|
2524 |
from:1 |
|
2525 |
to:(lastChangeNr-1). |
|
2526 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
2527 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
2528 |
] |
|
2529 |
] |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2530 |
]. |
18059 | 2531 |
self updateChangeList. |
16467 | 2532 |
self autoSelectOrEnd:lastChangeNr. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2533 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2534 |
"Created: / 13.12.1995 / 16:07:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2535 |
"Modified: / 28.1.1998 / 20:42:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2536 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2537 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2538 |
doDeleteClassFromBeginning |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2539 |
"delete changes with same class as currently selected change from the beginning |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2540 |
up to the selected change. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2541 |
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
|
2542 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2543 |
self withSingleSelectedChangeDo:[:changeNr | |
18059 | 2544 |
|classNameToDelete prevSelection numDeleted| |
2545 |
||
2546 |
classNameToDelete := self classNameOfChange:changeNr. |
|
2547 |
classNameToDelete notNil ifTrue:[ |
|
2548 |
prevSelection := changeNr. |
|
2549 |
self unselect. |
|
2550 |
numDeleted := self |
|
2551 |
silentDeleteChangesFor:classNameToDelete |
|
2552 |
from:1 |
|
2553 |
to:changeNr. |
|
2554 |
self updateChangeList. |
|
2555 |
self autoSelectOrEnd:(changeNr + 1 - numDeleted) |
|
2556 |
] |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2557 |
]. |
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 |
"Created: 13.12.1995 / 15:41:58 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2560 |
"Modified: 25.5.1996 / 12:26:34 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2561 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2562 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2563 |
doDeleteClassRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2564 |
"delete rest of changes with same class as currently selected change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2565 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2566 |
self withSingleSelectedChangeDo:[:changeNr | |
18059 | 2567 |
| classNameToDelete | |
2568 |
||
2569 |
classNameToDelete := self classNameOfChange:changeNr. |
|
2570 |
classNameToDelete notNil ifTrue:[ |
|
2571 |
self unselect. |
|
2572 |
self silentDeleteChangesFor:classNameToDelete |
|
2573 |
from:changeNr |
|
2574 |
to:(self numberOfChanges). |
|
2575 |
self updateChangeList. |
|
2576 |
self autoSelectOrEnd:changeNr |
|
2577 |
] |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2578 |
] |
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 |
"Modified: / 18.5.1998 / 14:25:07 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2581 |
! |
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 |
doDeleteClassSelectorAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2584 |
"delete all changes with same class and selector as currently selected change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2585 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2586 |
|classNameSelectorPairsToDelete lastChangeNr overAllNumDeletedBefore| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2587 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2588 |
lastChangeNr := -1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2589 |
classNameSelectorPairsToDelete := Set new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2590 |
self withSelectedChangesDo:[:changeNr | |
17600 | 2591 |
|className selector| |
2592 |
||
2593 |
className := self realClassNameOfChange:changeNr. |
|
2594 |
selector := self selectorOfMethodChange:changeNr. |
|
2595 |
selector notNil ifTrue:[ |
|
2596 |
(className notNil and:[selector notNil]) ifTrue:[ |
|
2597 |
classNameSelectorPairsToDelete add:(className -> selector). |
|
2598 |
] |
|
2599 |
]. |
|
2600 |
lastChangeNr := lastChangeNr max:changeNr. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2601 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2602 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2603 |
overAllNumDeletedBefore := 0. |
18059 | 2604 |
self unselect. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2605 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2606 |
self withExecuteCursorDo:[ |
17600 | 2607 |
classNameSelectorPairsToDelete do:[:pair | |
2608 |
|numDeletedBefore className selector| |
|
2609 |
||
2610 |
className := pair key. |
|
2611 |
selector := pair value. |
|
2612 |
self silentDeleteChangesFor:className selector:selector |
|
2613 |
from:lastChangeNr |
|
2614 |
to:(self numberOfChanges). |
|
2615 |
numDeletedBefore := self |
|
2616 |
silentDeleteChangesFor:className selector:selector |
|
2617 |
from:1 |
|
2618 |
to:(lastChangeNr-1). |
|
2619 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
2620 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
2621 |
]. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2622 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2623 |
|
18059 | 2624 |
self updateChangeList. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2625 |
self autoSelectOrEnd:lastChangeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2626 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2627 |
"Created: / 13.12.1995 / 16:07:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2628 |
"Modified: / 28.1.1998 / 20:42:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2629 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2630 |
|
16475 | 2631 |
doDeleteClassSelectorOlder |
18596 | 2632 |
"delete this and older changes with same class and selector |
2633 |
as the currently selected change(s). |
|
2634 |
If the selected change is a class-definition change, |
|
2635 |
older definitions for this class are deleted. |
|
2636 |
If the selected change is a method-category change, |
|
2637 |
older category changes for this method are deleted" |
|
16475 | 2638 |
|
18232 | 2639 |
|classNameSelectorTypeTuplesToDelete |
18596 | 2640 |
lastChangeNr overAllNumDeletedBefore hasCheckinInfoSelected| |
2641 |
||
2642 |
hasCheckinInfoSelected := false. |
|
16475 | 2643 |
lastChangeNr := -1. |
18232 | 2644 |
classNameSelectorTypeTuplesToDelete := OrderedCollection new. |
16475 | 2645 |
|
17597 | 2646 |
"/ collect info on what is to be deleted |
18232 | 2647 |
self withSelectedChangesInOrder:#reverse do:[:changeNr | |
2648 |
|className selector changeType| |
|
2649 |
||
17600 | 2650 |
className := self realClassNameOfChange:changeNr. |
16475 | 2651 |
selector := self selectorOfMethodChange:changeNr. |
18596 | 2652 |
selector notNil ifTrue:[ |
2653 |
changeType := #methodChange. |
|
2654 |
] ifFalse:[ |
|
18232 | 2655 |
(changeInfoList at:changeNr) isMethodCategoryChange ifTrue:[ |
2656 |
selector := self selectorOfMethodCategoryChange:changeNr. |
|
2657 |
selector notNil ifTrue:[ |
|
2658 |
changeType := #methodCategoryChange. |
|
2659 |
] |
|
18596 | 2660 |
] ifFalse:[ |
2661 |
(self isClassDefinitionChange:changeNr) ifTrue:[ |
|
2662 |
changeType := #classDefinitionChange. |
|
2663 |
] ifFalse:[ |
|
2664 |
(self changeIsCheckinInfo:changeNr) ifTrue:[ |
|
2665 |
changeType := #checkinInfo. |
|
2666 |
hasCheckinInfoSelected := true. |
|
2667 |
] |
|
2668 |
] |
|
2669 |
]. |
|
16475 | 2670 |
]. |
18596 | 2671 |
changeType notNil ifTrue:[ |
18232 | 2672 |
classNameSelectorTypeTuplesToDelete add:{ className . selector . changeType . changeNr}. |
2673 |
]. |
|
16475 | 2674 |
lastChangeNr := lastChangeNr max:changeNr. |
2675 |
]. |
|
2676 |
||
2677 |
overAllNumDeletedBefore := 0. |
|
18059 | 2678 |
self unselect. |
16475 | 2679 |
|
2680 |
self withExecuteCursorDo:[ |
|
18232 | 2681 |
classNameSelectorTypeTuplesToDelete do:[:tuple | |
2682 |
|numDeletedBefore className selector changeType lastToDelete| |
|
2683 |
||
2684 |
className := tuple at:1. |
|
2685 |
selector := tuple at:2. |
|
2686 |
changeType := tuple at:3. |
|
2687 |
lastToDelete := (tuple at:4) - overAllNumDeletedBefore. |
|
2688 |
||
2689 |
changeType == #methodCategoryChange ifTrue:[ |
|
2690 |
numDeletedBefore := self |
|
2691 |
silentDeleteMethodCategoryChangesFor:className selector:selector |
|
2692 |
from:1 to:lastToDelete. |
|
18596 | 2693 |
] ifFalse:[ |
2694 |
changeType == #classDefinitionChange ifTrue:[ |
|
2695 |
numDeletedBefore := self |
|
2696 |
silentDeleteClassDefinitionChangesFor:className |
|
2697 |
from:1 to:lastToDelete. |
|
2698 |
] ifFalse:[ |
|
2699 |
changeType == #checkinInfo ifTrue:[ |
|
2700 |
numDeletedBefore := self |
|
2701 |
silentDeleteCheckinInfosFor:className |
|
2702 |
from:1 to:lastToDelete. |
|
2703 |
] ifFalse:[ |
|
2704 |
changeType == #methodChange ifTrue:[ |
|
2705 |
numDeletedBefore := self |
|
2706 |
silentDeleteChangesFor:className selector:selector |
|
2707 |
from:1 to:lastToDelete. |
|
2708 |
] ifFalse:[ |
|
2709 |
numDeletedBefore := 0. |
|
2710 |
self halt:'oops'. |
|
2711 |
]. |
|
2712 |
] |
|
2713 |
] |
|
18232 | 2714 |
]. |
16475 | 2715 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
2716 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
2717 |
]. |
|
2718 |
]. |
|
2719 |
||
18059 | 2720 |
self updateChangeList. |
18596 | 2721 |
|
2722 |
hasCheckinInfoSelected ifFalse:[ |
|
2723 |
"/ skip over info chunks |
|
2724 |
[ |
|
2725 |
lastChangeNr > 1 |
|
2726 |
and:[ self changeIsSpecialInfo:lastChangeNr anyOf:#('snapshot' 'checkin')] |
|
2727 |
] whileTrue:[ |
|
2728 |
lastChangeNr := lastChangeNr - 1 |
|
2729 |
]. |
|
2730 |
]. |
|
16475 | 2731 |
self autoSelectOrEnd:lastChangeNr |
17597 | 2732 |
|
2733 |
"Modified: / 25-07-2017 / 10:57:31 / cg" |
|
18596 | 2734 |
"Modified: / 15-02-2019 / 12:26:02 / Claus Gittinger" |
16475 | 2735 |
! |
2736 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2737 |
doDeleteFromBeginning |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2738 |
"delete all changes from 1 to the current" |
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 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2741 |
self deleteChangesFrom:1 to:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2742 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2743 |
self autoSelectOrEnd:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2744 |
] |
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 |
doDeleteRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2748 |
"delete all changes from current to the end" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2749 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2750 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2751 |
self deleteChangesFrom:changeNr to:(self numberOfChanges). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2752 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2753 |
self autoSelectOrEnd:changeNr-1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2754 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2755 |
! |
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 |
doFileoutAndDeleteClassAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2758 |
"first fileOut the selected changes class then delete all changes |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2759 |
for it." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2760 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2761 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2762 |
| className class | |
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 |
className := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2765 |
className notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2766 |
class := Smalltalk classNamed:className. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2767 |
class notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2768 |
Class fileOutErrorSignal handle:[:ex | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2769 |
self warn:('fileout failed: ' , ex description). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2770 |
] do:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2771 |
class fileOut. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2772 |
self doDeleteClassAll |
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 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2775 |
|
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2779 |
"Modified: 6.9.1995 / 17:11:16 / claus" |
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2782 |
doMakePatch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2783 |
"user wants a change to be made a patch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2784 |
- copy it over to the patches file" |
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 |
self withSelectedChangesDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2787 |
self makeChangeAPatch:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2788 |
self autoSelect:(changeNr + 1) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2789 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2790 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2791 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2792 |
doMakePermanent |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2793 |
"user wants a change to be made permanent |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2794 |
- rewrite the source file where this change has to go" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2795 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2796 |
|yesNoBox| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2797 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2798 |
self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2799 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2800 |
yesNoBox := YesNoBox new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2801 |
yesNoBox title:(resources string:'Warning: this operation cannot be undone'). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2802 |
yesNoBox okText:(resources string:'continue') noText:(resources string:'abort'). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2803 |
yesNoBox okAction:[ |changeNr| |
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 |
changeNr := self theSingleSelection. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2806 |
changeNr notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2807 |
self makeChangePermanent:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2808 |
self autoSelect:(changeNr + 1) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2809 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2810 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2811 |
yesNoBox showAtPointer. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2812 |
yesNoBox destroy |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2813 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2814 |
"Modified: 7.1.1997 / 23:03:33 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2815 |
! |
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 |
doSave |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2818 |
"user wants a change to be appended to a file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2819 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2820 |
|fileName| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2821 |
|
13651 | 2822 |
fileName := Dialog |
2823 |
requestFileNameForSave:(resources string:'Append change to:') |
|
2824 |
default:(lastSaveFileName ? '') |
|
2825 |
ok:(resources string:'Append') |
|
2826 |
abort:(resources string:'Abort') |
|
2827 |
pattern:'*.chg'. |
|
2828 |
fileName isEmptyOrNil ifTrue:[ |
|
2829 |
^ self |
|
2830 |
]. |
|
2831 |
lastSaveFileName := fileName. |
|
2832 |
||
2833 |
self withWriteCursorDo:[ |
|
2834 |
self withSelectedChangesDo:[:changeNr | |
|
2835 |
self appendChange:changeNr toFile:fileName. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2836 |
self autoSelect:(changeNr + 1) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2837 |
]. |
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 |
|
11685 | 2840 |
"Modified: / 27-07-2012 / 09:46:14 / cg" |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2841 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2842 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2843 |
doSaveClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2844 |
"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
|
2845 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2846 |
self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2847 |
self doSaveClassFrom:1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2848 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2849 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2850 |
doSaveClassAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2851 |
"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
|
2852 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2853 |
self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2854 |
self doSaveClassFrom:1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2855 |
! |
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 |
doSaveClassFrom:startNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2858 |
"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
|
2859 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2860 |
|changeNr classNameToSave| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2861 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2862 |
changeNr := self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2863 |
classNameToSave := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2864 |
classNameToSave notNil ifTrue:[ |
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2865 |
self saveClass:classNameToSave from:startNr |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2866 |
] |
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2869 |
doSaveClassRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2870 |
"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
|
2871 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2872 |
|changeNr| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2873 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2874 |
changeNr := self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2875 |
self doSaveClassFrom:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2876 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2877 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2878 |
"/ self changeSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2879 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2880 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2881 |
doSaveRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2882 |
"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
|
2883 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2884 |
|changeNr fileName| |
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 |
(changeNr := self theSingleSelection) isNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2887 |
^ self information:(resources string:'Only possible if a single change is selected.'). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2888 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2889 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2890 |
fileName := Dialog |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2891 |
requestFileNameForSave:(resources string:'Append changes to:') |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2892 |
default:(lastSaveFileName ? '') |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2893 |
ok:(resources string:'Append') |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2894 |
abort:(resources string:'Abort') |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2895 |
pattern:'*.chg'. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2896 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2897 |
fileName notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2898 |
lastSaveFileName := fileName. |
11685 | 2899 |
self withWriteCursorDo:[ |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2900 |
changeNr to:(self numberOfChanges) do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2901 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2902 |
(self appendChange:changeNr toFile:fileName) ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2903 |
^ self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2904 |
] |
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 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2908 |
|
11685 | 2909 |
"Modified: / 27-07-2012 / 09:46:09 / cg" |
11499
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2912 |
doUpdate |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2913 |
"reread the changes-file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2914 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2915 |
self readChangesFileInBackground:true. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2916 |
self newLabel:''. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2917 |
realized ifTrue:[ |
18059 | 2918 |
self updateChangeList. |
11499
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 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2921 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2922 |
doWriteBack |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2923 |
"write back the list onto the changes file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2924 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2925 |
anyChanges ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2926 |
(self writeBackChanges) ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2927 |
realized ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2928 |
self readChangesFile. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2929 |
realized ifTrue:[ |
18059 | 2930 |
self updateChangeList |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2931 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2932 |
] |
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 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2935 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2936 |
"Modified: 5.9.1996 / 17:19:46 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2937 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2938 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2939 |
findClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2940 |
"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
|
2941 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2942 |
|current| |
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 |
changeNrShown notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2945 |
current := self classNameOfChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2946 |
]. |
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 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2949 |
askForSearch:'Class to search for:' |
17394 | 2950 |
initialAnswer:(current ? lastSearchString) |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2951 |
thenSearchUsing:[:searchString :changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2952 |
|thisClassName| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2953 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2954 |
thisClassName := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2955 |
thisClassName notNil |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2956 |
and:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2957 |
(thisClassName sameAs: searchString) |
13440 | 2958 |
or:[searchString includesMatchCharacters and:[searchString match:thisClassName caseSensitive:false]]] |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2959 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2960 |
onCancel:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2961 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2962 |
lastSearchType := #class. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2963 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
17382 | 2964 |
|
17394 | 2965 |
"Modified: / 12-02-2017 / 11:31:47 / cg" |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2966 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2967 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2968 |
findFirstForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2969 |
"findNextForClass menu action: select the next change for the selected changes class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2970 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2971 |
self findNextForClassStartingAt:1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2972 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2973 |
"Created: / 20-11-2006 / 16:37:56 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2974 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2975 |
|
15674 | 2976 |
findFirstForClass:className |
2977 |
"findNextForClass menu action: select the next change for the selected changes class" |
|
2978 |
||
2979 |
self findNextForClass:className startingAt:1 |
|
2980 |
! |
|
2981 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2982 |
findLastForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2983 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2984 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2985 |
self findPreviousForClassStartingAt:(self numberOfChanges) |
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 |
"Created: / 20-11-2006 / 16:39:15 / cg" |
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 |
|
15674 | 2990 |
findLastForClass:className |
2991 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
|
2992 |
||
2993 |
self findPreviousForClass:className startingAt:(self numberOfChanges) |
|
2994 |
||
2995 |
"Created: / 20-11-2006 / 16:39:15 / cg" |
|
2996 |
! |
|
2997 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2998 |
findLastSnapshot |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2999 |
"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
|
3000 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3001 |
"/ lastSearchType := #snapshot. |
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 |
self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3004 |
findPreviousForWhich: [:changeNr | self changeIsSnapShotInfo:changeNr ] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3005 |
startingAt:(self numberOfChanges) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3006 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3007 |
"Created: / 06-10-2006 / 11:03:39 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3008 |
! |
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 |
findNext |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3011 |
"findNext menu action: select the next change. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3012 |
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
|
3013 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3014 |
lastSearchType == #selector ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3015 |
^ self findNextForSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3016 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3017 |
lastSearchType == #snapshot ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3018 |
^ self findNextSnapshot |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3019 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3020 |
lastSearchType == #string ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3021 |
^ self findNextForString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3022 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3023 |
lastSearchType == #difference ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3024 |
^ self findNextDifference |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3025 |
]. |
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 |
^ self findNextForClass |
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 |
"Created: / 18.6.1998 / 22:15:00 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3030 |
"Modified: / 18.6.1998 / 22:15:25 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3031 |
! |
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 |
findNextDifference |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3034 |
lastSearchType := #difference. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3035 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3036 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3037 |
self findNextForWhich:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3038 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3039 |
"/ same |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3040 |
false |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3041 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3042 |
"/ different |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3043 |
true |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3044 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3045 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3046 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3047 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3048 |
findNextForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3049 |
"findNextForClass menu action: select the next change for the selected changes class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3050 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3051 |
self findNextForClassStartingAt: changeNrShown + 1 |
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 |
"Modified: / 20-11-2006 / 16:37:49 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3054 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3055 |
|
15674 | 3056 |
findNextForClass:className startingAt:startNr |
3057 |
"findNextForClass menu action: select the next change for the selected changes class" |
|
3058 |
||
3059 |
lastSearchType := #class. |
|
3060 |
||
3061 |
self |
|
3062 |
findNextForWhich:[:changeNr | |
|
3063 |
|thisClass| |
|
3064 |
||
3065 |
thisClass := self classNameOfChange:changeNr. |
|
3066 |
(thisClass = className |
|
3067 |
or:[className includesMatchCharacters |
|
3068 |
and:[className match:thisClass]])] |
|
3069 |
startingAt:startNr |
|
3070 |
! |
|
3071 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3072 |
findNextForClassStartingAt:startNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3073 |
"findNextForClass menu action: select the next change for the selected changes class" |
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 |
|cls| |
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 |
lastSearchType := #class. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3078 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3079 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3080 |
cls := self classNameOfChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3081 |
cls isNil ifTrue:[^ self]. |
15674 | 3082 |
self findNextForClass:cls startingAt:startNr. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3083 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3084 |
"Created: / 20-11-2006 / 16:37:37 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3085 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3086 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3087 |
findNextForSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3088 |
"findNextForSelector menu action: select the next change for the selected changes selector" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3089 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3090 |
|sel| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3091 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3092 |
lastSearchType := #selector. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3093 |
changeNrShown isNil ifTrue:[^ self]. |
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 |
sel := self selectorOfMethodChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3096 |
sel isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3097 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3098 |
self findNextForWhich: [:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3099 |
|thisSelector| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3100 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3101 |
thisSelector := self selectorOfMethodChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3102 |
(thisSelector = sel or:[sel includesMatchCharacters and:[sel match:thisSelector]]) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3103 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3104 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3105 |
! |
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 |
findNextForString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3108 |
lastSearchString isNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3109 |
^ self findString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3110 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3111 |
self findNextWithString:lastSearchString |
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3114 |
findNextForWhich:aBlock |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3115 |
"helper: select the next change for which aBlock evaluates to true" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3116 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3117 |
^ self findNextForWhich:aBlock startingAt:changeNrShown + 1 |
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 |
"Modified: / 20-11-2006 / 16:34:23 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3120 |
! |
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 |
findNextForWhich:aBlock startingAt:changeNrToStartSearch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3123 |
"helper: select the next change for which aBlock evaluates to true" |
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 |
^ self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3126 |
findNextOrPrevious:#next |
18059 | 3127 |
forWhich:aBlock |
3128 |
startingAt:changeNrToStartSearch |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3129 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3130 |
"Created: / 20-11-2006 / 16:34:06 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3131 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3132 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3133 |
findNextOrPrevious:direction forWhich:aBlock startingAt:changeNrToStartSearch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3134 |
"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
|
3135 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3136 |
self withCursor:Cursor questionMark do:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3137 |
Object userInterruptSignal handle:[:ex | |
17941 | 3138 |
self beepInEditor. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3139 |
^ 0 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3140 |
] do:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3141 |
|increment nr lastNr| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3142 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3143 |
increment := (direction == #previous) ifTrue:[-1] ifFalse:[1]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3144 |
lastNr := self numberOfChanges. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3145 |
nr := changeNrToStartSearch. |
19263 | 3146 |
[ (direction == #previous and:[nr > 0]) |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3147 |
or:[ direction == #next and:[ nr <= lastNr]] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3148 |
] whileTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3149 |
(aBlock value:nr) ifTrue:[ |
18059 | 3150 |
self selectChange:nr. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3151 |
^ nr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3152 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3153 |
nr := nr + increment. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3154 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3155 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3156 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3157 |
self showNotFound. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3158 |
self windowGroup sensor flushKeyboard. "/ avoid multiple beeps, in case of type ahead |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3159 |
^ 0 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3160 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3161 |
"Created: / 08-03-2012 / 11:57:26 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3162 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3163 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3164 |
findNextSnapshot |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3165 |
"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
|
3166 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3167 |
lastSearchType := #snapshot. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3168 |
changeNrShown isNil ifTrue:[^ self]. |
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 |
self findNextForWhich: [:changeNr | self changeIsSnapShotInfo:changeNr ] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3171 |
! |
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 |
findNextWithString:searchString |
14939 | 3174 |
|includesMatchCharacters| |
3175 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3176 |
lastSearchType := #string. |
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 |
lastSearchString := searchString. |
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 |
changeNrShown isNil ifTrue:[ |
14939 | 3181 |
changeNrShown := 0. |
3182 |
]. |
|
3183 |
||
3184 |
includesMatchCharacters := searchString includesMatchCharacters. |
|
11499
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 |
self findNextForWhich: |
14939 | 3187 |
[:changeNr | |
3188 |
|s| |
|
3189 |
||
3190 |
s := self sourceOfMethodChange:changeNr. |
|
3191 |
s notNil and:[ |
|
3192 |
(includesMatchCharacters not and:[(s findString:searchString) ~~ 0]) |
|
3193 |
or:[ includesMatchCharacters and:[('*' , searchString , '*') match:s ]]] |
|
3194 |
]. |
|
11499
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 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3197 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3198 |
codeView setSearchPattern:searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3199 |
codeView |
14939 | 3200 |
searchFwd:searchString |
3201 |
ignoreCase:false |
|
3202 |
startingAtLine:1 col:0 |
|
3203 |
ifAbsent:nil. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3204 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3205 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3206 |
findPrevious |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3207 |
"findPrevious menu action: select the previous change. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3208 |
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
|
3209 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3210 |
lastSearchType == #selector ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3211 |
^ self findPreviousForSelector |
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 |
lastSearchType == #snapshot ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3214 |
^ self findPreviousSnapshot |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3215 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3216 |
lastSearchType == #string ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3217 |
^ self findPreviousForString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3218 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3219 |
lastSearchType == #difference ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3220 |
^ self findPreviousDifference |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3221 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3222 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3223 |
^ self findPreviousForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3224 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3225 |
"Created: / 18.6.1998 / 22:15:15 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3226 |
! |
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 |
findPreviousDifference |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3229 |
lastSearchType := #difference. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3230 |
changeNrShown isNil ifTrue:[^ self]. |
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 |
self findPreviousForWhich:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3233 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3234 |
"/ same |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3235 |
false |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3236 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3237 |
"/ different |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3238 |
true |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3239 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3240 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3241 |
! |
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 |
findPreviousForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3244 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3245 |
|
12738 | 3246 |
self findPreviousForClassStartingAt:((changeNrShown ? 1) - 1) |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3247 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3248 |
"Modified: / 20-11-2006 / 16:39:04 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3249 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3250 |
|
15674 | 3251 |
findPreviousForClass:className startingAt:startNr |
3252 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
|
3253 |
||
3254 |
lastSearchType := #class. |
|
3255 |
||
3256 |
self |
|
3257 |
findPreviousForWhich: |
|
3258 |
[:changeNr | |
|
3259 |
|thisClass| |
|
3260 |
||
3261 |
thisClass := self classNameOfChange:changeNr. |
|
3262 |
(thisClass = className |
|
3263 |
or:[className includesMatchCharacters |
|
3264 |
and:[className match:thisClass]])] |
|
3265 |
startingAt:startNr |
|
3266 |
! |
|
3267 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3268 |
findPreviousForClassStartingAt:startNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3269 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
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 |
|cls| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3272 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3273 |
lastSearchType := #class. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3274 |
changeNrShown isNil ifTrue:[^ self]. |
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 |
cls := self classNameOfChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3277 |
cls isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3278 |
|
15674 | 3279 |
self findPreviousForClass:cls startingAt:startNr |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3280 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3281 |
"Created: / 20-11-2006 / 16:38:37 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3282 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3283 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3284 |
findPreviousForSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3285 |
"findPreviousForSelector menu action: select the previous change for the selected changes selector" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3286 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3287 |
|sel| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3288 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3289 |
lastSearchType := #selector. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3290 |
changeNrShown isNil ifTrue:[^ 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 |
sel := self selectorOfMethodChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3293 |
sel isNil ifTrue:[^ self]. |
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 |
self findPreviousForWhich: |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3296 |
[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3297 |
|thisSelector| |
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 |
thisSelector := self selectorOfMethodChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3300 |
(thisSelector = sel |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3301 |
or:[sel includesMatchCharacters and:[sel match:thisSelector]]) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3302 |
] |
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 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3305 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3306 |
findPreviousForString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3307 |
lastSearchString isNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3308 |
^ self findString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3309 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3310 |
self findPreviousWithString:lastSearchString |
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 |
findPreviousForWhich:aBlock |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3314 |
"helper: select the previous change for which aBlock evaluates to true" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3315 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3316 |
^ self findPreviousForWhich:aBlock startingAt:(changeNrShown - 1) |
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 |
"Modified: / 06-10-2006 / 11:01:38 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3319 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3320 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3321 |
findPreviousForWhich:aBlock startingAt:changeNrToStartSearch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3322 |
"helper: select the previous change for which aBlock evaluates to true" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3323 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3324 |
^ self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3325 |
findNextOrPrevious:#previous |
18059 | 3326 |
forWhich:aBlock |
3327 |
startingAt:changeNrToStartSearch |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3328 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3329 |
"Created: / 06-10-2006 / 11:01:09 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3330 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3331 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3332 |
findPreviousSnapshot |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3333 |
"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
|
3334 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3335 |
lastSearchType := #snapshot. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3336 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3337 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3338 |
self findPreviousForWhich: [:changeNr | self changeIsSnapShotInfo:changeNr ] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3339 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3340 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3341 |
findPreviousWithString:searchString |
14939 | 3342 |
|includesMatchCharacters| |
3343 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3344 |
lastSearchType := #string. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3345 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3346 |
lastSearchString := searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3347 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3348 |
changeNrShown isNil ifTrue:[ |
14939 | 3349 |
changeNrShown := 0. |
3350 |
]. |
|
3351 |
||
3352 |
includesMatchCharacters := searchString includesMatchCharacters. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3353 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3354 |
self findPreviousForWhich: |
14939 | 3355 |
[:changeNr | |
3356 |
|s | |
|
3357 |
||
3358 |
s := self sourceOfMethodChange:changeNr. |
|
3359 |
s notNil and:[ |
|
3360 |
(includesMatchCharacters not and:[(s findString:searchString) ~~ 0]) |
|
3361 |
or:[includesMatchCharacters and:[('*' , searchString , '*') match:s ]]] |
|
3362 |
]. |
|
11499
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 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3365 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3366 |
codeView setSearchPattern:searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3367 |
codeView |
14939 | 3368 |
searchFwd:searchString |
3369 |
ignoreCase:false |
|
3370 |
startingAtLine:1 col:0 |
|
3371 |
ifAbsent:nil. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3372 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3373 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3374 |
findSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3375 |
"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
|
3376 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3377 |
|current| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3378 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3379 |
changeNrShown notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3380 |
current := self selectorOfMethodChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3381 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3382 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3383 |
self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3384 |
askForSearch:'Selector to search for:' |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3385 |
initialAnswer:current |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3386 |
thenSearchUsing:[:searchString :changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3387 |
|thisSelector| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3388 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3389 |
thisSelector := self selectorOfMethodChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3390 |
(thisSelector = searchString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3391 |
or:[searchString includesMatchCharacters and:[searchString match:thisSelector]]) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3392 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3393 |
onCancel:[^ self]. |
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 |
lastSearchType := #selector. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3396 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3397 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3398 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3399 |
findString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3400 |
|searchString directionHolder| |
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 |
lastSearchType := #string. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3403 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3404 |
searchString := codeView selection. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3405 |
searchString size == 0 ifTrue:[searchString := lastSearchString]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3406 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3407 |
searchString := self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3408 |
askForSearchString:'String to search for:' |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3409 |
initialAnswer:(searchString ? '') |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3410 |
directionInto:(directionHolder := ValueHolder new). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3411 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3412 |
searchString size == 0 ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3413 |
^ self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3414 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3415 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3416 |
directionHolder value == #backward ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3417 |
self findPreviousWithString:searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3418 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3419 |
self findNextWithString:searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3420 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3421 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3422 |
|
10719 | 3423 |
ignorePublicPrivateCategories:aBoolean |
3424 |
UserPreferences current ignorePublicPrivateCategories:aBoolean |
|
3425 |
||
3426 |
"Created: / 23-09-2011 / 19:52:21 / cg" |
|
3427 |
! |
|
3428 |
||
3202 | 3429 |
menuExit |
3204 | 3430 |
self closeRequest |
3202 | 3431 |
! |
3432 |
||
3433 |
openAboutThisApplication |
|
3434 |
"opens an about box for this application." |
|
3435 |
||
7115 | 3436 |
Dialog aboutClass:self class. |
3437 |
||
3438 |
"Modified: / 12-09-2006 / 17:20:22 / cg" |
|
3202 | 3439 |
! |
3440 |
||
3441 |
openHTMLDocument:relativeDocPath |
|
3442 |
HTMLDocumentView openFullOnDocumentationFile:relativeDocPath |
|
3443 |
! |
|
3444 |
||
9055 | 3445 |
openSettingsDialog |
14558 | 3446 |
|settingsList| |
9055 | 3447 |
|
3448 |
settingsList := |
|
3449 |
#( |
|
3450 |
#('Editor' #'AbstractSettingsApplication::EditSettingsAppl' ) |
|
3451 |
"/ #('Syntax Color' #'AbstractSettingsApplication::SyntaxColorSettingsAppl' ) |
|
3452 |
"/ #('Code Format' #'AbstractSettingsApplication::SourceCodeFormatSettingsAppl' ) |
|
3453 |
"/ #('System Browser' #'AbstractSettingsApplication::SystemBrowserSettingsAppl' ) |
|
3454 |
#('Compiler' #'AbstractSettingsApplication::GeneralCompilerSettingsAppl' ) |
|
3455 |
#('Compiler/ByteCode' #'AbstractSettingsApplication::ByteCodeCompilerSettingsAppl' ) |
|
3456 |
"/ #('Source Code Management' #'AbstractSettingsApplication::SourceCodeManagementSettingsAppl') |
|
3457 |
). |
|
3458 |
||
14558 | 3459 |
SettingsDialog |
3460 |
openWithList:settingsList |
|
3461 |
label:(resources string:'Change Browser Settings'). |
|
9055 | 3462 |
! |
3463 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3464 |
setEnforcedNameSpace |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3465 |
|nsName listOfKnownNameSpaces keepAsDefaultHolder| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3466 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3467 |
listOfKnownNameSpaces := Set new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3468 |
NameSpace |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3469 |
allNameSpaces |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3470 |
do:[:eachNameSpace | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3471 |
listOfKnownNameSpaces add:eachNameSpace name |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3472 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3473 |
listOfKnownNameSpaces := listOfKnownNameSpaces asOrderedCollection sort. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3474 |
|
15450 | 3475 |
Dialog modifyingBoxWith:[:box | |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3476 |
keepAsDefaultHolder := true asValue. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3477 |
box verticalPanel |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3478 |
add:((CheckBox |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3479 |
label:(resources string:'Use this as default in the future')) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3480 |
model:keepAsDefaultHolder). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3481 |
] do:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3482 |
nsName := Dialog |
15450 | 3483 |
request:(resources string:'When applying, new classes are created in nameSpace:') |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3484 |
initialAnswer:(enforcedNameSpace ? LastEnforcedNameSpace ? Class nameSpaceQuerySignal query name) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3485 |
list:listOfKnownNameSpaces. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3486 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3487 |
nsName isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3488 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3489 |
(nsName isEmpty or:[nsName = 'Smalltalk']) ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3490 |
applyInOriginalNameSpace value:true. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3491 |
LastEnforcedNameSpace := enforcedNameSpace := nil. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3492 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3493 |
applyInOriginalNameSpace value:false. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3494 |
LastEnforcedNameSpace := enforcedNameSpace := NameSpace name:nsName. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3495 |
autoCompare value ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3496 |
self doUpdate |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3497 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3498 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3499 |
KeepEnforcedNameSpace := keepAsDefaultHolder value. |
11680
5b1a15736f97
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11499
diff
changeset
|
3500 |
codeView nameSpaceForDoits:enforcedNameSpace. |
5b1a15736f97
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11499
diff
changeset
|
3501 |
diffView textViews do:[:each | each nameSpaceForDoits:enforcedNameSpace]. |
5b1a15736f97
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11499
diff
changeset
|
3502 |
|
5b1a15736f97
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11499
diff
changeset
|
3503 |
"Modified: / 26-07-2012 / 23:06:23 / cg" |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3504 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3505 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3506 |
setEnforcedPackage |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3507 |
|pkg listOfKnownPackages| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3508 |
|
16207 | 3509 |
listOfKnownPackages := Smalltalk allPackageIDs. |
12645 | 3510 |
"/ Smalltalk allClassesDo:[:eachClass | |
3511 |
"/ |package| |
|
3512 |
"/ |
|
3513 |
"/ package := eachClass package. |
|
3514 |
"/ package size > 0 ifTrue:[ |
|
3515 |
"/ listOfKnownPackages add:package |
|
3516 |
"/ ] |
|
3517 |
"/ ]. |
|
3518 |
listOfKnownPackages := listOfKnownPackages asNewOrderedCollection sort. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3519 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3520 |
pkg := Dialog |
12645 | 3521 |
request:'When applying, changes go into package:' |
3522 |
initialAnswer:(enforcedPackage ? Class packageQuerySignal query) |
|
3523 |
list:listOfKnownPackages. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3524 |
pkg size ~~ 0 ifTrue:[ |
12645 | 3525 |
enforcedPackage := pkg |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3526 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3527 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3528 |
|
3202 | 3529 |
showAboutSTX |
3530 |
ToolApplicationModel openAboutSTX |
|
3531 |
! ! |
|
3532 |
||
202 | 3533 |
!ChangesBrowser methodsFor:'private'! |
3534 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3535 |
autoSelect:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3536 |
"select a change" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3537 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3538 |
self class autoSelectNext ifTrue:[ |
18059 | 3539 |
(changeNr <= self numberOfChanges) ifTrue:[ |
3540 |
self selectChange:changeNr. |
|
3541 |
^ self |
|
3542 |
] |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3543 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3544 |
self clearCodeView. |
18059 | 3545 |
self unselect. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3546 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3547 |
"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
|
3548 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3549 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3550 |
autoSelectLast |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3551 |
"select the last change" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3552 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3553 |
self autoSelect:(self numberOfChanges) |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3554 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3555 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3556 |
autoSelectOrEnd:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3557 |
"select the next change or the last" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3558 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3559 |
|last| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3560 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3561 |
last := self numberOfChanges. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3562 |
changeNr < last ifTrue:[ |
18059 | 3563 |
self autoSelect:changeNr |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3564 |
] ifFalse:[ |
18059 | 3565 |
last == 0 ifTrue:[ |
3566 |
last := nil |
|
3567 |
]. |
|
3568 |
self selectChange:last. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3569 |
] |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3570 |
|
3406
8fe22b36fbc2
fixed autoselectNext if list is empty
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
3571 |
"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
|
3572 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3573 |
|
16372 | 3574 |
changeChunkAt:index |
3575 |
^ (changeInfoList at:index) chunk |
|
3576 |
"/ ^ changeChunks at:index |
|
3577 |
||
3578 |
"Created: / 01-05-2016 / 18:24:28 / cg" |
|
3579 |
! |
|
3580 |
||
3581 |
changeClassNameAt:index |
|
3582 |
^ (changeInfoList at:index) className |
|
3583 |
||
3584 |
"Created: / 01-05-2016 / 18:28:13 / cg" |
|
3585 |
"Modified: / 01-05-2016 / 19:32:42 / cg" |
|
3586 |
! |
|
3587 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3588 |
checkClassIsLoaded:aClass |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3589 |
"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
|
3590 |
|
6162
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
3591 |
|cls answer| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3592 |
|
3359
2cc7eff866e4
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
3341
diff
changeset
|
3593 |
cls := aClass theNonMetaclass. |
5825 | 3594 |
cls isLoaded ifTrue:[ |
6357 | 3595 |
^ true. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3596 |
]. |
11805 | 3597 |
(classesNotToBeAutoloaded includes:#all) ifTrue:[ |
3598 |
^ false. |
|
3599 |
]. |
|
8026
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3600 |
(classesNotToBeAutoloaded includes:cls) ifTrue:[ |
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3601 |
^ false. |
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3602 |
]. |
5825 | 3603 |
|
6216 | 3604 |
autoloadAsRequired value == true ifTrue:[ |
6357 | 3605 |
answer := true |
6216 | 3606 |
] ifFalse:[ |
11805 | 3607 |
answer := Dialog |
3608 |
confirmWithCancel:(resources |
|
17400 | 3609 |
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 | 3610 |
with:cls name allBold) |
3611 |
labels:(resources array:#('Cancel' 'No for All' 'No' 'Yes')) |
|
3612 |
values:#(nil #never false true) |
|
3613 |
default:4. |
|
3614 |
answer isNil ifTrue:[ |
|
3615 |
"cancel the operation" |
|
3616 |
AbortAllOperationRequest raise. |
|
3617 |
"not reached" |
|
3618 |
]. |
|
3619 |
answer == #never ifTrue:[ |
|
3620 |
classesNotToBeAutoloaded add:#all. |
|
3621 |
^ false. |
|
3622 |
]. |
|
8026
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3623 |
]. |
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3624 |
|
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3625 |
answer ifTrue:[ |
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3626 |
Autoload autoloadFailedSignal catch:[ |
6357 | 3627 |
^ cls autoload isLoaded |
3628 |
] |
|
5825 | 3629 |
]. |
6162
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
3630 |
|
8026
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3631 |
classesNotToBeAutoloaded add:cls. |
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3632 |
|
6162
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
3633 |
^ false. |
17400 | 3634 |
|
3635 |
"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
|
3636 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3637 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3638 |
checkSingleSelectedChange |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3639 |
"just a helper, check for a single selection" |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3640 |
|
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3641 |
|changeNr| |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3642 |
|
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3643 |
(changeNr := self theSingleSelection) isNil ifTrue:[ |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3644 |
self information:'Only possible if a single change is selected.'. |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3645 |
AbortSignal raise. |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3646 |
^ nil. |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3647 |
]. |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3648 |
^ changeNr |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3649 |
! |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3650 |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3651 |
classFromEvaluatingTree:aParseTree |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3652 |
|thisClass| |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3653 |
|
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3654 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3655 |
do:[ |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3656 |
thisClass := Parser undefinedVariableError handle:[:ex | ] do:[ aParseTree evaluate ]. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3657 |
]. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3658 |
^ thisClass |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3659 |
|
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3660 |
"Created: / 05-03-2012 / 14:28:01 / cg" |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3661 |
! |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3662 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3663 |
clearCodeView |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3664 |
"clear the (lower) code view." |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3665 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3666 |
self unselect "changeListView deselect". |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3667 |
codeView contents:nil. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3668 |
changeNrShown := nil |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3669 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3670 |
|
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3671 |
currentSourceForParseTree:parseTree |
12845 | 3672 |
|selector thisClass method mClass thisClassSym ownerClass receiver classGlobalNode| |
4857 | 3673 |
|
6288 | 3674 |
(parseTree isNil |
3675 |
or:[parseTree == #Error |
|
4857 | 3676 |
or:[ parseTree isMessage not ]]) ifTrue:[ |
6614 | 3677 |
^ nil |
4857 | 3678 |
]. |
3679 |
||
3680 |
selector := parseTree selector. |
|
3681 |
receiver := parseTree receiver. |
|
3682 |
||
3683 |
selector == #'removeSelector:' ifTrue:[ |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3684 |
thisClass := self classFromEvaluatingTree:receiver. |
6614 | 3685 |
thisClass isBehavior ifTrue:[ |
3686 |
thisClass isLoaded ifTrue:[ |
|
3687 |
selector := (parseTree arg1 evaluate). |
|
3688 |
(thisClass includesSelector:selector) ifTrue:[ |
|
3689 |
^ (thisClass compiledMethodAt:selector) source. |
|
3690 |
] |
|
3691 |
] ifFalse:[ |
|
19039 | 3692 |
^ c'Cannot compare this change\n\n(compare requires class to be loaded).'. |
6614 | 3693 |
] |
3694 |
] ifFalse:[ |
|
3695 |
^ 'Cannot compare this change (class not present)'. |
|
3696 |
]. |
|
4857 | 3697 |
]. |
3698 |
selector == #'comment:' ifTrue:[ |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3699 |
thisClass := self classFromEvaluatingTree:receiver. |
6614 | 3700 |
thisClass isBehavior ifTrue:[ |
3701 |
thisClass isLoaded ifTrue:[ |
|
3702 |
^ thisClass name , ' comment: ' , thisClass comment storeString. |
|
3703 |
] ifFalse:[ |
|
19039 | 3704 |
^ c'Cannot compare this change\n\n(compare requires class to be loaded).'. |
6614 | 3705 |
] |
3706 |
] ifFalse:[ |
|
3707 |
^ 'Cannot compare this change (class not present)'. |
|
3708 |
]. |
|
4857 | 3709 |
]. |
3710 |
||
7953 | 3711 |
(#(#'category:' #'package:') includes:selector) ifTrue:[ |
6614 | 3712 |
receiver isMessage ifTrue:[ |
3713 |
receiver selector == #compiledMethodAt: ifTrue:[ |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3714 |
"/ thisClass := self classFromEvaluatingTree:receiver receiver. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3715 |
"/ thisClass isNil ifTrue:[ |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3716 |
"/ ^ 'Class does not exist.'. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3717 |
"/ ]. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3718 |
|
6614 | 3719 |
classGlobalNode := receiver receiver. |
3720 |
(classGlobalNode isMessage and:[classGlobalNode selector == #class]) ifTrue:[ |
|
3721 |
classGlobalNode := classGlobalNode receiver |
|
3722 |
]. |
|
3723 |
classGlobalNode isUndeclared ifTrue:[ |
|
3724 |
^ 'Class does not exist.'. |
|
3725 |
]. |
|
3726 |
Error handle:[method := nil] do:[method := receiver evaluate]. |
|
7953 | 3727 |
method isMethod ifFalse:[ |
3728 |
^ 'There is no such method'. |
|
3729 |
]. |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3730 |
mClass := method mclass. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3731 |
|
7953 | 3732 |
selector == #category: ifTrue:[ |
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3733 |
"/ method category = parseTree arg1 evaluate ifFalse:[ |
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3734 |
^ '(' , mClass name , ' compiledMethodAt: ' , method selector storeString , ') category: ' , method category storeString. |
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3735 |
"/ ]. |
6614 | 3736 |
] ifFalse:[ |
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3737 |
"/ method package = parseTree arg1 evaluate ifFalse:[ |
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3738 |
^ '(' , mClass name , ' compiledMethodAt: ' , method selector storeString , ') package: ' , method package storeString. |
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3739 |
"/ ]. |
7953 | 3740 |
]. |
3741 |
^ nil |
|
6614 | 3742 |
] |
3743 |
] |
|
4857 | 3744 |
]. |
3745 |
||
3746 |
selector == #'instanceVariableNames:' ifTrue:[ |
|
6614 | 3747 |
receiver isMessage ifTrue:[ |
3748 |
receiver selector == #class ifTrue:[ |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3749 |
thisClass := self classFromEvaluatingTree:receiver. |
6614 | 3750 |
thisClass isBehavior ifTrue:[ |
3751 |
thisClass isLoaded ifTrue:[ |
|
4857 | 3752 |
"/ varsHere := thisClass instanceVariableString asCollectionOfWords. |
3753 |
"/ varsInChange := (parseTree arguments at:1) evaluate asCollectionOfWords. |
|
6614 | 3754 |
^ thisClass definition. |
3755 |
] ifFalse:[ |
|
19039 | 3756 |
^ c'Cannot compare this change\n\n(compare requires class to be loaded).'. |
6614 | 3757 |
]. |
3758 |
] ifFalse:[ |
|
3759 |
^ 'Cannot compare this change (class not present)'. |
|
3760 |
] |
|
3761 |
]. |
|
3762 |
] |
|
4857 | 3763 |
]. |
3764 |
||
3765 |
(Class definitionSelectors includes:selector) |
|
6288 | 3766 |
"/ selector == #'subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:' |
4857 | 3767 |
ifTrue:[ |
6614 | 3768 |
"/ Class nameSpaceQuerySignal |
3769 |
"/ answer:(self nameSpaceForApply) |
|
3770 |
"/ do:[ |
|
3771 |
"/ superClass := receiver evaluate. |
|
3772 |
"/ ]. |
|
3773 |
"/ superClass isBehavior ifFalse:[ |
|
3774 |
"/ self nameSpaceForApply classNamed:receiver name |
|
3775 |
"/ ]. |
|
3776 |
"/ superClass isBehavior ifFalse:[ |
|
3777 |
"/ |rest matchingKeys superClassName| |
|
3778 |
"/ |
|
3779 |
"/ rest := '::' , receiver name. |
|
3780 |
"/ matchingKeys := Smalltalk keys select:[:nm | nm endsWith:rest]. |
|
3781 |
"/ superClassName := Dialog choose:'Which Class ?' fromList:matchingKeys lines:10. |
|
3782 |
"/ superClassName notEmptyOrNil ifTrue:[ |
|
3783 |
"/ superClass := Smalltalk at:superClassName asSymbol. |
|
3784 |
"/ ]. |
|
3785 |
"/ ]. |
|
3786 |
"/ superClass isBehavior ifFalse:[ |
|
3787 |
"/ ^ 'Cannot compare this change\\(no such superclass).' withCRs. |
|
3788 |
"/ ]. |
|
3789 |
"/ superClass isLoaded ifFalse:[ |
|
3790 |
"/ ^ 'Cannot compare this change\\(superclass not loaded).' withCRs. |
|
3791 |
"/ ]. |
|
3792 |
||
3793 |
thisClassSym := (parseTree arguments at:1) evaluate. |
|
3794 |
||
3795 |
(selector endsWith:':privateIn:') ifTrue:[ |
|
3796 |
ownerClass := (parseTree arguments at:5). |
|
3797 |
ownerClass isUndeclared ifFalse:[ |
|
3798 |
ownerClass := ownerClass evaluate. |
|
3799 |
] ifTrue:[ |
|
3800 |
ownerClass := nil. |
|
3801 |
]. |
|
3802 |
ownerClass isNil ifTrue:[ |
|
19039 | 3803 |
^ c'Cannot compare this change\n\n(owning class is not loaded).'. |
6614 | 3804 |
]. |
3805 |
thisClass := ownerClass privateClassesAt:thisClassSym. |
|
3806 |
] ifFalse:[ |
|
3807 |
thisClass := (self nameSpaceForApply) at:thisClassSym ifAbsent:nil. |
|
3808 |
]. |
|
3809 |
thisClass notNil ifTrue:[ |
|
3810 |
thisClass isLoaded ifFalse:[ |
|
19039 | 3811 |
^ c'Cannot compare this change\n\n(compare requires class to be loaded).'. |
6614 | 3812 |
] ifTrue:[ |
3813 |
^ thisClass definition. |
|
3814 |
] |
|
3815 |
] |
|
4857 | 3816 |
]. |
3817 |
||
3818 |
^ nil. |
|
9570
f81993219003
changed: #oldSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
9548
diff
changeset
|
3819 |
|
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3820 |
"Created: / 15-02-2012 / 15:11:15 / cg" |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3821 |
! |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3822 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3823 |
isChangeSetBrowser |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3824 |
^ false |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3825 |
! |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3826 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3827 |
makeDiffViewInvisible |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3828 |
diffViewBox lower |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3829 |
! |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3830 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3831 |
makeDiffViewVisible |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3832 |
diffViewBox raise |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3833 |
! |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3834 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3835 |
nameSpaceForApply |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3836 |
applyInOriginalNameSpace value ifFalse:[ |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3837 |
^ enforcedNameSpace ? Class nameSpaceQuerySignal query. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3838 |
]. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3839 |
^ Smalltalk. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3840 |
! |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3841 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3842 |
newLabel:how |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3843 |
|l| |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3844 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3845 |
l := self class defaultLabel. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3846 |
(changeFileName notNil and:[changeFileName ~= 'changes']) ifTrue:[ |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3847 |
l := l , ': ', changeFileName |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3848 |
]. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3849 |
l := l , ' ' , how. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3850 |
self label:l |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3851 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3852 |
"Created: / 08-09-1995 / 19:32:04 / claus" |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3853 |
"Modified: / 12-11-2006 / 16:23:53 / cg" |
4857 | 3854 |
! |
3855 |
||
8665 | 3856 |
parseExpression:chunk |
18059 | 3857 |
"parse an expression; return a parseTree" |
3858 |
||
8665 | 3859 |
^ self parseExpression:chunk inNameSpace:(self nameSpaceForApply). |
3860 |
! |
|
3861 |
||
3862 |
parseExpression:text inNameSpace:nameSpace |
|
18059 | 3863 |
"parse an expression; return a parseTree" |
3864 |
||
3865 |
|parser parseTree| |
|
8665 | 3866 |
|
3867 |
"/ old: |
|
3868 |
"/ does not care for VW qualified names |
|
3869 |
"/ ^ Parser parseExpression:text inNameSpace:nameSpace. |
|
3870 |
||
19263 | 3871 |
(text includesString:'§') ifTrue:[ |
18054 | 3872 |
self halt:'should no longer happen' |
3873 |
]. |
|
17094 | 3874 |
|
8665 | 3875 |
"/ new: |
3876 |
parser := Parser for:(ReadStream on:text). |
|
18059 | 3877 |
parser parserFlags |
3878 |
allowQualifiedNames:true; |
|
3879 |
allowDollarInIdentifier:true; |
|
3880 |
allowParagraphInIdentifier:true. |
|
3881 |
||
9228
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3882 |
Error handle:[:ex | |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3883 |
^ nil |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3884 |
] do:[ |
18059 | 3885 |
parseTree := parser |
9228
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3886 |
parseExpressionWithSelf:nil |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3887 |
notifying:nil |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3888 |
ignoreErrors:true |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3889 |
ignoreWarnings:true |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3890 |
inNameSpace:nameSpace. |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3891 |
]. |
18059 | 3892 |
^ parseTree |
17094 | 3893 |
|
3894 |
"Modified: / 21-11-2016 / 23:25:48 / cg" |
|
8665 | 3895 |
! |
3896 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3897 |
queryCloseText |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3898 |
"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
|
3899 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3900 |
^ 'Quit without updating changeFile ?' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3901 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3902 |
|
18059 | 3903 |
selectChange:changeNr |
3904 |
changeListView setSelection:changeNr. |
|
3905 |
self changeSelection:changeNr. |
|
3906 |
! |
|
3907 |
||
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3908 |
selectedClassNames |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3909 |
|classes| |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3910 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3911 |
classes := Set new. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3912 |
self withSelectedChangesDo:[:changeNr | |
6288 | 3913 |
| classNameToCompress | |
3914 |
||
3915 |
classNameToCompress := self classNameOfChange:changeNr. |
|
3916 |
classNameToCompress notNil ifTrue:[ |
|
3917 |
classes add:classNameToCompress. |
|
3918 |
] |
|
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3919 |
]. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3920 |
^ classes |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3921 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3922 |
"Created: / 19.11.2001 / 21:54:59 / cg" |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3923 |
! |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3924 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3925 |
setChangeList |
18059 | 3926 |
<resource: #obsolete> |
16467 | 3927 |
"update the selection-list; |
3928 |
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
|
3929 |
|
18059 | 3930 |
self updateChangeList |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3931 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3932 |
|
3211 | 3933 |
setSingleSelection:changeNr |
3934 |
changeListView multipleSelectOk ifFalse:[ |
|
6288 | 3935 |
changeListView setSelection:changeNr. |
3211 | 3936 |
] ifTrue:[ |
6288 | 3937 |
changeListView setSelection:(Array with:changeNr). |
3211 | 3938 |
]. |
3939 |
! |
|
3940 |
||
16467 | 3941 |
showNumberOfChanges |
3942 |
infoHolder value:(resources string:'%1 changes.' with:changeInfoList size). |
|
3943 |
! |
|
3944 |
||
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3945 |
sourceOfChange:changeNr |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3946 |
|aStream sawExcla chunk| |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3947 |
|
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3948 |
aStream := self streamForChange:changeNr. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3949 |
aStream isNil ifTrue:[ |
6288 | 3950 |
^ nil |
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3951 |
]. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3952 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3953 |
chunk := aStream nextChunk. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3954 |
sawExcla ifTrue:[ |
6288 | 3955 |
chunk := aStream nextChunk |
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3956 |
]. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3957 |
aStream close. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3958 |
^ chunk |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3959 |
! |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3960 |
|
12599
827681c8f7d4
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
3961 |
timeStampPrintStringOf:ts |
827681c8f7d4
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
3962 |
^ ts printString |
17838 | 3963 |
|
3964 |
" |
|
3965 |
self basicNew timeStampPrintStringOf:(Timestamp now) |
|
3966 |
" |
|
3967 |
||
3968 |
"Modified (format): / 05-12-2017 / 15:08:48 / cg" |
|
12599
827681c8f7d4
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
3969 |
! |
827681c8f7d4
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
3970 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3971 |
unselect |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3972 |
"common unselect" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3973 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3974 |
changeListView setSelection:nil. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3975 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3976 |
"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
|
3977 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3978 |
|
18059 | 3979 |
updateChangeList |
3980 |
"update the selection-list; |
|
3981 |
called after the changeList has been modified" |
|
3982 |
||
3983 |
|headerList| |
|
3984 |
||
3985 |
headerList := changeInfoList collect:[:info | info headerLine]. |
|
3986 |
changeListView setList:headerList expandTabs:false redraw:false. |
|
3987 |
changeListView invalidate. |
|
3988 |
self showNumberOfChanges. |
|
3989 |
||
3990 |
"/ changeListView deselect. |
|
3991 |
||
3992 |
"Modified: / 01-05-2016 / 19:27:35 / cg" |
|
3993 |
! |
|
3994 |
||
3211 | 3995 |
withSelectedChangesDo:aBlock |
3996 |
"just a helper, check for a selected change and evaluate aBlock |
|
3997 |
with busy cursor" |
|
3998 |
||
3999 |
self withSelectedChangesInOrder:nil do:aBlock |
|
4000 |
! |
|
4001 |
||
4002 |
withSelectedChangesInOrder:order do:aBlock |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4003 |
"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
|
4004 |
with busy cursor" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4005 |
|
3211 | 4006 |
|changeNrSelection| |
4007 |
||
4008 |
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
|
4009 |
|
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
4010 |
"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
|
4011 |
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
|
4012 |
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
|
4013 |
|
3211 | 4014 |
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
|
4015 |
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
|
4016 |
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
|
4017 |
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
|
4018 |
] |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
4019 |
] |
3211 | 4020 |
] 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
|
4021 |
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
|
4022 |
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
|
4023 |
|changeNumbers| |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
4024 |
|
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
4025 |
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
|
4026 |
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
|
4027 |
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
|
4028 |
]. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
4029 |
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
|
4030 |
] |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
4031 |
] |
3211 | 4032 |
]. |
4033 |
! |
|
4034 |
||
4035 |
withSelectedChangesReverseDo:aBlock |
|
4036 |
"just a helper, check for a selected change and evaluate aBlock |
|
4037 |
with busy cursor" |
|
4038 |
||
4039 |
self withSelectedChangesInOrder:#reverse do:aBlock |
|
3668 | 4040 |
! |
4041 |
||
4042 |
withSingleSelectedChangeDo:aBlock |
|
4043 |
"just a helper, check for a single selection, and evaluate aBlock |
|
4044 |
with busy cursor" |
|
4045 |
||
4046 |
self theSingleSelection isNil ifTrue:[ |
|
6288 | 4047 |
^ self information:'Only possible if a single change is selected.'. |
3668 | 4048 |
]. |
4049 |
||
4050 |
self withSelectedChangesInOrder:nil do:aBlock |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4051 |
! ! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4052 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4053 |
!ChangesBrowser methodsFor:'private-change access'! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4054 |
|
18596 | 4055 |
changeIsCheckinInfo:changeNr |
4056 |
"return true, if a change is a snapShot info chunk" |
|
4057 |
||
4058 |
^ self changeIsSpecialInfo:changeNr anyOf:#('checkin') |
|
4059 |
||
4060 |
"Created: / 15-02-2019 / 11:44:33 / Claus Gittinger" |
|
4061 |
! |
|
4062 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4063 |
changeIsFollowupMethodChange:changeNr |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4064 |
"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
|
4065 |
in a bunch of methodsFor-changes)" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4066 |
|
16372 | 4067 |
^ (changeInfoList at:changeNr) isFollowupChange |
4068 |
||
4069 |
"Created: / 06-02-1998 / 13:03:39 / cg" |
|
4070 |
"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
|
4071 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4072 |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4073 |
changeIsSnapShotInfo:changeNr |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4074 |
"return true, if a change is a snapShot info chunk" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4075 |
|
18596 | 4076 |
^ self changeIsSpecialInfo:changeNr anyOf:#('snapshot') |
4077 |
||
4078 |
"Modified: / 01-05-2016 / 18:25:25 / cg" |
|
4079 |
"Modified: / 15-02-2019 / 11:46:55 / Claus Gittinger" |
|
4080 |
! |
|
4081 |
||
4082 |
changeIsSpecialInfo:changeNr anyOf:wordsToCheck |
|
4083 |
"return true, if a change is an info chunk |
|
4084 |
with info being any from wordsToCheck |
|
4085 |
(i.e. this should contain something like 'checkin', snapshot' etc.)" |
|
4086 |
||
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4087 |
|words chunk| |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4088 |
|
18596 | 4089 |
(changeInfoList at:changeNr) className |
4090 |
"(self classNameOfChange:changeNr)" isNil ifTrue:[ |
|
16372 | 4091 |
" |
4092 |
get the chunk |
|
4093 |
" |
|
4094 |
chunk := self changeChunkAt:changeNr. |
|
4095 |
"mhmh - empty ??" |
|
4096 |
chunk notNil ifTrue:[ |
|
4097 |
(chunk startsWith:'''---') ifTrue:[ |
|
4098 |
words := chunk asCollectionOfWords. |
|
4099 |
words size > 2 ifTrue:[ |
|
18596 | 4100 |
(wordsToCheck includes:(words at:2)) ifTrue:[ |
16372 | 4101 |
^ true |
4102 |
]. |
|
4103 |
]. |
|
4104 |
]. |
|
4105 |
]. |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4106 |
]. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4107 |
^ false |
16372 | 4108 |
|
18596 | 4109 |
"Created: / 15-02-2019 / 11:46:36 / Claus Gittinger" |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4110 |
! |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4111 |
|
11396 | 4112 |
classNameFromAttributeChangeParseTree:aParseTree |
4113 |
"mhmh - seems to always return the name of the nonMeta class - is this OK?" |
|
4114 |
||
11397 | 4115 |
|recTree isMeta name| |
11396 | 4116 |
|
4117 |
recTree := aParseTree receiver. |
|
4118 |
||
4119 |
(recTree notNil |
|
4120 |
and:[recTree ~~ #Error |
|
4121 |
and:[recTree isMessage |
|
4122 |
and:[recTree selector == #compiledMethodAt:]]]) ifTrue:[ |
|
4123 |
isMeta := false. |
|
4124 |
recTree := recTree receiver. |
|
4125 |
recTree isUnaryMessage ifTrue:[ |
|
4126 |
(recTree selector ~~ #class) ifTrue:[^ nil]. |
|
4127 |
"id class " |
|
4128 |
recTree := recTree receiver |
|
4129 |
]. |
|
4130 |
recTree isPrimary ifTrue:[ |
|
4131 |
name := recTree name. |
|
4132 |
isMeta ifTrue:[ |
|
4133 |
^ name , ' class'. |
|
4134 |
]. |
|
4135 |
^ name |
|
4136 |
] |
|
4137 |
]. |
|
4138 |
"very strange" |
|
4139 |
^ nil |
|
4140 |
||
4141 |
"Created: / 08-03-2012 / 09:42:36 / cg" |
|
4142 |
! |
|
4143 |
||
4144 |
classNameFromClassDefinitionChange:changeNr |
|
11397 | 4145 |
|changeStream chunk fullParseTree sel arg1Tree ownerTree ownerName name| |
11396 | 4146 |
|
4147 |
"/ must parse the full changes text, to get privacy information. |
|
4148 |
||
4149 |
changeStream := self streamForChange:changeNr. |
|
4150 |
changeStream isNil ifTrue:[ ^ nil]. |
|
4151 |
||
4152 |
chunk := changeStream nextChunk. |
|
4153 |
changeStream close. |
|
4154 |
fullParseTree := self parseExpression:chunk. |
|
4155 |
(fullParseTree isNil or:[fullParseTree == #Error]) ifTrue:[ |
|
4156 |
^ nil |
|
4157 |
]. |
|
4158 |
fullParseTree isMessage ifFalse:[ |
|
4159 |
^ nil |
|
4160 |
]. |
|
4161 |
||
4162 |
sel := fullParseTree selector. |
|
18596 | 4163 |
"/ (Class definitionSelectors includes:sel) ifFalse:[ |
4164 |
"/ ^ nil |
|
4165 |
"/ ]. |
|
4166 |
||
11396 | 4167 |
arg1Tree := fullParseTree arg1. |
16390 | 4168 |
(arg1Tree notNil and:[arg1Tree isLiteral]) ifTrue:[ |
11396 | 4169 |
name := arg1Tree value asString. |
4170 |
||
4171 |
"/ is it a private-class ? |
|
4172 |
('*privateIn:' match:sel) ifTrue:[ |
|
4173 |
ownerTree := fullParseTree args last. |
|
4174 |
ownerName := ownerTree name asString. |
|
4175 |
^ ownerName , '::' , name |
|
4176 |
]. |
|
4177 |
^ name |
|
4178 |
]. |
|
4179 |
"very strange" |
|
4180 |
^ nil |
|
4181 |
||
4182 |
"Created: / 08-03-2012 / 09:34:04 / cg" |
|
18596 | 4183 |
"Modified: / 15-02-2019 / 12:08:55 / Claus Gittinger" |
11396 | 4184 |
! |
4185 |
||
4186 |
classNameFromReceiverInParseTree:aParseTree |
|
4187 |
"extrat the class name from a method-change, methodRemove or comment-change's |
|
4188 |
parse tree" |
|
4189 |
||
4190 |
|recTree isMeta cls name| |
|
4191 |
||
4192 |
recTree := aParseTree receiver. |
|
4193 |
(recTree isNil or:[recTree == #Error]) ifTrue:[ |
|
4194 |
"more strange things" |
|
4195 |
^ nil |
|
4196 |
]. |
|
4197 |
||
4198 |
isMeta := false. |
|
4199 |
recTree isUnaryMessage ifTrue:[ |
|
4200 |
(recTree selector ~~ #class) ifTrue:[^ nil]. |
|
4201 |
"id class methodsFor:..." |
|
4202 |
recTree := recTree receiver. |
|
4203 |
isMeta := true. |
|
4204 |
]. |
|
4205 |
recTree isPrimary ifTrue:[ |
|
4206 |
cls := self classFromEvaluatingTree:recTree. |
|
4207 |
cls notNil ifTrue:[^ cls name]. |
|
4208 |
||
4209 |
name := recTree name. |
|
4210 |
isMeta ifTrue:[ |
|
4211 |
^ name , ' class'. |
|
4212 |
]. |
|
4213 |
^ name |
|
4214 |
]. |
|
4215 |
||
4216 |
"more strange things" |
|
4217 |
^ nil |
|
4218 |
||
4219 |
"Created: / 08-03-2012 / 09:26:57 / cg" |
|
4220 |
! |
|
4221 |
||
4222 |
classNameFromRemoveClassParseTree:aParseTree |
|
11397 | 4223 |
"tree is: Smalltalk removeClass: class" |
4224 |
||
11396 | 4225 |
|recTree arg1Tree| |
4226 |
||
4227 |
recTree := aParseTree receiver. |
|
4228 |
||
4229 |
(recTree notNil |
|
4230 |
and:[recTree ~~ #Error |
|
4231 |
and:[recTree isPrimary |
|
4232 |
and:[recTree name = 'Smalltalk']]]) ifTrue:[ |
|
4233 |
arg1Tree := aParseTree arg1. |
|
13663 | 4234 |
(arg1Tree notNil and:[arg1Tree isVariable]) ifTrue:[ |
11397 | 4235 |
^ arg1Tree name. |
11396 | 4236 |
]. |
4237 |
]. |
|
4238 |
"very strange" |
|
4239 |
^ nil |
|
4240 |
||
4241 |
"Created: / 08-03-2012 / 09:36:59 / cg" |
|
4242 |
! |
|
4243 |
||
11397 | 4244 |
classNameFromRenameClassParseTree:aParseTree |
4245 |
"tree is: Smalltalk renameClass: oldClass to: 'newName'" |
|
4246 |
||
4247 |
|recTree arg1Tree arg2Tree oldName newName| |
|
4248 |
||
4249 |
recTree := aParseTree receiver. |
|
4250 |
||
4251 |
(recTree notNil |
|
4252 |
and:[recTree ~~ #Error |
|
4253 |
and:[recTree isPrimary |
|
4254 |
and:[recTree name = 'Smalltalk']]]) ifTrue:[ |
|
4255 |
arg1Tree := aParseTree arg1. |
|
4256 |
(arg1Tree notNil and:[arg1Tree isPrimary]) ifTrue:[ |
|
4257 |
oldName := arg1Tree name. |
|
4258 |
arg2Tree := aParseTree arg2. |
|
16390 | 4259 |
(arg2Tree notNil and:[arg2Tree isLiteral]) ifTrue:[ |
11397 | 4260 |
newName := arg2Tree evaluate. |
4261 |
(Smalltalk classNamed:oldName) notNil ifTrue:[^ oldName ]. |
|
4262 |
(Smalltalk classNamed:newName) notNil ifTrue:[^ newName ]. |
|
4263 |
]. |
|
4264 |
]. |
|
4265 |
]. |
|
4266 |
"very strange" |
|
4267 |
^ nil |
|
4268 |
||
4269 |
"Created: / 08-03-2012 / 11:42:25 / cg" |
|
4270 |
! |
|
4271 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4272 |
classNameOfChange:changeNr |
6288 | 4273 |
"return the classname of a change |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4274 |
(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
|
4275 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4276 |
|name| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4277 |
|
3364 | 4278 |
name := self realClassNameOfChange:changeNr. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4279 |
name isNil ifTrue:[^ nil]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4280 |
(name endsWith:' class') ifTrue:[ |
12704
6f20f7d39e75
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12656
diff
changeset
|
4281 |
name := name copyButLast:6 |
2263
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 |
^ name |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4284 |
|
3364 | 4285 |
"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
|
4286 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4287 |
|
3202 | 4288 |
extractSelectorOfMethodChange:changeNr |
17400 | 4289 |
"return a method-changes selector, or nil if it's not a methodChange" |
3202 | 4290 |
|
4291 |
|source parser sel chunk aParseTree | |
|
4292 |
||
4293 |
source := self sourceOfMethodChange:changeNr. |
|
4294 |
source isNil ifTrue:[ |
|
8665 | 4295 |
(self classNameOfChange:changeNr) notNil ifTrue:[ |
16372 | 4296 |
chunk := self changeChunkAt:changeNr. |
8665 | 4297 |
chunk isNil ifTrue:[^ nil]. "mhmh - empty" |
4298 |
||
4299 |
aParseTree := self parseExpression:chunk. |
|
4300 |
(aParseTree isNil |
|
4301 |
or:[aParseTree == #Error |
|
4302 |
or:[aParseTree isMessage not]]) ifTrue:[ |
|
4303 |
^ nil "seems strange ... (could be a comment)" |
|
4304 |
]. |
|
4305 |
sel := aParseTree selector. |
|
4306 |
(#( |
|
4307 |
#'removeSelector:' |
|
4308 |
) includes:sel) ifTrue:[ |
|
4309 |
sel := aParseTree arguments at:1. |
|
16390 | 4310 |
sel isLiteral ifTrue:[ |
8665 | 4311 |
sel := sel evaluate. |
4312 |
sel isSymbol ifTrue:[ |
|
4313 |
^ sel |
|
4314 |
] |
|
4315 |
] |
|
4316 |
] |
|
4317 |
]. |
|
4318 |
^ nil |
|
3202 | 4319 |
]. |
4320 |
||
4321 |
||
6288 | 4322 |
parser := Parser |
8665 | 4323 |
parseMethodArgAndVarSpecification:source |
4324 |
in:nil |
|
4325 |
ignoreErrors:true |
|
4326 |
ignoreWarnings:true |
|
4327 |
parseBody:false. |
|
3202 | 4328 |
|
4329 |
(parser notNil and:[parser ~~ #Error]) ifTrue:[ |
|
8665 | 4330 |
sel := parser selector. |
3202 | 4331 |
]. |
4332 |
^ sel |
|
4333 |
||
16372 | 4334 |
"Created: / 24-11-1995 / 14:30:46 / cg" |
4335 |
"Modified: / 01-05-2016 / 18:25:39 / cg" |
|
17400 | 4336 |
"Modified (comment): / 13-02-2017 / 19:57:20 / cg" |
3202 | 4337 |
! |
4338 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4339 |
fullClassNameOfChange:changeNr |
6288 | 4340 |
"return the full classname of a change |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
4341 |
(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
|
4342 |
|
11396 | 4343 |
|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
|
4344 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4345 |
changeNr isNil ifTrue:[^ nil]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4346 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4347 |
first look, if not already known |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4348 |
" |
16372 | 4349 |
name := self changeClassNameAt:changeNr. |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
4350 |
name notNil ifTrue:[ |
7953 | 4351 |
name == #nil ifTrue:[^ nil]. |
4352 |
^ name |
|
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
4353 |
]. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4354 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4355 |
prevMethodDefNr := changeNr. |
16372 | 4356 |
[ (changeInfoList at:prevMethodDefNr) isFollowupChange ] whileTrue:[ |
7953 | 4357 |
prevMethodDefNr := prevMethodDefNr - 1. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4358 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4359 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4360 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4361 |
get the chunk |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4362 |
" |
16372 | 4363 |
chunk := self changeChunkAt:prevMethodDefNr. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4364 |
chunk isNil ifTrue:[^ nil]. "mhmh - empty" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4365 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4366 |
(chunk startsWith:'''---') ifTrue:[ |
7953 | 4367 |
words := chunk asCollectionOfWords. |
4368 |
words size > 2 ifTrue:[ |
|
4369 |
(words at:2) = 'checkin' ifTrue:[ |
|
4370 |
name := words at:3. |
|
4371 |
^ name |
|
4372 |
] |
|
4373 |
]. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4374 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4375 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4376 |
"/ fix it - otherwise, it cannot be parsed |
11396 | 4377 |
((chunk endsWith:'primitiveDefinitions:') |
4378 |
or:[(chunk endsWith:'primitiveFunctions:') |
|
4379 |
or:[(chunk endsWith:'primitiveVariables:')]]) ifTrue:[ |
|
7953 | 4380 |
chunk := chunk , '''''' |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4381 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4382 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4383 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4384 |
use parser to construct a parseTree |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4385 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4386 |
oldDollarSetting := Parser allowDollarInIdentifier. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4387 |
[ |
7953 | 4388 |
Parser allowDollarInIdentifier:true. |
5014 | 4389 |
"/ Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
4390 |
"/ do:[ |
|
8665 | 4391 |
aParseTree := self parseExpression:chunk. |
5014 | 4392 |
"/ ]. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4393 |
|
7953 | 4394 |
aParseTree == #Error ifTrue:[ |
4395 |
(chunk includesString:'comment') ifTrue:[ |
|
4396 |
"/ could be a comment ... |
|
8665 | 4397 |
aParseTree := self parseExpression:chunk , ''''. |
7953 | 4398 |
] |
4399 |
]. |
|
3597
2e7fc0ae28c9
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
4400 |
] ensure:[ |
7953 | 4401 |
Parser allowDollarInIdentifier:oldDollarSetting |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4402 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4403 |
(aParseTree isNil or:[aParseTree == #Error]) ifTrue:[ |
7953 | 4404 |
^ 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
|
4405 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4406 |
aParseTree isMessage ifFalse:[ |
7953 | 4407 |
^ nil "very strange ... (whats that ?)" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4408 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4409 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4410 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4411 |
ask parser for selector |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4412 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4413 |
sel := aParseTree selector. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4414 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4415 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4416 |
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
|
4417 |
" |
6288 | 4418 |
(#(#'methodsFor:' |
4419 |
#'privateMethodsFor:' |
|
4420 |
#'protectedMethodsFor:' |
|
4421 |
#'ignoredMethodsFor:' |
|
4422 |
#'publicMethodsFor:' |
|
4423 |
#'removeSelector:' |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4424 |
#'comment:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4425 |
#'primitiveDefinitions:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4426 |
#'primitiveFunctions:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4427 |
#'primitiveVariables:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4428 |
#'renameCategory:to:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4429 |
#'instanceVariableNames:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4430 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4431 |
#'methodsFor:stamp:' "/ Squeak support |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4432 |
#'commentStamp:prior:' "/ Squeak support |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4433 |
#'addClassVarName:' "/ Squeak support |
2527
afa639104477
some support for dolphin source files
Claus Gittinger <cg@exept.de>
parents:
2511
diff
changeset
|
4434 |
#methodsFor "/ Dolphin support |
3472 | 4435 |
#categoriesForClass "/ Dolphin support |
4436 |
#categoriesFor: "/ Dolphin support |
|
2606 | 4437 |
#methods "/ STV support |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4438 |
) includes:sel) ifTrue:[ |
7953 | 4439 |
" |
4440 |
yes, the className is the receiver |
|
4441 |
" |
|
11396 | 4442 |
^ self classNameFromReceiverInParseTree:aParseTree |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4443 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4444 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4445 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4446 |
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
|
4447 |
" |
6288 | 4448 |
(('subclass:*' match:sel) |
2322 | 4449 |
or:[('variable*ubclass:*' match:sel)]) ifTrue:[ |
7953 | 4450 |
"/ must parse the full changes text, to get |
4451 |
"/ privacy information. |
|
11396 | 4452 |
^ self classNameFromClassDefinitionChange:changeNr |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4453 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4454 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4455 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4456 |
is it a class remove ? |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4457 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4458 |
(sel == #removeClass:) ifTrue:[ |
11396 | 4459 |
^ self classNameFromRemoveClassParseTree:aParseTree |
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 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4463 |
is it a method category change ? |
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 |
((sel == #category:) |
7953 | 4466 |
or:[sel == #package: |
4467 |
or:[sel == #privacy:]]) ifTrue:[ |
|
11396 | 4468 |
^ self classNameFromAttributeChangeParseTree:aParseTree |
4469 |
]. |
|
4470 |
||
4471 |
sel == #renameClass:to: ifTrue:[ |
|
11397 | 4472 |
^ self classNameFromRenameClassParseTree:aParseTree |
11396 | 4473 |
]. |
4474 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4475 |
^ nil |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4476 |
|
16372 | 4477 |
"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
|
4478 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4479 |
|
18596 | 4480 |
isClassDefinitionChange:changeNr |
4481 |
|changeStream chunk fullParseTree sel| |
|
4482 |
||
4483 |
"/ must parse the full changes text, to get privacy information. |
|
4484 |
||
4485 |
changeStream := self streamForChange:changeNr. |
|
4486 |
changeStream isNil ifTrue:[ ^ false]. |
|
4487 |
||
4488 |
chunk := changeStream nextChunk. |
|
4489 |
changeStream close. |
|
4490 |
fullParseTree := self parseExpression:chunk. |
|
4491 |
(fullParseTree isNil or:[fullParseTree == #Error]) ifTrue:[ |
|
4492 |
^ false |
|
4493 |
]. |
|
4494 |
fullParseTree isMessage ifFalse:[ |
|
4495 |
^ false |
|
4496 |
]. |
|
4497 |
||
4498 |
sel := fullParseTree selector. |
|
4499 |
^ (Class definitionSelectors includes:sel). |
|
4500 |
||
4501 |
"Created: / 15-02-2019 / 12:08:44 / Claus Gittinger" |
|
4502 |
! |
|
4503 |
||
12428 | 4504 |
namespaceOfChange:changeNr |
4505 |
"return the namespace of a change or nil" |
|
4506 |
||
15116 | 4507 |
|className namespace idx| |
12428 | 4508 |
|
4509 |
className := self classNameOfChange:changeNr. |
|
4510 |
className isNil ifTrue:[ ^ nil ]. |
|
4511 |
||
15116 | 4512 |
idx := className indexOfSubCollection:'::'. |
4513 |
idx == 0 ifTrue:[ ^ nil ]. |
|
4514 |
namespace := className copyTo:idx-1. |
|
12428 | 4515 |
^ namespace |
4516 |
! |
|
4517 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4518 |
numberOfChanges |
16372 | 4519 |
^ changeInfoList size |
4520 |
||
4521 |
"Created: / 03-12-1995 / 18:15:39 / cg" |
|
4522 |
"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
|
4523 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4524 |
|
2511 | 4525 |
ownerClassNameOfChange:changeNr |
6288 | 4526 |
"return the owner classname of a change |
2511 | 4527 |
For a normal class, this is the className; |
4528 |
for a private class, this is the name of the owning class" |
|
4529 |
||
4706 | 4530 |
|name "ns idx" cls| |
2511 | 4531 |
|
4532 |
name := self classNameOfChange:changeNr. |
|
4533 |
name isNil ifTrue:[^ nil]. |
|
4534 |
cls := Smalltalk at:name asSymbol. |
|
4535 |
(cls notNil and:[cls isBehavior]) ifTrue:[ |
|
6288 | 4536 |
cls owningClass notNil ifTrue:[ |
4537 |
^ cls owningClass name |
|
4538 |
]. |
|
4539 |
^ cls name |
|
2511 | 4540 |
]. |
4541 |
||
4542 |
"/ (name includes:$:) ifTrue:[ |
|
4543 |
"/ idx := name indexOf:$:. |
|
4544 |
"/ ns := name copyTo:idx-1. |
|
4545 |
"/ ns := Smalltalk at:ns asSymbol. |
|
4546 |
"/ ns notNil ifTrue:[ |
|
6288 | 4547 |
"/ |
2511 | 4548 |
"/ ]. |
4549 |
"/ |
|
4550 |
"/ name := name copyFrom:idx+2. |
|
4551 |
"/ (Smalltalk at:ns asSymbol) notNil ifTrue:[ |
|
4552 |
"/ cls |
|
4553 |
"/ ]. |
|
13851 | 4554 |
"/ ^ name copyButLast:6 |
2511 | 4555 |
"/ ]. |
4556 |
^ name |
|
4557 |
||
4558 |
"Modified: 6.12.1995 / 17:06:31 / cg" |
|
4559 |
! |
|
4560 |
||
3364 | 4561 |
realClassNameOfChange:changeNr |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
4562 |
"return the classname of a change. |
6288 | 4563 |
- 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
|
4564 |
changeClassNames for the next query" |
3364 | 4565 |
|
4566 |
|name| |
|
4567 |
||
16372 | 4568 |
name := self changeClassNameAt:changeNr. |
3364 | 4569 |
name isNil ifTrue:[ |
16372 | 4570 |
name := self fullClassNameOfChange:changeNr. |
4571 |
name isNil ifTrue:[ |
|
4572 |
(changeInfoList at:changeNr) className:#nil. |
|
4573 |
]. |
|
3364 | 4574 |
]. |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
4575 |
name == #nil ifTrue:[^ nil]. |
3364 | 4576 |
^ name |
4577 |
||
16372 | 4578 |
"Created: / 05-11-2001 / 18:09:46 / cg" |
4579 |
"Modified: / 01-05-2016 / 19:24:53 / cg" |
|
3364 | 4580 |
! |
4581 |
||
18059 | 4582 |
selectorOfMethodCategoryChange:changeNr |
4583 |
"return a methodCategory-change's selector, |
|
4584 |
or nil if it's not a methodCategoryChange" |
|
4585 |
||
4586 |
(changeInfoList at:changeNr) isMethodCategoryChange ifFalse:[^ nil]. |
|
4587 |
^ (changeInfoList at:changeNr) selector. |
|
4588 |
||
4589 |
"Modified: / 01-05-2016 / 19:26:21 / cg" |
|
4590 |
! |
|
4591 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4592 |
selectorOfMethodChange:changeNr |
18059 | 4593 |
"return a method-change's selector, |
16467 | 4594 |
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
|
4595 |
|
3202 | 4596 |
|sel | |
4597 |
||
16372 | 4598 |
changeInfoList size >= changeNr ifTrue:[ |
18059 | 4599 |
(changeInfoList at:changeNr) isMethodCategoryChange ifTrue:[^ nil]. |
16372 | 4600 |
sel := (changeInfoList at:changeNr) selector. |
15652 | 4601 |
sel notNil ifTrue:[ ^ sel ]. |
3202 | 4602 |
]. |
4603 |
||
4604 |
sel := self extractSelectorOfMethodChange:changeNr. |
|
4605 |
sel notNil ifTrue:[ |
|
18059 | 4606 |
self assert:(changeInfoList at:changeNr) isMethodCategoryChange not. |
16372 | 4607 |
(changeInfoList at:changeNr) selector:sel. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4608 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4609 |
^ sel |
16372 | 4610 |
|
4611 |
"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
|
4612 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4613 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4614 |
sourceOfMethodChange:changeNr |
17400 | 4615 |
"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
|
4616 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4617 |
|aStream chunk sawExcla parseTree sourceChunk sel| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4618 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4619 |
aStream := self streamForChange:changeNr. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4620 |
aStream isNil ifTrue:[^ nil]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4621 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4622 |
(self changeIsFollowupMethodChange:changeNr) ifFalse:[ |
8665 | 4623 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
4624 |
chunk := aStream nextChunk. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4625 |
] ifTrue:[ |
16372 | 4626 |
chunk := self changeChunkAt:changeNr. |
8665 | 4627 |
sawExcla := true. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4628 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4629 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4630 |
sawExcla ifTrue:[ |
8665 | 4631 |
parseTree := self parseExpression:chunk. |
4632 |
(parseTree notNil |
|
4633 |
and:[parseTree ~~ #Error |
|
4634 |
and:[parseTree isMessage]]) ifTrue:[ |
|
4635 |
sel := parseTree selector. |
|
4636 |
(#( |
|
4637 |
#methodsFor: |
|
4638 |
#privateMethodsFor: |
|
4639 |
#publicMethodsFor: |
|
4640 |
#ignoredMethodsFor: |
|
4641 |
#protectedMethodsFor: |
|
4642 |
||
4643 |
#methodsFor:stamp: "/ Squeak support |
|
4644 |
#commentStamp:prior: "/ Squeak support |
|
4645 |
#methodsFor "/ Dolphin support |
|
4646 |
#methods "/ STV support |
|
4647 |
) |
|
4648 |
includes:sel) ifTrue:[ |
|
4649 |
sourceChunk := aStream nextChunk. |
|
4650 |
] |
|
4651 |
]. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4652 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4653 |
aStream close. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4654 |
^ sourceChunk |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4655 |
|
16372 | 4656 |
"Created: / 05-09-1996 / 17:11:32 / cg" |
4657 |
"Modified: / 01-05-2016 / 18:25:53 / cg" |
|
17400 | 4658 |
"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
|
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 |
streamForChange:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4662 |
"answer a stream for change" |
6288 | 4663 |
|
15858 | 4664 |
|aStream encoding| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4665 |
|
16372 | 4666 |
(changeNr between:1 and:changeInfoList size) ifFalse:[^ nil]. |
5702 | 4667 |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
4668 |
aStream := changeFileName asFilename readStreamOrNil. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4669 |
aStream isNil ifTrue:[^ nil]. |
5702 | 4670 |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4671 |
encodingIfKnown isNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4672 |
encoding := CharacterEncoder guessEncodingOfStream:aStream. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4673 |
encodingIfKnown := encoding ? #none |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4674 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4675 |
(encodingIfKnown notNil and:[encodingIfKnown ~~ #none]) ifTrue:[ |
15858 | 4676 |
aStream := EncodedStream stream:aStream encoding:encodingIfKnown. |
5702 | 4677 |
]. |
4678 |
||
16372 | 4679 |
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
|
4680 |
^ aStream |
16372 | 4681 |
|
4682 |
"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
|
4683 |
! ! |
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 |
!ChangesBrowser methodsFor:'private-changeFile access'! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4686 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4687 |
changeFileName:aFileName |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4688 |
"set the name of the changeFile" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4689 |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4690 |
changeFileName := aFileName. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4691 |
encodingIfKnown := nil. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4692 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4693 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4694 |
checkIfFileHasChanged |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4695 |
"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
|
4696 |
install a timeout for rechecking after some time." |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4697 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4698 |
|f info | |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4699 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4700 |
Processor removeTimedBlock:checkBlock. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4701 |
f := changeFileName asFilename. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4702 |
(info := f info) isNil ifTrue:[ |
16092 | 4703 |
self newLabel:'(unaccessible)' |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4704 |
] ifFalse:[ |
16092 | 4705 |
(info modificationTime) > changeFileTimestamp ifTrue:[ |
4706 |
self newLabel:'(outdated)'. |
|
4707 |
autoUpdate value ifTrue:[ |
|
4708 |
self doUpdate |
|
4709 |
] |
|
4710 |
] ifFalse:[ |
|
4711 |
self newLabel:'' |
|
4712 |
] |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4713 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4714 |
Processor addTimedBlock:checkBlock afterSeconds:5. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4715 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4716 |
"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
|
4717 |
"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
|
4718 |
"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
|
4719 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4720 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4721 |
readChangesFile |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4722 |
"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
|
4723 |
and a list of chunk-positions (changePositions)" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4724 |
|
5178 | 4725 |
self readChangesFileInBackground:false. |
4726 |
self newLabel:''. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4727 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4728 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4729 |
readChangesFileInBackground:inBackground |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4730 |
"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
|
4731 |
and a list of chunk-positions (changePositions). |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4732 |
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
|
4733 |
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
|
4734 |
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
|
4735 |
'+' -> 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
|
4736 |
'-' -> 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
|
4737 |
'?' -> class does not exist currently |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4738 |
'=' -> 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
|
4739 |
'~' -> 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
|
4740 |
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
|
4741 |
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
|
4742 |
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
|
4743 |
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
|
4744 |
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
|
4745 |
4 timestamp |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4746 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4747 |
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
|
4748 |
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
|
4749 |
|
12635 | 4750 |
|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
|
4751 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4752 |
editingClassSource := false. |
2641 | 4753 |
askedForEditingClassSource := false. |
17953 | 4754 |
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
|
4755 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4756 |
"/ maxLen := 60. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4757 |
|
3674 | 4758 |
self newLabel:'updating ...'. |
4759 |
||
4760 |
(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
|
4761 |
^ self class readXMLChangesFromFile:changeFileName inBackground:inBackground |
3674 | 4762 |
]. |
4763 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4764 |
f := changeFileName asFilename. |
7346 | 4765 |
f exists ifFalse:[^ self]. |
12635 | 4766 |
inStream := EncodedStream decodedStreamFor:(f readStream). |
5696 | 4767 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4768 |
i := f info. |
3965
e499c0dae8fc
use #fileSize instead of #size
Claus Gittinger <cg@exept.de>
parents:
3962
diff
changeset
|
4769 |
changeFileSize := i fileSize. |
3962
3906b10c42fd
modified -> modificationTime
Claus Gittinger <cg@exept.de>
parents:
3930
diff
changeset
|
4770 |
changeFileTimestamp := i modificationTime. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4771 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4772 |
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
|
4773 |
" |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4774 |
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
|
4775 |
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
|
4776 |
" |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4777 |
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
|
4778 |
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
|
4779 |
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
|
4780 |
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
|
4781 |
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
|
4782 |
]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4783 |
|
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4784 |
[ |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4785 |
|reader| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4786 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4787 |
reader := ChangeFileReader new. |
6516
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
4788 |
reader changeFileName:changeFileName. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4789 |
reader browser:self. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4790 |
reader enforcedNameSpace:enforcedNameSpace. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4791 |
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
|
4792 |
reader autoloadAsRequired:autoloadAsRequired. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4793 |
reader tabSpec:tabSpec. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4794 |
reader inStream:inStream. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4795 |
reader noColoring:(NoColoring == true). |
16467 | 4796 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4797 |
reader readChangesFile. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4798 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4799 |
editingClassSource := reader thisIsAClassSource. |
16372 | 4800 |
changeInfoList := reader changeInfo. |
16467 | 4801 |
|
4802 |
self showNumberOfChanges. |
|
7360 | 4803 |
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
|
4804 |
] 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
|
4805 |
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
|
4806 |
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
|
4807 |
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
|
4808 |
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
|
4809 |
]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4810 |
]. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4811 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4812 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4813 |
self checkIfFileHasChanged |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4814 |
|
7360 | 4815 |
"Modified: / 27-08-1995 / 23:06:55 / claus" |
16372 | 4816 |
"Modified: / 01-05-2016 / 19:13:09 / cg" |
17953 | 4817 |
"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
|
4818 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4819 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4820 |
writeBackChanges |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4821 |
"write back the changes file. To avoid problems when the disk is full |
6288 | 4822 |
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
|
4823 |
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
|
4824 |
rename the old change-file to a .bak file and finally rename the |
6288 | 4825 |
tempfile back to the change-file. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4826 |
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
|
4827 |
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
|
4828 |
|
15858 | 4829 |
|inFilename inStream outStream stamp encoding tempFilename| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4830 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4831 |
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
|
4832 |
(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
|
4833 |
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
|
4834 |
^ 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
|
4835 |
] |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4836 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4837 |
|
13123 | 4838 |
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
|
4839 |
[ |
13123 | 4840 |
inStream := inFilename readStream. |
19395 | 4841 |
] on:OpenError do:[:ex| |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4842 |
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
|
4843 |
^ 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
|
4844 |
]. |
9020 | 4845 |
[ |
4846 |
[ |
|
13123 | 4847 |
outStream := FileStream newTemporaryIn:inFilename directory. |
4848 |
tempFilename := outStream fileName. |
|
19395 | 4849 |
] on:OpenError do:[:ex| |
9020 | 4850 |
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
|
4851 |
^ false |
9020 | 4852 |
]. |
4853 |
||
11234 | 4854 |
outStream nextPutLine:'''---- encoding: utf8 ----''!!'. |
9020 | 4855 |
outStream := EncodedStream stream:outStream encoder:(CharacterEncoder encoderForUTF8). |
4856 |
||
4857 |
encoding := CharacterEncoder guessEncodingOfStream:inStream. |
|
4858 |
encoding notNil ifTrue:[ |
|
15858 | 4859 |
inStream := EncodedStream stream:inStream encoding:encoding. |
9020 | 4860 |
]. |
4861 |
||
11685 | 4862 |
self withWriteCursorDo:[ |
9020 | 4863 |
|excla sawExcla done first chunk |
4864 |
nChanges "{Class:SmallInteger}" | |
|
4865 |
||
4866 |
Stream writeErrorSignal handle:[:ex | |
|
4867 |
self warn:('Could not update the changes file.\\' , ex description) withCRs. |
|
13123 | 4868 |
outStream close. |
4869 |
tempFilename remove. |
|
9020 | 4870 |
^ false |
4871 |
] do:[ |
|
4872 |
excla := inStream class chunkSeparator. |
|
4873 |
nChanges := self numberOfChanges. |
|
4874 |
||
4875 |
1 to:nChanges do:[:index | |
|
16372 | 4876 |
inStream position:((changeInfoList at:index) position)-1. |
9020 | 4877 |
sawExcla := inStream peekFor:excla. |
4878 |
chunk := inStream nextChunk. |
|
4879 |
||
4880 |
(chunk notNil |
|
4881 |
and:[(chunk startsWith:'''---- snap') not]) ifTrue:[ |
|
16372 | 4882 |
(stamp := (changeInfoList at:index) timestamp) notNil ifTrue:[ |
9020 | 4883 |
outStream nextPutAll:'''---- timestamp ' , stamp , ' ----'''. |
4884 |
outStream nextPut:excla; cr. |
|
4885 |
]. |
|
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
|
4886 |
]. |
9020 | 4887 |
|
4888 |
sawExcla ifTrue:[ |
|
4889 |
outStream nextPut:excla. |
|
4890 |
outStream nextChunkPut:chunk. |
|
4891 |
outStream cr; cr. |
|
4892 |
" |
|
4893 |
a method-definition chunk - output followups |
|
4894 |
" |
|
4895 |
done := false. |
|
4896 |
first := true. |
|
4897 |
[done] whileFalse:[ |
|
4898 |
chunk := inStream nextChunk. |
|
4899 |
chunk isNil ifTrue:[ |
|
4900 |
outStream cr; cr. |
|
4901 |
done := true |
|
4902 |
] ifFalse:[ |
|
4903 |
chunk isEmpty ifTrue:[ |
|
4904 |
outStream space; nextChunkPut:chunk; cr; cr. |
|
4905 |
done := true. |
|
4906 |
] ifFalse:[ |
|
4907 |
first ifFalse:[ |
|
4908 |
outStream cr; cr. |
|
4909 |
]. |
|
4910 |
outStream nextChunkPut:chunk. |
|
4911 |
]. |
|
4912 |
]. |
|
4913 |
first := false. |
|
4914 |
]. |
|
4915 |
] ifFalse:[ |
|
4916 |
outStream nextChunkPut:chunk. |
|
4917 |
outStream cr |
|
4918 |
] |
|
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
|
4919 |
]. |
9020 | 4920 |
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
|
4921 |
]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4922 |
inStream close. |
9020 | 4923 |
|
17376 | 4924 |
inFilename renameTo:inFilename asBackupFilename. |
13123 | 4925 |
tempFilename renameTo:changeFileName. |
9020 | 4926 |
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
|
4927 |
]. |
9020 | 4928 |
] ensure:[ |
4929 |
inStream close. |
|
4930 |
]. |
|
4931 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4932 |
^ true |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4933 |
|
16372 | 4934 |
"Modified: / 01-05-2016 / 19:30:34 / cg" |
17376 | 4935 |
"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
|
4936 |
! ! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4937 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4938 |
!ChangesBrowser methodsFor:'private-user interaction ops'! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4939 |
|
5735 | 4940 |
appendChange:changeNr toFile:aFileNameOrFileNameString |
202 | 4941 |
"append change to a file. return true if ok." |
4942 |
||
5735 | 4943 |
|fileName changeInStream outStream chunk chunk2 sawExcla separator encoding| |
4944 |
||
4945 |
changeInStream := self streamForChange:changeNr. |
|
4946 |
changeInStream isNil ifTrue:[ |
|
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4947 |
self warn:'Cannot read change'. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4948 |
^ false |
2394
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
4949 |
]. |
5735 | 4950 |
changeInStream skipSeparators. |
4951 |
||
4952 |
separator := changeInStream class chunkSeparator. |
|
2394
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
4953 |
|
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
4954 |
(self changeIsFollowupMethodChange:changeNr) ifTrue:[ |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4955 |
sawExcla := true. |
16372 | 4956 |
chunk := self changeChunkAt:changeNr. |
2394
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
4957 |
] ifFalse:[ |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4958 |
sawExcla := changeInStream peekFor:separator. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4959 |
chunk := changeInStream nextChunk. |
3991 | 4960 |
]. |
4961 |
chunk withoutSeparators isEmpty ifTrue:[ |
|
18152 | 4962 |
self proceedableError:'Empty chunk - should not happen'. |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4963 |
^ false. |
5735 | 4964 |
]. |
4965 |
||
4966 |
fileName := aFileNameOrFileNameString asFilename. |
|
202 | 4967 |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
4968 |
[ |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4969 |
outStream := fileName readWriteStream. |
19395 | 4970 |
] on:OpenError do:[:ex| |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4971 |
self warn:'Cannot update file: ''%1''' with:fileName. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4972 |
^ false |
73 | 4973 |
]. |
202 | 4974 |
|
19127 | 4975 |
outStream fileSize == 0 ifTrue:[ |
11476
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4976 |
encoding := #utf8. |
15090 | 4977 |
outStream nextPutLine:'"{ Encoding: utf8 }" !!'. |
11476
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4978 |
] ifFalse:[ |
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4979 |
encoding := CharacterEncoder guessEncodingOfStream:outStream. |
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4980 |
]. |
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4981 |
|
5735 | 4982 |
encoding notNil ifTrue:[ |
15858 | 4983 |
outStream := EncodedStream stream:outStream encoding:encoding. |
11476
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4984 |
]. |
202 | 4985 |
outStream setToEnd. |
4986 |
||
4987 |
sawExcla ifTrue:[ |
|
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4988 |
outStream nextPut:separator |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4989 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4990 |
outStream nextChunkPut:chunk; cr. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4991 |
sawExcla ifTrue:[ |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4992 |
chunk2 := changeInStream nextChunk. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4993 |
chunk2 withoutSeparators isEmpty ifTrue:[ |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4994 |
self error:'Empty chunk - should not happen'. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4995 |
]. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4996 |
outStream nextChunkPut:chunk2; space |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4997 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4998 |
sawExcla ifTrue:[ |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4999 |
outStream nextPut:separator |
202 | 5000 |
]. |
5001 |
outStream cr. |
|
5735 | 5002 |
|
5003 |
changeInStream close. |
|
202 | 5004 |
outStream close. |
5005 |
^ true |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
5006 |
|
16372 | 5007 |
"Modified: / 01-05-2016 / 18:25:00 / cg" |
18152 | 5008 |
"Modified: / 24-05-2018 / 14:54:56 / Claus Gittinger" |
73 | 5009 |
! |
5010 |
||
51 | 5011 |
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
|
5012 |
"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
|
5013 |
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
|
5014 |
|
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
5015 |
|aStream applyAction nameSpace className changeClass ownerName ownerClass reader doItChunk methodsForChunk pkg |
4877 | 5016 |
alternativeClass shortName orgClassName nsClass aborted| |
45 | 5017 |
|
51 | 5018 |
aStream := self streamForChange:changeNr. |
12973 | 5019 |
aStream isNil ifTrue:[^ false]. |
51 | 5020 |
|
2965 | 5021 |
className := self classNameOfChange:changeNr. |
5022 |
className notNil ifTrue:[ |
|
6378 | 5023 |
className := className asSymbol. |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
5024 |
enforcedNameSpace notNil ifTrue:[ |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
5025 |
changeClass := enforcedNameSpace at:className ifAbsent:nil. |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
5026 |
] ifFalse:[ |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
5027 |
changeClass := Smalltalk at:className ifAbsent:nil. |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
5028 |
]. |
6378 | 5029 |
changeClass isNil ifTrue:[ |
5030 |
changeClass := self classOfChange:changeNr. |
|
5031 |
]. |
|
8351
e99a28a6288b
changed #applyChange: load class before applying a change
Stefan Vogel <sv@exept.de>
parents:
8320
diff
changeset
|
5032 |
changeClass notNil ifTrue:[ |
e99a28a6288b
changed #applyChange: load class before applying a change
Stefan Vogel <sv@exept.de>
parents:
8320
diff
changeset
|
5033 |
"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
|
5034 |
will create a class without methods" |
e99a28a6288b
changed #applyChange: load class before applying a change
Stefan Vogel <sv@exept.de>
parents:
8320
diff
changeset
|
5035 |
changeClass autoload. |
e99a28a6288b
changed #applyChange: load class before applying a change
Stefan Vogel <sv@exept.de>
parents:
8320
diff
changeset
|
5036 |
]. |
51 | 5037 |
]. |
45 | 5038 |
|
51 | 5039 |
changeNrProcessed := changeNr. |
4877 | 5040 |
aborted := false. |
45 | 5041 |
|
6288 | 5042 |
applyAction := |
6378 | 5043 |
[ |
7783
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
5044 |
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
|
5045 |
"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
|
5046 |
Send AbortAllOperationRequest to abort multiple operations" |
6378 | 5047 |
aborted := true. |
5048 |
ex return. |
|
5049 |
] do:[ |
|
5050 |
nameSpace := self nameSpaceForApply. |
|
5051 |
||
5052 |
pkg := enforcedPackage ? Class packageQuerySignal query. |
|
5053 |
Class packageQuerySignal answer:pkg |
|
5054 |
do:[ |
|
5055 |
Class nameSpaceQuerySignal answer:nameSpace |
|
5056 |
do:[ |
|
11244 | 5057 |
Class defaultApplicationQuerySignal handle:[:ex | |
5058 |
ex proceedWith:defaultApplicationForVAGEClasses |
|
5059 |
] do:[ |
|
5060 |
Class changeDefaultApplicationNotificationSignal handle:[:ex | |
|
5061 |
defaultApplicationForVAGEClasses := ex parameter. |
|
5062 |
] do:[ |
|
17899 | 5063 |
|skip| |
5064 |
||
5065 |
skip := false. |
|
11244 | 5066 |
|
5067 |
"/ a followup methodsFor: chunk ... |
|
5068 |
(self changeIsFollowupMethodChange:changeNr) ifTrue:[ |
|
16372 | 5069 |
methodsForChunk := self changeChunkAt:changeNr. |
11244 | 5070 |
] ifFalse:[ |
5071 |
doItChunk := aStream nextChunk. "/ an empty chunk sometimes ... |
|
5072 |
doItChunk notEmpty ifTrue:[ |
|
5073 |
doItChunk first = (Character value:16rFEFF) ifTrue:[ |
|
5074 |
doItChunk := doItChunk copyFrom:2. |
|
5075 |
]. |
|
5076 |
Compiler evaluate:doItChunk notifying:self. |
|
6378 | 5077 |
] ifFalse:[ |
11244 | 5078 |
methodsForChunk := aStream nextChunk. "/ the real one |
6378 | 5079 |
] |
5080 |
]. |
|
11244 | 5081 |
methodsForChunk notNil ifTrue:[ |
5082 |
changeClass isNil ifTrue:[ |
|
5083 |
orgClassName := className. |
|
19288 | 5084 |
classNameMap notNil ifTrue:[ |
5085 |
className := classNameMap at:className ifAbsent:[className] |
|
5086 |
]. |
|
11244 | 5087 |
(className includes:$:) ifTrue:[ |
5088 |
ownerName := className copyTo:(className lastIndexOf:$:) - 1. |
|
5089 |
(ownerName endsWith:$:) ifTrue:[ |
|
12704
6f20f7d39e75
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12656
diff
changeset
|
5090 |
ownerName := ownerName copyButLast:1. |
11244 | 5091 |
]. |
5092 |
||
5093 |
ownerClass := Smalltalk at:(ownerName asSymbol) ifAbsent:[]. |
|
5094 |
ownerClass notNil ifTrue:[ |
|
5095 |
ownerClass autoload |
|
5096 |
]. |
|
5097 |
]. |
|
5098 |
(nameSpace notNil and:[nameSpace ~~ Smalltalk]) ifTrue:[ |
|
5099 |
changeClass := nameSpace at:className ifAbsent:[]. |
|
5100 |
]. |
|
5101 |
changeClass isNil ifTrue:[ |
|
19288 | 5102 |
changeClass := Smalltalk classNamed:className. |
11244 | 5103 |
]. |
18975 | 5104 |
[changeClass isNil and:[className notNil]] whileTrue:[ |
11244 | 5105 |
(NameSpace allNameSpaces |
15683 | 5106 |
contains:[:ns | (nsClass := (ns at:className asSymbol)) notNil]) |
11244 | 5107 |
ifTrue:[ |
5108 |
shortName := nsClass name. |
|
5109 |
] ifFalse:[ |
|
5110 |
shortName := className copyFrom:(className lastIndexOf:$:) + 1. |
|
5111 |
shortName = className ifTrue:[ |
|
5112 |
shortName := '' |
|
5113 |
]. |
|
5114 |
]. |
|
17899 | 5115 |
|
5116 |
skip := false. |
|
5117 |
||
5118 |
Dialog modifyingBoxWith:[:box | |
|
18054 | 5119 |
"/ self halt. |
17899 | 5120 |
box |
5121 |
addButton:(Button label:'Skip' action:[skip := true. box hide]) |
|
5122 |
after:box noButton |
|
5123 |
] do:[ |
|
5124 |
className := Dialog |
|
12973 | 5125 |
request:'No class ''' , className , ''' for change. Add to which class? (enter empty string to skip this change)' |
11244 | 5126 |
initialAnswer:shortName. |
5127 |
]. |
|
17899 | 5128 |
skip ifFalse:[ |
5129 |
className isNil ifTrue:[ |
|
5130 |
AbortAllOperationRequest raise. |
|
5131 |
]. |
|
5132 |
className isEmpty ifTrue:[ |
|
5133 |
^ false |
|
5134 |
]. |
|
5135 |
alternativeClass := Smalltalk classNamed:className. |
|
5136 |
alternativeClass notNil ifTrue:[ |
|
5137 |
changeClass := alternativeClass |
|
5138 |
] |
|
5139 |
]. |
|
11244 | 5140 |
]. |
17899 | 5141 |
skip ifFalse:[ |
5142 |
methodsForChunk := methodsForChunk copyFrom:(methodsForChunk indexOfSeparator). |
|
5143 |
methodsForChunk := changeClass name , methodsForChunk. |
|
5144 |
]. |
|
11244 | 5145 |
]. |
17899 | 5146 |
skip ifFalse:[ |
5147 |
reader := Compiler evaluate:methodsForChunk notifying:self. |
|
5148 |
reader fileInFrom:aStream notifying:self passChunk:false single:true. |
|
5149 |
] |
|
11244 | 5150 |
] |
5151 |
] |
|
6378 | 5152 |
] |
5153 |
] |
|
5154 |
] |
|
5155 |
]. |
|
5156 |
changeNrProcessed := nil. |
|
5157 |
]. |
|
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
5158 |
|
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
5159 |
"/ |
17026 | 5160 |
"/ 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
|
5161 |
"/ |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
5162 |
changeFileName = ObjectMemory nameForChanges ifTrue:[ |
6378 | 5163 |
Class withoutUpdatingChangesDo:[ |
5164 |
Class updateChangeListQuerySignal answer:updateChangeSet value do:applyAction |
|
5165 |
] |
|
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
5166 |
] ifFalse:[ |
6378 | 5167 |
applyAction value |
45 | 5168 |
]. |
4877 | 5169 |
aStream close. |
5170 |
||
5171 |
^ aborted not |
|
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
5172 |
|
16372 | 5173 |
"Modified: / 01-05-2016 / 18:25:18 / cg" |
45 | 5174 |
! |
5175 |
||
7953 | 5176 |
compareCategoryChange:parseTree |
9888 | 5177 |
|receiverExpression method thisClass| |
7953 | 5178 |
|
5179 |
receiverExpression := parseTree receiver. |
|
5180 |
receiverExpression isMessage ifTrue:[ |
|
5181 |
receiverExpression selector == #compiledMethodAt: ifTrue:[ |
|
9888 | 5182 |
[ |
5183 |
thisClass := receiverExpression receiver evaluate. |
|
5184 |
] on:Parser undefinedVariableError do:[:ex| ]. |
|
5185 |
||
5186 |
(thisClass isBehavior |
|
7953 | 5187 |
and:[(method := receiverExpression evaluate) isMethod]) ifTrue:[ |
5188 |
method category = parseTree arg1 evaluate ifTrue:[ |
|
5189 |
^ true -> 'Change has no effect\\(same category)'. |
|
5190 |
] ifFalse:[ |
|
8173 | 5191 |
^ false -> ('Category is different (''' , method category , ''' vs. ''' , parseTree arg1 evaluate , ''')'). |
7953 | 5192 |
] |
5193 |
] ifFalse:[ |
|
5194 |
^ nil -> 'There is no such method'. |
|
5195 |
] |
|
5196 |
] |
|
5197 |
]. |
|
5198 |
^ nil -> 'Unhandled receiver' |
|
5199 |
! |
|
5200 |
||
255 | 5201 |
compareChange:changeNr |
18059 | 5202 |
"compare a change with the current (in-image) version; |
5203 |
show the result of the compare (as dialog)" |
|
2835 | 5204 |
|
5205 |
^ self compareChange:changeNr showResult:true |
|
5206 |
! |
|
5207 |
||
5208 |
compareChange:changeNr showResult:doShowResult |
|
5209 |
"compare a change with current version. |
|
18059 | 5210 |
Return the result of the compare |
5211 |
same -> true, |
|
5212 |
different -> false, |
|
5213 |
uncomparable -> nil. |
|
2835 | 5214 |
If doShowResult is true, the outcome is shown in a dialog/diffViewer." |
255 | 5215 |
|
15016 | 5216 |
|aStream chunk sawExcla parseTree thisClass cat oldSource newSource outcome showDiff d selector isLoaded beep superClass thisClassSym varsHere varsInChange addedVars removedVars |
9888 | 5217 |
isSame ownerClass superClassHere superClassInChange sameAndOutcome| |
255 | 5218 |
|
5219 |
aStream := self streamForChange:changeNr. |
|
2835 | 5220 |
aStream isNil ifTrue:[^ nil]. |
255 | 5221 |
|
275
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
5222 |
showDiff := false. |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
5223 |
|
1472 | 5224 |
(self changeIsFollowupMethodChange:changeNr) ifFalse:[ |
6357 | 5225 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
5226 |
chunk := aStream nextChunk. |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
5227 |
] ifTrue:[ |
16372 | 5228 |
chunk := self changeChunkAt:changeNr. |
6357 | 5229 |
sawExcla := true. |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
5230 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
5231 |
|
2835 | 5232 |
isSame := nil. |
5233 |
||
761 | 5234 |
beep := false. |
255 | 5235 |
sawExcla ifFalse:[ |
6357 | 5236 |
outcome := 'cannot compare this change\\(i.e. this is not a method change).'. |
5237 |
||
5238 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
|
5239 |
do:[ |
|
8665 | 5240 |
parseTree := self parseExpression:chunk. |
6357 | 5241 |
]. |
5242 |
(parseTree notNil and:[parseTree ~~ #Error and:[ parseTree isMessage ]]) ifTrue:[ |
|
5243 |
selector := parseTree selector. |
|
5244 |
||
5245 |
selector == #'removeSelector:' ifTrue:[ |
|
7953 | 5246 |
sameAndOutcome := self compareRemoveSelectorChange:parseTree. |
5247 |
isSame := sameAndOutcome key. |
|
5248 |
outcome := sameAndOutcome value. |
|
5249 |
]. |
|
5250 |
selector == #'package:' ifTrue:[ |
|
5251 |
sameAndOutcome := self comparePackageChange:parseTree. |
|
5252 |
isSame := sameAndOutcome key. |
|
5253 |
outcome := sameAndOutcome value. |
|
6357 | 5254 |
]. |
5255 |
selector == #'category:' ifTrue:[ |
|
7953 | 5256 |
sameAndOutcome := self compareCategoryChange:parseTree. |
5257 |
isSame := sameAndOutcome key. |
|
5258 |
outcome := sameAndOutcome value. |
|
6357 | 5259 |
]. |
5260 |
selector == #'comment:' ifTrue:[ |
|
7953 | 5261 |
sameAndOutcome := self compareCommentChange:parseTree. |
5262 |
isSame := sameAndOutcome key. |
|
5263 |
outcome := sameAndOutcome value. |
|
6357 | 5264 |
]. |
5265 |
||
5266 |
selector == #'instanceVariableNames:' ifTrue:[ |
|
7953 | 5267 |
sameAndOutcome := self compareInstanceVariableNamesChange:parseTree. |
5268 |
isSame := sameAndOutcome key. |
|
5269 |
outcome := sameAndOutcome value. |
|
6357 | 5270 |
]. |
5271 |
||
5272 |
(Class definitionSelectors includes:selector) |
|
5273 |
"/ selector == #'subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:' |
|
5274 |
ifTrue:[ |
|
9888 | 5275 |
[ |
5276 |
superClass := parseTree receiver evaluate. |
|
5277 |
] on:Parser undefinedVariableError do:[:ex| ]. |
|
6357 | 5278 |
superClass isBehavior ifFalse:[ |
5279 |
outcome := 'Cannot compare this change\\(superclass not loaded).'. |
|
5280 |
isSame := nil. |
|
5281 |
] ifTrue:[ |
|
5282 |
(self checkClassIsLoaded:superClass) ifTrue:[ |
|
5283 |
thisClassSym := (parseTree arguments at:1) evaluate. |
|
5284 |
||
5285 |
(selector endsWith:':privateIn:') ifTrue:[ |
|
11475
b6fdfe902263
changed: #compareChange:showResult:
Stefan Vogel <sv@exept.de>
parents:
11397
diff
changeset
|
5286 |
Parser undefinedVariableError catch:[ |
b6fdfe902263
changed: #compareChange:showResult:
Stefan Vogel <sv@exept.de>
parents:
11397
diff
changeset
|
5287 |
ownerClass := (parseTree arguments at:5) evaluate. |
b6fdfe902263
changed: #compareChange:showResult:
Stefan Vogel <sv@exept.de>
parents:
11397
diff
changeset
|
5288 |
ownerClass isBehavior ifTrue:[ |
b6fdfe902263
changed: #compareChange:showResult:
Stefan Vogel <sv@exept.de>
parents:
11397
diff
changeset
|
5289 |
thisClass := ownerClass privateClassesAt:thisClassSym. |
b6fdfe902263
changed: #compareChange:showResult:
Stefan Vogel <sv@exept.de>
parents:
11397
diff
changeset
|
5290 |
]. |
6357 | 5291 |
]. |
5292 |
] ifFalse:[ |
|
5293 |
thisClass := (self nameSpaceForApply) at:thisClassSym ifAbsent:nil. |
|
5294 |
]. |
|
5295 |
thisClass isNil ifTrue:[ |
|
5296 |
outcome := 'Change defines the class: ' , thisClassSym allBold. |
|
5297 |
isSame := false. |
|
5298 |
] ifFalse:[ |
|
5299 |
(isLoaded := self checkClassIsLoaded:thisClass) ifFalse:[ |
|
5300 |
outcome := 'Cannot compare this change\\(compare requires class to be loaded).'. |
|
5301 |
isSame := nil. |
|
5302 |
] ifTrue:[ |
|
5303 |
superClassHere := thisClass superclass name. |
|
5304 |
superClassInChange := parseTree receiver name. |
|
5305 |
superClassHere ~~ superClassInChange ifTrue:[ |
|
5306 |
outcome := 'Superclass is different.'. |
|
5307 |
isSame := false. |
|
5308 |
] ifFalse:[ |
|
5309 |
varsHere := thisClass instanceVariableString asCollectionOfWords. |
|
5310 |
varsInChange := (parseTree arguments at:2) evaluate asCollectionOfWords. |
|
5311 |
varsHere = varsInChange ifTrue:[ |
|
5312 |
thisClass classVariableString asCollectionOfWords = (parseTree arguments at:3) evaluate asCollectionOfWords ifTrue:[ |
|
9689
72819fbf329a
changed: #compareChange:showResult:
Claus Gittinger <cg@exept.de>
parents:
9621
diff
changeset
|
5313 |
((thisClass sharedPoolNames size == 0) and:[(parseTree arguments at:4) evaluate = '']) ifTrue:[ |
6357 | 5314 |
((selector endsWith:':category:') |
5315 |
and:[thisClass category ~= (parseTree arguments at:5) evaluate]) ifTrue:[ |
|
5316 |
outcome := 'Category is different'. |
|
5317 |
isSame := false. |
|
5318 |
] ifFalse:[ |
|
5319 |
outcome := 'Change has no effect\\(same definition)'. |
|
5320 |
isSame := true. |
|
5321 |
] |
|
4296
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5322 |
"/ thisClass category = (parseTree arguments at:5) evaluate ifTrue:[ |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5323 |
"/ outcome := 'Change has no effect\\(same definition)'. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5324 |
"/ isSame := true. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5325 |
"/ ] ifFalse:[ |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5326 |
"/ outcome := 'Category is different'. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5327 |
"/ isSame := false. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5328 |
"/ ] |
6357 | 5329 |
] ifFalse:[ |
5330 |
outcome := 'SharedPool definition is different'. |
|
5331 |
isSame := false. |
|
5332 |
]. |
|
5333 |
] ifFalse:[ |
|
5334 |
outcome := 'ClassVariable definition is different'. |
|
5335 |
isSame := false. |
|
5336 |
] |
|
5337 |
] ifFalse:[ |
|
5338 |
outcome := 'InstanceVariable definition is different'. |
|
5339 |
isSame := false. |
|
12825 | 5340 |
addedVars := varsInChange reject:[:eachVar | (varsHere includes:eachVar)]. |
5341 |
removedVars := varsHere reject:[:eachVar | (varsInChange includes:eachVar)]. |
|
6357 | 5342 |
addedVars isEmpty ifTrue:[ |
5343 |
removedVars isEmpty ifTrue:[ |
|
5344 |
outcome := 'Change reorders instanceVariable(s)'. |
|
5345 |
] ifFalse:[ |
|
5346 |
removedVars := removedVars collect:[:eachVar | '''' , eachVar , '''']. |
|
5347 |
outcome := 'Change removes instanceVariable(s): ' , (removedVars asStringWith:Character space) allBold. |
|
5348 |
] |
|
5349 |
] ifFalse:[ |
|
5350 |
removedVars isEmpty ifTrue:[ |
|
5351 |
addedVars := addedVars collect:[:eachVar | '''' , eachVar , '''']. |
|
5352 |
outcome := 'Change adds instanceVariable(s): ' , (addedVars asStringWith:Character space) allBold. |
|
5353 |
]. |
|
5354 |
]. |
|
5355 |
] |
|
5356 |
] |
|
5357 |
] |
|
5358 |
] |
|
5359 |
] |
|
5360 |
] |
|
5361 |
] |
|
5362 |
] |
|
255 | 5363 |
] ifTrue:[ |
15016 | 5364 |
Class nameSpaceQuerySignal |
5365 |
answer:(self nameSpaceForApply) |
|
5366 |
do:[ |
|
5367 |
parseTree := self parseExpression:chunk. |
|
5368 |
]. |
|
5369 |
||
6357 | 5370 |
(parseTree notNil |
5371 |
and:[parseTree ~~ #Error |
|
5372 |
and:[parseTree isMessage]]) ifTrue:[ |
|
5373 |
"/ Squeak support (#methodsFor:***) |
|
5374 |
(#( |
|
5375 |
#methodsFor: |
|
5376 |
#privateMethodsFor: |
|
5377 |
#publicMethodsFor: |
|
5378 |
#ignoredMethodsFor: |
|
5379 |
#protectedMethodsFor: |
|
5380 |
||
5381 |
#methodsFor:stamp: "/ Squeak support |
|
5382 |
#methodsFor "/ Dolphin support |
|
5383 |
#methods "/ STV support |
|
5384 |
) |
|
5385 |
includes:parseTree selector) ifTrue:[ |
|
9888 | 5386 |
[ |
5387 |
thisClass := parseTree receiver evaluate. |
|
5388 |
] on:Parser undefinedVariableError do:[:ex| |
|
5389 |
outcome := 'Cannot compare this change\\(compare requires class to be loaded).'. |
|
5390 |
isSame := nil. |
|
5391 |
]. |
|
5392 |
thisClass notNil ifTrue:[ |
|
19288 | 5393 |
(thisClass isKindOf:UndefinedVariable) ifTrue:[ |
5394 |
|thisName path| |
|
5395 |
||
5396 |
thisName := thisClass name. |
|
5397 |
classNameMap notNil ifTrue:[ |
|
5398 |
thisName := classNameMap at:thisName ifAbsent:[thisName] |
|
6357 | 5399 |
]. |
19288 | 5400 |
path := thisName asCollectionOfSubstringsSeparatedByAll:'::'. |
5401 |
1 to:path size do:[:length | |
|
5402 |
|ownerName owner| |
|
5403 |
||
5404 |
ownerName := (path copyTo:length) asStringCollection asStringWith:'::'. |
|
5405 |
owner := Smalltalk loadedClassNamed:ownerName. |
|
5406 |
(owner notNil and:[owner isBehavior and:[owner isLoaded not]]) ifTrue:[ |
|
5407 |
self checkClassIsLoaded:owner. |
|
5408 |
]. |
|
6357 | 5409 |
]. |
19288 | 5410 |
thisClass := parseTree receiver evaluate. |
6357 | 5411 |
]. |
19288 | 5412 |
|
5413 |
thisClass isBehavior ifTrue:[ |
|
5414 |
parseTree selector == #methodsFor ifTrue:[ |
|
5415 |
cat := 'Dolphin methods'. |
|
5416 |
] ifFalse:[ |
|
5417 |
parseTree selector == #methods ifTrue:[ |
|
5418 |
cat := 'STV methods'. |
|
5419 |
] ifFalse:[ |
|
5420 |
cat := parseTree arg1 evaluate. |
|
5421 |
]. |
|
5422 |
]. |
|
5423 |
newSource := aStream nextChunk. |
|
5424 |
||
5425 |
isSame := self |
|
5426 |
compareMethodSource:newSource |
|
5427 |
withVersionInClass:thisClass |
|
5428 |
into:[:outcomeResult :beepResult :oldSourceResult| |
|
5429 |
outcome := outcomeResult. |
|
5430 |
beep := beepResult. |
|
5431 |
oldSource := oldSourceResult. |
|
5432 |
]. |
|
5433 |
||
5434 |
isSame isNil ifTrue:[ |
|
5435 |
showDiff := false. |
|
5436 |
] ifFalse:[ |
|
5437 |
showDiff := isSame not. |
|
5438 |
]. |
|
5439 |
||
5440 |
doShowResult ifTrue:[ |
|
5441 |
(showDiff and:[oldSource notNil and:[newSource notNil]]) ifTrue:[ |
|
5442 |
d := DiffCodeView |
|
5443 |
openOn:oldSource label:(resources string:'Current version (in image)') |
|
5444 |
and:newSource label:(resources string:'Change version'). |
|
5445 |
d label:'method differences'. |
|
5446 |
] |
|
5447 |
] |
|
15016 | 5448 |
] ifFalse:[ |
19288 | 5449 |
beep := true. |
5450 |
outcome := 'Class does not exist.'. |
|
5451 |
isSame := nil. |
|
6357 | 5452 |
] |
5453 |
] |
|
19288 | 5454 |
] ifFalse:[ |
6357 | 5455 |
beep := true. |
5456 |
outcome := 'Not comparable.'. |
|
5457 |
isSame := nil. |
|
5458 |
] |
|
5459 |
] ifFalse:[ |
|
5460 |
beep := true. |
|
5461 |
outcome := 'Not comparable.'. |
|
5462 |
isSame := nil. |
|
5463 |
] |
|
255 | 5464 |
]. |
5465 |
aStream close. |
|
2835 | 5466 |
|
5467 |
doShowResult ifTrue:[ |
|
6357 | 5468 |
showDiff ifFalse:[ |
5469 |
outcome := (resources stringWithCRs:outcome). |
|
5470 |
beep ifTrue:[ |
|
5471 |
self warn:outcome. |
|
5472 |
] ifFalse:[ |
|
5473 |
self information:outcome. |
|
5474 |
] |
|
5475 |
]. |
|
255 | 5476 |
]. |
2835 | 5477 |
^ isSame. |
255 | 5478 |
|
9689
72819fbf329a
changed: #compareChange:showResult:
Claus Gittinger <cg@exept.de>
parents:
9621
diff
changeset
|
5479 |
"Created: / 24-11-1995 / 14:30:46 / cg" |
16372 | 5480 |
"Modified: / 01-05-2016 / 18:25:32 / cg" |
255 | 5481 |
! |
5482 |
||
7953 | 5483 |
compareCommentChange:parseTree |
5484 |
|thisClass| |
|
5485 |
||
9888 | 5486 |
[ |
5487 |
thisClass := parseTree receiver evaluate. |
|
5488 |
] on:Parser undefinedVariableError do:[:ex| ]. |
|
5489 |
||
7953 | 5490 |
thisClass isBehavior ifTrue:[ |
5491 |
(self checkClassIsLoaded:thisClass) ifTrue:[ |
|
5492 |
(thisClass comment = parseTree arg1 evaluate) ifTrue:[ |
|
5493 |
^ true -> 'Change has no effect\\(same comment)'. |
|
5494 |
] ifFalse:[ |
|
5495 |
^ false -> 'Comment is different'. |
|
5496 |
] |
|
5497 |
] ifFalse:[ |
|
5498 |
^ nil -> 'Cannot compare this change (compare requires class to be loaded).'. |
|
5499 |
] |
|
5500 |
]. |
|
5501 |
^ nil -> 'Cannot compare this change (class not present)'. |
|
5502 |
! |
|
5503 |
||
5504 |
compareInstanceVariableNamesChange:parseTree |
|
5505 |
|receiverExpression thisClass varsHere varsInChange | |
|
5506 |
||
5507 |
receiverExpression := parseTree receiver. |
|
5508 |
receiverExpression isMessage ifTrue:[ |
|
5509 |
receiverExpression selector == #class ifTrue:[ |
|
9888 | 5510 |
[ |
5511 |
thisClass := receiverExpression evaluate. |
|
5512 |
] on:Parser undefinedVariableError do:[:ex| |
|
5513 |
^ nil -> 'Class is not loaded'. |
|
5514 |
]. |
|
5515 |
||
7953 | 5516 |
varsHere := thisClass instanceVariableString asCollectionOfWords. |
5517 |
varsInChange := (parseTree arguments at:1) evaluate asCollectionOfWords. |
|
5518 |
varsHere = varsInChange ifTrue:[ |
|
5519 |
^ true -> 'Change has no effect\\(same definition)'. |
|
5520 |
] ifFalse:[ |
|
5521 |
^ false -> 'Class-instanceVariable definition is different'. |
|
5522 |
]. |
|
5523 |
]. |
|
5524 |
]. |
|
5525 |
^ nil -> 'Unhandled receiver' |
|
5526 |
! |
|
5527 |
||
15016 | 5528 |
compareMethodSource:newSource withVersionInClass:thisClass into:aThreeArgBlock |
5529 |
"returns true/false/nil if same,different,undecided; |
|
5530 |
also provides a message and a beep-boolean via the passed in block" |
|
5531 |
||
17579 | 5532 |
<ignore: RBReturnsBooleanAndOtherRule rationale: 'done by purpose' author: 'cg'> |
5533 |
||
15016 | 5534 |
|parser sel oldMethod oldSource outcome t1 t2 isLoaded| |
5535 |
||
5536 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
|
5537 |
do:[ |
|
5538 |
parser := Parser parseMethod:newSource in:thisClass. |
|
5539 |
]. |
|
5540 |
(parser isNil or:[parser == #Error]) ifTrue:[ |
|
5541 |
outcome := 'Change is unparsable (parse error).'. |
|
5542 |
aThreeArgBlock value:outcome value:true "beep" value:nil. |
|
5543 |
^ nil. |
|
5544 |
]. |
|
5545 |
||
5546 |
sel := parser selector. |
|
5547 |
oldMethod := thisClass compiledMethodAt:sel. |
|
5548 |
oldMethod isNil ifTrue:[ |
|
5549 |
(isLoaded := self checkClassIsLoaded:thisClass) ifFalse:[ |
|
5550 |
outcome := 'Cannot compare this change\\(compare requires class to be loaded).'. |
|
5551 |
] ifTrue:[ |
|
5552 |
outcome := 'Method does not exist.'. |
|
5553 |
]. |
|
5554 |
aThreeArgBlock value:outcome value:true "beep" value:nil. |
|
5555 |
^ nil. |
|
5556 |
]. |
|
5557 |
||
5558 |
oldSource := oldMethod source. |
|
5559 |
oldSource isNil ifTrue:[ |
|
5560 |
outcome := 'No source for compare.'. |
|
5561 |
aThreeArgBlock value:outcome value:true "beep" value:nil. |
|
5562 |
^ nil. |
|
5563 |
]. |
|
5564 |
(oldSource = newSource) ifTrue:[ |
|
5565 |
outcome := 'Same source'. |
|
5566 |
aThreeArgBlock value:outcome value:false "beep" value:oldSource. |
|
5567 |
^ true. |
|
5568 |
]. |
|
5569 |
||
5570 |
"/ |
|
5571 |
"/ compare for tabulator <-> space changes |
|
5572 |
"/ before showing diff ... |
|
5573 |
"/ |
|
5574 |
t1 := oldSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
5575 |
t2 := newSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
5576 |
t1 = t2 ifTrue:[ |
|
5577 |
outcome := 'Same source'. |
|
5578 |
aThreeArgBlock value:outcome value:false "beep" value:oldSource. |
|
5579 |
^ true. |
|
5580 |
]. |
|
5581 |
||
5582 |
"/ |
|
5583 |
"/ check if only historyLine diffs |
|
5584 |
"/ |
|
5585 |
(HistoryManager notNil |
|
5586 |
and:[HistoryManager isActive]) ifTrue:[ |
|
5587 |
(HistoryManager withoutHistoryLines:newSource) |
|
5588 |
= |
|
5589 |
(HistoryManager withoutHistoryLines:oldSource) |
|
5590 |
ifTrue:[ |
|
5591 |
outcome := 'Same source (history only)'. |
|
5592 |
aThreeArgBlock value:outcome value:false "beep" value:oldSource. |
|
5593 |
^ true. |
|
5594 |
] |
|
5595 |
]. |
|
5596 |
||
5597 |
outcome := 'Source changed.'. |
|
5598 |
aThreeArgBlock value:outcome value:false "beep" value:oldSource. |
|
5599 |
^ false. |
|
17579 | 5600 |
|
5601 |
"Modified: / 16-07-2017 / 13:32:05 / cg" |
|
15016 | 5602 |
! |
5603 |
||
7953 | 5604 |
comparePackageChange:parseTree |
9888 | 5605 |
|receiverExpression method thisClass| |
7953 | 5606 |
|
5607 |
receiverExpression := parseTree receiver. |
|
5608 |
receiverExpression isMessage ifTrue:[ |
|
5609 |
receiverExpression selector == #compiledMethodAt: ifTrue:[ |
|
9888 | 5610 |
[ |
5611 |
thisClass := receiverExpression receiver evaluate. |
|
5612 |
] on:Parser undefinedVariableError do:[:ex| ]. |
|
5613 |
(thisClass isBehavior |
|
7953 | 5614 |
and:[(method := receiverExpression evaluate) isMethod]) ifTrue:[ |
5615 |
method package = parseTree arg1 evaluate ifTrue:[ |
|
5616 |
^ true -> 'Change has no effect\\(same package)'. |
|
5617 |
] ifFalse:[ |
|
8000 | 5618 |
^ false -> ('Package is different (''<1p>'' vs. ''<2p>'')' expandMacrosWith:method package with:parseTree arg1 evaluate). |
7953 | 5619 |
] |
5620 |
] ifFalse:[ |
|
5621 |
^ nil -> 'There is no such method'. |
|
5622 |
] |
|
5623 |
] |
|
5624 |
]. |
|
5625 |
^ nil -> 'Unhandled receiver' |
|
5626 |
! |
|
5627 |
||
5628 |
compareRemoveSelectorChange:parseTree |
|
5629 |
|thisClass selector| |
|
5630 |
||
9888 | 5631 |
[ |
5632 |
thisClass := parseTree receiver evaluate. |
|
5633 |
] on:Parser undefinedVariableError do:[:ex| ]. |
|
5634 |
||
7953 | 5635 |
thisClass isBehavior ifTrue:[ |
5636 |
(self checkClassIsLoaded:thisClass) ifTrue:[ |
|
5637 |
selector := (parseTree arg1 evaluate). |
|
5638 |
(thisClass includesSelector:selector) ifTrue:[ |
|
8000 | 5639 |
^ false -> ('Change removes the #' , selector , ' method from ' , thisClass name). |
7953 | 5640 |
] ifFalse:[ |
8000 | 5641 |
^ true -> ('Change has no effect\\(there is no method for #' , selector , ' in ' , thisClass name , ')'). |
7953 | 5642 |
] |
5643 |
] ifFalse:[ |
|
5644 |
^ nil -> 'Cannot compare this change (compare requires class to be loaded).'. |
|
5645 |
] |
|
5646 |
]. |
|
5647 |
^ nil -> 'Cannot compare this change (class not present)'. |
|
5648 |
! |
|
5649 |
||
1359 | 5650 |
compressForClass:aClassNameOrNil |
6288 | 5651 |
"compress the change-set; |
1359 | 5652 |
this replaces multiple method-changes by the last (i.e. the most recent) change. |
5653 |
If the class argument is nil, compress for all classes. |
|
5654 |
otherwise, only changes for that class are compressed." |
|
5655 |
||
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5656 |
self |
6288 | 5657 |
compressForClass:aClassNameOrNil selector:nil |
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5658 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5659 |
"Modified: / 19.11.2001 / 22:04:12 / cg" |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5660 |
! |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5661 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5662 |
compressForClass:aClassNameOrNil selector:selectorToCompressOrNil |
6288 | 5663 |
"compress the change-set; |
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5664 |
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
|
5665 |
If the class argument is nil, compress for all classes. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5666 |
otherwise, only changes for that class are compressed." |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5667 |
|
6288 | 5668 |
|lbl aStream searchIndex anyMore deleteSet index |
7507 | 5669 |
str snapshotProto snapshotPrefix snapshotNameIndex| |
5670 |
||
5671 |
changeFileName notNil ifTrue:[ |
|
5672 |
aStream := changeFileName asFilename readStreamOrNil. |
|
5673 |
aStream isNil ifTrue:[^ self]. |
|
5674 |
]. |
|
1359 | 5675 |
|
4762 | 5676 |
lbl := 'compressing'. |
1359 | 5677 |
aClassNameOrNil isNil ifTrue:[ |
7507 | 5678 |
selectorToCompressOrNil notNil ifTrue:[ |
5679 |
lbl := lbl , ' for ' , selectorToCompressOrNil. |
|
5680 |
] |
|
1359 | 5681 |
] ifFalse:[ |
7507 | 5682 |
selectorToCompressOrNil isNil ifTrue:[ |
5683 |
lbl := lbl , ' for ' , aClassNameOrNil. |
|
5684 |
] ifFalse:[ |
|
5685 |
lbl := lbl , ' for ' , aClassNameOrNil , '>>' , selectorToCompressOrNil. |
|
5686 |
] |
|
1359 | 5687 |
]. |
6288 | 5688 |
lbl := lbl , '...'. |
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5689 |
self newLabel:lbl. |
1359 | 5690 |
|
5691 |
CompressSnapshotInfo == true ifTrue:[ |
|
7507 | 5692 |
" |
5693 |
get a prototype snapshot record (to be independent of |
|
5694 |
the actual format .. |
|
5695 |
" |
|
16877 | 5696 |
str := WriteStream on:''. |
7507 | 5697 |
Class addChangeRecordForSnapshot:'foo' to:str. |
5698 |
snapshotProto := str contents. |
|
5699 |
snapshotPrefix := snapshotProto copyTo:10. |
|
5700 |
snapshotNameIndex := snapshotProto findString:'foo'. |
|
1359 | 5701 |
]. |
5702 |
||
5703 |
self withExecuteCursorDo:[ |
|
7507 | 5704 |
|numChanges classes selectors types excla sawExcla |
5705 |
chunk aParseTree parseTreeChunk |
|
5706 |
thisClass thisSelector codeChunk codeParser |
|
5707 |
compressThis fileName| |
|
5708 |
||
5709 |
numChanges := self numberOfChanges. |
|
5710 |
classes := Array new:numChanges. |
|
5711 |
selectors := Array new:numChanges. |
|
5712 |
types := Array new:numChanges. |
|
5713 |
||
5714 |
"starting at the end, get the change class and change selector; |
|
5715 |
collect all in classes / selectors" |
|
5716 |
||
5717 |
aStream notNil ifTrue:[ |
|
5718 |
excla := aStream class chunkSeparator. |
|
5719 |
numChanges to:1 by:-1 do:[:changeNr | |
|
16372 | 5720 |
aStream position:((changeInfoList at:changeNr) position)-1. |
7507 | 5721 |
sawExcla := aStream peekFor:excla. |
5722 |
chunk := aStream nextChunk. |
|
5723 |
sawExcla ifTrue:[ |
|
5724 |
"optimize a bit if multiple methods for same category arrive" |
|
5725 |
(chunk = parseTreeChunk) ifFalse:[ |
|
8665 | 5726 |
aParseTree := self parseExpression:chunk. |
7507 | 5727 |
parseTreeChunk := chunk |
5728 |
]. |
|
5729 |
(aParseTree notNil |
|
5730 |
and:[(aParseTree ~~ #Error) |
|
5731 |
and:[aParseTree isMessage]]) ifTrue:[ |
|
5732 |
(#( |
|
5733 |
#methodsFor: |
|
5734 |
#privateMethodsFor: |
|
5735 |
#publicMethodsFor: |
|
5736 |
#ignoredMethodsFor: |
|
5737 |
#protectedMethodsFor: |
|
5738 |
#methodsFor:stamp: "/ Squeak support |
|
5739 |
#methodsFor "/ Dolphin support |
|
5740 |
#methods "/ STV support |
|
5741 |
) |
|
5742 |
includes:aParseTree selector) ifTrue:[ |
|
5743 |
codeChunk := aStream nextChunk. |
|
9543
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5744 |
[ |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5745 |
thisClass := aParseTree receiver evaluate. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5746 |
codeParser := Parser |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5747 |
parseMethodSpecification:codeChunk |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5748 |
in:thisClass |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5749 |
ignoreErrors:true |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5750 |
ignoreWarnings:true. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5751 |
(codeParser notNil and:[codeParser ~~ #Error]) ifTrue:[ |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5752 |
selectors at:changeNr put:(codeParser selector). |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5753 |
classes at:changeNr put:thisClass. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5754 |
types at:changeNr put:#methodsFor |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5755 |
] |
18133 | 5756 |
] on:ParseError do:[:ex| |
9543
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5757 |
"ignore chunk" |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5758 |
ex return. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5759 |
]. |
7507 | 5760 |
] |
5761 |
] |
|
5762 |
] ifFalse:[ |
|
8665 | 5763 |
aParseTree := self parseExpression:chunk. |
7507 | 5764 |
parseTreeChunk := chunk. |
5765 |
(aParseTree notNil |
|
5766 |
and:[(aParseTree ~~ #Error) |
|
5767 |
and:[aParseTree isMessage]]) ifTrue:[ |
|
5768 |
(aParseTree selector == #removeSelector:) ifTrue:[ |
|
9543
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5769 |
[ |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5770 |
thisClass := aParseTree receiver evaluate. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5771 |
selectors at:changeNr put:(aParseTree arg1 value). |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5772 |
classes at:changeNr put:thisClass. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5773 |
types at:changeNr put:#removeSelector |
18133 | 5774 |
] on:ParseError do:[:ex| |
9543
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5775 |
"ignore chunk" |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5776 |
ex return. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5777 |
]. |
7507 | 5778 |
] |
5779 |
] ifFalse:[ |
|
5780 |
CompressSnapshotInfo == true ifTrue:[ |
|
5781 |
(chunk startsWith:snapshotPrefix) ifTrue:[ |
|
13314 | 5782 |
str := chunk readStream position:snapshotNameIndex-1. |
7507 | 5783 |
fileName := str upTo:(Character space). |
5784 |
" |
|
5785 |
kludge to allow use of match-check below |
|
5786 |
" |
|
5787 |
selectors at:changeNr put:snapshotPrefix. |
|
5788 |
classes at:changeNr put:fileName. |
|
5789 |
] |
|
5790 |
] |
|
5791 |
] |
|
5792 |
]. |
|
5793 |
]. |
|
5794 |
aStream close. |
|
5795 |
] ifFalse:[ |
|
5796 |
numChanges to:1 by:-1 do:[:changeNr | |
|
5797 |
|change| |
|
5798 |
||
5799 |
classes at:changeNr put:(self classOfChange:changeNr ifAbsent:[:className| nil]). |
|
5800 |
selectors at:changeNr put:(self selectorOfMethodChange:changeNr). |
|
5801 |
]. |
|
5802 |
]. |
|
5803 |
||
5804 |
"for all changes, look for another class/selector occurrence later |
|
5805 |
in the list and, if there is one, add change number to the delete set" |
|
5806 |
||
5807 |
deleteSet := OrderedCollection new. |
|
5808 |
1 to:self numberOfChanges-1 do:[:changeNr | |
|
5809 |
thisClass := classes at:changeNr. |
|
5810 |
||
5811 |
compressThis := false. |
|
5812 |
aClassNameOrNil isNil ifTrue:[ |
|
5813 |
compressThis := true |
|
5814 |
] ifFalse:[ |
|
5815 |
"/ skipping unloaded/unknown classes |
|
5816 |
thisClass isBehavior ifTrue:[ |
|
5817 |
compressThis := aClassNameOrNil = thisClass theNonMetaclass name. |
|
5818 |
] |
|
5819 |
]. |
|
5820 |
compressThis ifTrue:[ |
|
5821 |
thisSelector := selectors at:changeNr. |
|
5822 |
compressThis := (selectorToCompressOrNil isNil or:[thisSelector == selectorToCompressOrNil]). |
|
5823 |
compressThis ifTrue:[ |
|
5824 |
searchIndex := changeNr. |
|
5825 |
anyMore := true. |
|
5826 |
[anyMore] whileTrue:[ |
|
5827 |
searchIndex := classes indexOf:thisClass startingAt:(searchIndex + 1). |
|
5828 |
(searchIndex ~~ 0) ifTrue:[ |
|
5829 |
((selectors at:searchIndex) == thisSelector) ifTrue:[ |
|
5830 |
thisClass notNil ifTrue:[ |
|
5831 |
deleteSet add:changeNr. |
|
5832 |
anyMore := false |
|
5833 |
] |
|
5834 |
] |
|
5835 |
] ifFalse:[ |
|
5836 |
anyMore := false |
|
5837 |
] |
|
5838 |
]. |
|
5839 |
]. |
|
5840 |
]. |
|
5841 |
]. |
|
5842 |
||
5843 |
"finally delete what has been found" |
|
5844 |
||
5845 |
(deleteSet size > 0) ifTrue:[ |
|
18059 | 5846 |
self unselect. |
7507 | 5847 |
index := deleteSet size. |
5848 |
[index > 0] whileTrue:[ |
|
5849 |
self silentDeleteChange:(deleteSet at:index). |
|
5850 |
index := index - 1 |
|
5851 |
]. |
|
18059 | 5852 |
self updateChangeList. |
7507 | 5853 |
" |
5854 |
scroll back a bit, if we are left way behind the list |
|
5855 |
" |
|
5856 |
changeListView firstLineShown > self numberOfChanges ifTrue:[ |
|
5857 |
changeListView makeLineVisible:self numberOfChanges |
|
5858 |
]. |
|
5859 |
self clearCodeView |
|
5860 |
] |
|
1359 | 5861 |
]. |
5862 |
self newLabel:''. |
|
5863 |
||
7507 | 5864 |
"Created: / 19-11-2001 / 22:03:42 / cg" |
16372 | 5865 |
"Modified: / 01-05-2016 / 19:23:54 / cg" |
1359 | 5866 |
! |
5867 |
||
255 | 5868 |
deleteChange:changeNr |
5869 |
"delete a change" |
|
5870 |
||
5871 |
self deleteChangesFrom:changeNr to:changeNr |
|
5872 |
! |
|
5873 |
||
5874 |
deleteChangesFrom:start to:stop |
|
5875 |
"delete a range of changes" |
|
5876 |
||
18059 | 5877 |
self unselect. |
255 | 5878 |
stop to:start by:-1 do:[:changeNr | |
18059 | 5879 |
self silentDeleteInternalChange:changeNr. |
255 | 5880 |
]. |
6255 | 5881 |
changeListView removeFromIndex:start toIndex:stop. |
744
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
5882 |
|
1070
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
5883 |
"/ changeListView contentsChanged. |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
5884 |
"/ changeListView redrawFromLine:start. |
255 | 5885 |
|
744
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
5886 |
"/ self setChangeList |
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
5887 |
|
1648 | 5888 |
"Modified: / 18.5.1998 / 14:22:27 / cg" |
255 | 5889 |
! |
5890 |
||
202 | 5891 |
makeChangeAPatch:changeNr |
5892 |
"append change to patchfile" |
|
5893 |
||
5894 |
self appendChange:changeNr toFile:'patches' |
|
5895 |
! |
|
5896 |
||
5897 |
makeChangePermanent:changeNr |
|
5898 |
"rewrite the source file where change changeNr lies" |
|
5899 |
||
5900 |
self notify:'this is not yet implemented' |
|
5901 |
! |
|
5902 |
||
73 | 5903 |
silentDeleteChange:changeNr |
5904 |
"delete a change do not update changeListView" |
|
57 | 5905 |
|
73 | 5906 |
anyChanges := true. |
16372 | 5907 |
changeInfoList removeIndex:changeNr. |
5908 |
"/ changeChunks removeIndex:changeNr. |
|
5909 |
"/ changePositions size >= changeNr ifTrue:[ changePositions removeIndex:changeNr ]. |
|
5910 |
"/ changeClassNames size >= changeNr ifTrue:[ changeClassNames removeIndex:changeNr ]. |
|
5911 |
"/ changeSelectors size >= changeNr ifTrue:[ changeSelectors removeIndex:changeNr ]. |
|
5912 |
"/ changeHeaderLines size >= changeNr ifTrue:[ changeHeaderLines removeIndex:changeNr ]. |
|
5913 |
"/ changeTimeStamps size >= changeNr ifTrue:[ changeTimeStamps removeIndex:changeNr ]. |
|
5914 |
"/ changeIsFollowupMethodChange size >= changeNr ifTrue:[ changeIsFollowupMethodChange removeIndex:changeNr ]. |
|
5915 |
||
5916 |
"Modified: / 01-05-2016 / 19:20:40 / cg" |
|
45 | 5917 |
! |
5918 |
||
202 | 5919 |
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
|
5920 |
"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
|
5921 |
Return the number of deleted changes." |
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5922 |
|
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5923 |
|thisClassName index numDeleted| |
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5924 |
|
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5925 |
numDeleted := 0. |
202 | 5926 |
index := stop. |
5927 |
[index >= start] whileTrue:[ |
|
6288 | 5928 |
thisClassName := self classNameOfChange:index. |
5929 |
thisClassName = aClassName ifTrue:[ |
|
5930 |
self silentDeleteChange:index. |
|
5931 |
numDeleted := numDeleted + 1. |
|
5932 |
]. |
|
5933 |
index := index - 1 |
|
1428
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5934 |
]. |
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5935 |
^ numDeleted |
51 | 5936 |
|
45 | 5937 |
! |
5938 |
||
3607 | 5939 |
silentDeleteChangesFor:aClassName selector:selector from:start to:stop |
5940 |
"delete changes for given class/selector in a range. |
|
5941 |
Return the number of deleted changes." |
|
5942 |
||
5943 |
|thisClassName index numDeleted| |
|
5944 |
||
5945 |
numDeleted := 0. |
|
5946 |
index := stop. |
|
5947 |
[index >= start] whileTrue:[ |
|
17600 | 5948 |
thisClassName := self realClassNameOfChange:index. |
5949 |
thisClassName = aClassName ifTrue:[ |
|
5950 |
(self selectorOfMethodChange:index) == selector ifTrue:[ |
|
5951 |
self silentDeleteChange:index. |
|
5952 |
numDeleted := numDeleted + 1. |
|
5953 |
] |
|
5954 |
]. |
|
5955 |
index := index - 1 |
|
3607 | 5956 |
]. |
5957 |
^ numDeleted |
|
5958 |
! |
|
5959 |
||
2511 | 5960 |
silentDeleteChangesForClassAndPrivateClasses:aClassName from:start to:stop |
5961 |
"delete changes for a given class and its private classes in a range. |
|
5962 |
Return the number of deleted changes." |
|
5963 |
||
5964 |
|thisClassName index numDeleted| |
|
5965 |
||
5966 |
numDeleted := 0. |
|
5967 |
index := stop. |
|
5968 |
[index >= start] whileTrue:[ |
|
6288 | 5969 |
thisClassName := self ownerClassNameOfChange:index. |
5970 |
thisClassName = aClassName ifTrue:[ |
|
5971 |
self silentDeleteChange:index. |
|
5972 |
numDeleted := numDeleted + 1. |
|
5973 |
]. |
|
5974 |
index := index - 1 |
|
2511 | 5975 |
]. |
5976 |
^ numDeleted |
|
5977 |
||
5978 |
! |
|
5979 |
||
12428 | 5980 |
silentDeleteChangesForNamespace:aNamespace from:start to:stop |
5981 |
"delete changes for a given namespace in a range. |
|
5982 |
Return the number of deleted changes." |
|
5983 |
||
5984 |
|thisNamespace index numDeleted| |
|
5985 |
||
5986 |
numDeleted := 0. |
|
5987 |
index := stop. |
|
5988 |
[index >= start] whileTrue:[ |
|
5989 |
thisNamespace := self namespaceOfChange:index. |
|
5990 |
thisNamespace = aNamespace ifTrue:[ |
|
5991 |
self silentDeleteChange:index. |
|
5992 |
numDeleted := numDeleted + 1. |
|
5993 |
]. |
|
5994 |
index := index - 1 |
|
5995 |
]. |
|
5996 |
^ numDeleted |
|
5997 |
! |
|
5998 |
||
18596 | 5999 |
silentDeleteCheckinInfosFor:aClassName from:start to:stop |
6000 |
"delete checkn infos for given class in a range. |
|
6001 |
Return the number of deleted changes." |
|
6002 |
||
6003 |
|thisClassName index numDeleted| |
|
6004 |
||
6005 |
numDeleted := 0. |
|
6006 |
index := stop. |
|
6007 |
[index >= start] whileTrue:[ |
|
6008 |
thisClassName := self realClassNameOfChange:index. |
|
6009 |
thisClassName = aClassName ifTrue:[ |
|
6010 |
(self changeIsCheckinInfo:index) ifTrue:[ |
|
6011 |
self silentDeleteChange:index. |
|
6012 |
numDeleted := numDeleted + 1. |
|
6013 |
] |
|
6014 |
]. |
|
6015 |
index := index - 1 |
|
6016 |
]. |
|
6017 |
^ numDeleted |
|
6018 |
||
6019 |
"Created: / 15-02-2019 / 12:23:17 / Claus Gittinger" |
|
6020 |
! |
|
6021 |
||
6022 |
silentDeleteClassDefinitionChangesFor:aClassName from:start to:stop |
|
6023 |
"delete class definition changes for given class in a range. |
|
6024 |
Return the number of deleted changes." |
|
6025 |
||
6026 |
|thisClassName index numDeleted| |
|
6027 |
||
6028 |
numDeleted := 0. |
|
6029 |
index := stop. |
|
6030 |
[index >= start] whileTrue:[ |
|
6031 |
thisClassName := self realClassNameOfChange:index. |
|
6032 |
thisClassName = aClassName ifTrue:[ |
|
6033 |
(self isClassDefinitionChange:index) ifTrue:[ |
|
6034 |
self silentDeleteChange:index. |
|
6035 |
numDeleted := numDeleted + 1. |
|
6036 |
] |
|
6037 |
]. |
|
6038 |
index := index - 1 |
|
6039 |
]. |
|
6040 |
^ numDeleted |
|
6041 |
||
6042 |
"Created: / 15-02-2019 / 12:12:19 / Claus Gittinger" |
|
6043 |
! |
|
6044 |
||
1070
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
6045 |
silentDeleteInternalChange:changeNr |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
6046 |
"delete a change do not update changeListView" |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
6047 |
|
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
6048 |
anyChanges := true. |
16372 | 6049 |
changeInfoList removeIndex:changeNr. |
6050 |
"/ changeChunks removeIndex:changeNr. |
|
6051 |
"/ changePositions size >= changeNr ifTrue:[changePositions removeIndex:changeNr]. |
|
6052 |
"/ changeClassNames size >= changeNr ifTrue:[changeClassNames removeIndex:changeNr]. |
|
6053 |
"/ changeSelectors size >= changeNr ifTrue:[ changeSelectors removeIndex:changeNr ]. |
|
6054 |
"/ changeTimeStamps size >= changeNr ifTrue:[changeTimeStamps removeIndex:changeNr]. |
|
6055 |
"/ changeIsFollowupMethodChange size >= changeNr ifTrue:[changeIsFollowupMethodChange removeIndex:changeNr]. |
|
6056 |
||
6057 |
"Created: / 07-03-1997 / 16:28:32 / cg" |
|
6058 |
"Modified: / 26-02-1998 / 18:20:48 / stefan" |
|
6059 |
"Modified: / 01-05-2016 / 19:20:59 / cg" |
|
4487 | 6060 |
! |
6061 |
||
18059 | 6062 |
silentDeleteMethodCategoryChangesFor:aClassName selector:selector from:start to:stop |
6063 |
"delete method category changes for given class/selector in a range. |
|
6064 |
Return the number of deleted changes." |
|
6065 |
||
6066 |
|thisClassName index numDeleted| |
|
6067 |
||
6068 |
numDeleted := 0. |
|
6069 |
index := stop. |
|
6070 |
[index >= start] whileTrue:[ |
|
6071 |
thisClassName := self realClassNameOfChange:index. |
|
6072 |
thisClassName = aClassName ifTrue:[ |
|
6073 |
(self selectorOfMethodCategoryChange:index) == selector ifTrue:[ |
|
6074 |
self silentDeleteChange:index. |
|
6075 |
numDeleted := numDeleted + 1. |
|
6076 |
] |
|
6077 |
]. |
|
6078 |
index := index - 1 |
|
6079 |
]. |
|
6080 |
^ numDeleted |
|
6081 |
! |
|
6082 |
||
6083 |
silentDeleteMethodChangesFor:aClassName selector:selector from:start to:stop |
|
6084 |
"delete method changes for given class/selector in a range. |
|
6085 |
Return the number of deleted changes." |
|
6086 |
||
6087 |
|thisClassName index numDeleted| |
|
6088 |
||
6089 |
numDeleted := 0. |
|
6090 |
index := stop. |
|
6091 |
[index >= start] whileTrue:[ |
|
6092 |
thisClassName := self realClassNameOfChange:index. |
|
6093 |
thisClassName = aClassName ifTrue:[ |
|
6094 |
(self selectorOfMethodChange:index) == selector ifTrue:[ |
|
6095 |
self silentDeleteChange:index. |
|
6096 |
numDeleted := numDeleted + 1. |
|
6097 |
] |
|
6098 |
]. |
|
6099 |
index := index - 1 |
|
6100 |
]. |
|
6101 |
^ numDeleted |
|
6102 |
! |
|
6103 |
||
4487 | 6104 |
updateDiffView |
6105 |
self withSelectedChangesDo:[:changeNr | |
|
6288 | 6106 |
self updateDiffViewFor:changeNr. |
6107 |
^ self. |
|
4487 | 6108 |
]. |
6109 |
||
6110 |
diffView text1:'' text2:'' |
|
6111 |
! |
|
6112 |
||
6113 |
updateDiffViewFor:changeNr |
|
6114 |
|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
|
6115 |
parser sel showDiff selector oldMethod i| |
4487 | 6116 |
|
6117 |
aStream := self streamForChange:changeNr. |
|
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
6118 |
aStream isNil ifTrue:[ |
6317 | 6119 |
^ self |
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
6120 |
]. |
4487 | 6121 |
|
6122 |
showDiff := false. |
|
6123 |
||
6124 |
(self changeIsFollowupMethodChange:changeNr) ifFalse:[ |
|
6317 | 6125 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
6126 |
chunk := aStream nextChunk. |
|
4487 | 6127 |
] ifTrue:[ |
16372 | 6128 |
chunk := self changeChunkAt:changeNr. |
6317 | 6129 |
sawExcla := true. |
4487 | 6130 |
]. |
6131 |
||
4857 | 6132 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
6133 |
do:[ |
|
8665 | 6134 |
parseTree := self parseExpression:chunk. |
6317 | 6135 |
(parseTree notNil and:[parseTree ~~ #Error and:[ parseTree isMessage ]]) ifTrue:[ |
6136 |
selector := parseTree selector. |
|
6137 |
] |
|
4857 | 6138 |
]. |
6139 |
||
6140 |
selector isNil ifTrue:[ |
|
6317 | 6141 |
newSource := chunk. |
6142 |
oldSource := 'Not comparable.'. |
|
4857 | 6143 |
] ifFalse:[ |
6317 | 6144 |
sawExcla ifFalse:[ |
6145 |
"/ not a method-change |
|
6146 |
newSource := chunk. |
|
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
6147 |
oldSource := self currentSourceForParseTree:parseTree. |
6317 | 6148 |
] ifTrue:[ |
6149 |
"/ a method-change |
|
6150 |
||
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6151 |
(self class methodDefinitionSelectors includes:selector) ifTrue:[ |
6317 | 6152 |
newSource := aStream nextChunk. |
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
6153 |
thisClass := self classFromEvaluatingTree:parseTree receiver. |
19288 | 6154 |
thisClass isNil ifTrue:[ |
6155 |
classNameMap notNil ifTrue:[ |
|
6156 |
(classNameMap includesKey:parseTree receiver name) ifTrue:[ |
|
6157 |
thisClass := Smalltalk classNamed:(classNameMap at:parseTree receiver name) |
|
6158 |
] |
|
6159 |
] |
|
6160 |
]. |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
6161 |
"/ Error |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
6162 |
"/ handle:[ ] |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
6163 |
"/ do:[ |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
6164 |
"/ thisClass := parseTree receiver evaluate. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
6165 |
"/ ]. |
6378 | 6166 |
thisClass isBehavior ifFalse:[ |
6167 |
thisClass := self classOfChange:changeNr. |
|
6168 |
]. |
|
6317 | 6169 |
thisClass isBehavior ifTrue:[ |
6170 |
(thisClass isLoaded |
|
6171 |
or:[ autoloadAsRequired value |
|
6172 |
and:[self checkClassIsLoaded:thisClass]]) ifFalse:[ |
|
19039 | 6173 |
oldSource := c'Cannot compare this change\n\n(compare requires class to be loaded).'. |
6317 | 6174 |
] ifTrue:[ |
19127 | 6175 |
selector argumentCount == 0 ifTrue:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6176 |
cat := '* as yet uncategorized *'. |
6532 | 6177 |
cat := selector. |
6317 | 6178 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6179 |
cat := parseTree arg1 evaluate. |
6317 | 6180 |
]. |
6181 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
|
6182 |
do:[ |
|
7709 | 6183 |
parser := Parser new. |
6639 | 6184 |
Error catch:[ |
7709 | 6185 |
parser |
6186 |
parseMethod:newSource in:thisClass |
|
6187 |
ignoreErrors:true ignoreWarnings:true. |
|
6317 | 6188 |
] |
6189 |
]. |
|
7709 | 6190 |
sel := parser selector. |
6191 |
(sel notNil) ifTrue:[ |
|
6317 | 6192 |
oldMethod := thisClass compiledMethodAt:sel. |
6193 |
oldMethod notNil ifTrue:[ |
|
6194 |
(oldMethod category = cat) ifFalse:[ |
|
6447 | 6195 |
"/ Transcript showCR:'category changed.'. |
6317 | 6196 |
]. |
6197 |
oldSource := oldMethod source. |
|
6198 |
(oldSource = newSource) ifFalse:[ |
|
6199 |
oldSource isNil ifTrue:[ |
|
6200 |
oldSource := 'No source for compare.'. |
|
6201 |
] ifFalse:[ |
|
6202 |
"/ |
|
6203 |
"/ compare for tabulator <-> space changes |
|
6204 |
"/ before showing diff ... |
|
6205 |
"/ |
|
6206 |
oldSource := oldSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
6207 |
newSource := newSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
6208 |
oldSource = newSource ifFalse:[ |
|
6209 |
"/ |
|
6210 |
"/ check if only historyLine diffs |
|
6211 |
"/ |
|
6212 |
(HistoryManager notNil |
|
6213 |
and:[HistoryManager isActive]) ifTrue:[ |
|
6214 |
oldSource := oldSource asStringCollection asString. |
|
6215 |
newSource := newSource asStringCollection asString. |
|
6216 |
(HistoryManager withoutHistoryLines:oldSource) |
|
6217 |
= |
|
6218 |
(HistoryManager withoutHistoryLines:newSource) |
|
6219 |
ifTrue:[ |
|
6220 |
oldSource := (HistoryManager withoutHistoryLines:oldSource). |
|
6221 |
newSource := (HistoryManager withoutHistoryLines:newSource). |
|
6222 |
] |
|
6223 |
]. |
|
6224 |
] |
|
6225 |
] |
|
6226 |
] |
|
6227 |
] ifFalse:[ |
|
6228 |
oldSource := 'Method does not exist.'. |
|
6229 |
] |
|
6230 |
] ifFalse:[ |
|
6231 |
oldSource := 'Change is unparsable (parse error).'. |
|
6232 |
]. |
|
6233 |
]. |
|
6234 |
] ifFalse:[ |
|
6235 |
oldSource := 'Class does not exist.'. |
|
6236 |
] |
|
6237 |
] ifFalse:[ |
|
6238 |
newSource := chunk. "/ aStream contents. |
|
6239 |
oldSource := 'Not comparable.'. |
|
6240 |
] |
|
6241 |
] |
|
4487 | 6242 |
]. |
6243 |
aStream close. |
|
6244 |
||
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
6245 |
oldSource := oldSource ? ''. |
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
6246 |
newSource := newSource ? ''. |
8675
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6247 |
|
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6248 |
oldSource := oldSource asStringCollection asString. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6249 |
newSource := newSource asStringCollection asString. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6250 |
|
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6251 |
"/ unify cr, crlf and lf into lf |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6252 |
(oldSource includes:Character return) ifTrue: [ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6253 |
i := oldSource indexOf:Character return. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6254 |
(oldSource at:i+1) == Character nl ifTrue:[ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6255 |
"/ crnl endings |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6256 |
oldSource := oldSource copyReplaceString:(String crlf) withString:(String lf). |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6257 |
] ifFalse:[ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6258 |
"/ cr endings |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6259 |
oldSource := oldSource copyReplaceAll:Character return with:Character nl. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6260 |
]. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6261 |
]. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6262 |
|
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6263 |
"/ unify cr, crlf and lf into lf |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6264 |
(newSource includes:Character return) ifTrue: [ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6265 |
i := newSource indexOf:Character return. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6266 |
(newSource at:i+1) == Character nl ifTrue:[ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6267 |
"/ crnl endings |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6268 |
newSource := newSource copyReplaceString:(String crlf) withString:(String lf). |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6269 |
] ifFalse:[ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6270 |
"/ cr endings |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6271 |
newSource := newSource copyReplaceAll:Character return with:Character nl. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6272 |
]. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6273 |
]. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6274 |
|
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
6275 |
(oldSource = newSource |
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
6276 |
or:[ oldSource asStringCollection withTabsExpanded = newSource asStringCollection withTabsExpanded]) ifTrue:[ |
6317 | 6277 |
self makeDiffViewInvisible |
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
6278 |
] ifFalse:[ |
6317 | 6279 |
self makeDiffViewVisible. |
6280 |
diffView text1:oldSource text2:newSource. |
|
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
6281 |
]. |
4487 | 6282 |
|
7709 | 6283 |
"Created: / 24-11-1995 / 14:30:46 / cg" |
16372 | 6284 |
"Modified: / 01-05-2016 / 18:26:01 / cg" |
202 | 6285 |
! ! |
0 | 6286 |
|
202 | 6287 |
!ChangesBrowser methodsFor:'termination'! |
51 | 6288 |
|
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6289 |
askIfChangesAreToBeWrittenBack |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6290 |
|action again| |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6291 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6292 |
anyChanges ifFalse:[^ self]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6293 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6294 |
again := true. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6295 |
[again] whileTrue:[ |
6357 | 6296 |
action := OptionBox |
6297 |
request:(resources stringWithCRs:'The modified changelist has not been written back to the change file.\\Write change file before closing ?') |
|
6298 |
label:'ChangesBrowser' |
|
6299 |
image:(WarningBox iconBitmap) |
|
6300 |
buttonLabels:(resources array:#('Cancel' 'Don''t Write' 'Write')) |
|
6301 |
values:#(#abort #ignore #save) |
|
6302 |
default:#save |
|
6303 |
onCancel:#abort. |
|
6304 |
||
6305 |
again := false. |
|
6306 |
action == #abort ifTrue:[AbortSignal raise. ^ self]. |
|
6307 |
action == #save ifTrue:[ |
|
6308 |
again := self writeBackChanges not |
|
6309 |
]. |
|
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6310 |
]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6311 |
! |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6312 |
|
1787 | 6313 |
closeRequest |
18159 | 6314 |
"window manager wants me to go away" |
1787 | 6315 |
|
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6316 |
self askIfChangesAreToBeWrittenBack. |
1787 | 6317 |
super closeRequest |
18159 | 6318 |
|
6319 |
"Modified (comment): / 28-05-2018 / 09:49:47 / Claus Gittinger" |
|
1787 | 6320 |
! |
6321 |
||
202 | 6322 |
saveAndTerminate |
6323 |
"update the changes file and quit. |
|
17026 | 6324 |
Don't depend on this being sent, not all window managers |
202 | 6325 |
send it; instead, they simply destroy the view." |
28 | 6326 |
|
202 | 6327 |
anyChanges ifTrue:[ |
17026 | 6328 |
self writeBackChanges. |
0 | 6329 |
]. |
1787 | 6330 |
super saveAndTerminate |
6331 |
||
6332 |
"Modified: / 3.8.1998 / 19:54:00 / cg" |
|
0 | 6333 |
! ! |
6334 |
||
73 | 6335 |
!ChangesBrowser methodsFor:'user interaction'! |
51 | 6336 |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6337 |
askForSearch:msg initialAnswer:initial thenSearchUsing:searchBlock2 onCancel:cancelBlock |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6338 |
|searchString directionHolder searchBlock| |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6339 |
|
6288 | 6340 |
searchString := self |
15674 | 6341 |
askForSearchString:msg |
6342 |
initialAnswer:initial |
|
6343 |
directionInto:(directionHolder := ValueHolder new). |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6344 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6345 |
searchString isNil ifTrue:[ |
15674 | 6346 |
^ cancelBlock value |
6347 |
]. |
|
17382 | 6348 |
lastSearchString := searchString. |
6349 |
||
15674 | 6350 |
directionHolder value == #first ifTrue:[ |
6351 |
self findFirstForClass:searchString. |
|
6352 |
^ self. |
|
6353 |
]. |
|
6354 |
directionHolder value == #last ifTrue:[ |
|
6355 |
self findLastForClass:searchString. |
|
6356 |
^ self. |
|
6357 |
]. |
|
6358 |
||
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6359 |
searchBlock := [:changeNr | searchBlock2 value:searchString value:changeNr]. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6360 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6361 |
directionHolder value == #backward ifTrue:[ |
15674 | 6362 |
changeNrShown isNil ifTrue:[ |
6363 |
changeNrShown := self numberOfChanges. |
|
6364 |
]. |
|
6365 |
self findPreviousForWhich:searchBlock |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6366 |
] ifFalse:[ |
15674 | 6367 |
changeNrShown isNil ifTrue:[ |
6368 |
changeNrShown := 0. |
|
6369 |
]. |
|
6370 |
self findNextForWhich:searchBlock |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6371 |
]. |
17382 | 6372 |
|
6373 |
"Modified: / 10-02-2017 / 20:40:59 / cg" |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6374 |
! |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6375 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6376 |
askForSearchString:msg initialAnswer:initial directionInto:aValueHolder |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6377 |
"common code to open a search box" |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6378 |
|
17394 | 6379 |
|searchString direction choices current| |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6380 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6381 |
direction := #forward. |
17394 | 6382 |
choices := OrderedCollection new. |
6383 |
||
6384 |
changeNrShown notNil ifTrue:[ |
|
6385 |
current := self classNameOfChange:changeNrShown. |
|
6386 |
initial ~= current ifTrue:[ |
|
6387 |
(choices includes:current) ifFalse:[ |
|
6388 |
choices addFirst:current |
|
6389 |
]. |
|
6390 |
]. |
|
6391 |
]. |
|
6392 |
lastSearchString notNil ifTrue:[ |
|
6393 |
initial ~= lastSearchString ifTrue:[ |
|
6394 |
(choices includes:lastSearchString) ifFalse:[ |
|
6395 |
choices addFirst:lastSearchString |
|
6396 |
]. |
|
6397 |
]. |
|
6398 |
]. |
|
6399 |
||
15449 | 6400 |
"/ take a normal request box, but add an additional 'previous' button |
6401 |
Dialog modifyingBoxWith:[:box | |
|
15674 | 6402 |
|nextButton prevButton firstButton lastButton| |
15449 | 6403 |
|
13343 | 6404 |
nextButton := box okButton. |
15674 | 6405 |
|
6406 |
firstButton := Button label:(resources string:'First'). |
|
6407 |
firstButton action:[direction := #first. box okPressed.]. |
|
6408 |
box addButton:firstButton after:nextButton. |
|
6409 |
||
6410 |
lastButton := Button label:(resources string:'Last'). |
|
6411 |
lastButton action:[direction := #last. box okPressed.]. |
|
6412 |
box addButton:lastButton after:nextButton. |
|
6413 |
||
13343 | 6414 |
prevButton := Button label:(resources string:'Previous'). |
6415 |
prevButton action:[direction := #backward. box okPressed.]. |
|
6416 |
box addButton:prevButton after:nextButton. |
|
15674 | 6417 |
|
13343 | 6418 |
nextButton label:(resources string:'Next'). |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6419 |
] do:[ |
13343 | 6420 |
searchString := Dialog |
6421 |
request:msg |
|
17394 | 6422 |
list:choices |
13343 | 6423 |
initialAnswer:initial |
17394 | 6424 |
]. |
6425 |
||
6426 |
searchString isEmptyOrNil ifTrue:[ |
|
13343 | 6427 |
^ nil |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6428 |
]. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6429 |
aValueHolder value:direction. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6430 |
^ searchString |
15449 | 6431 |
|
6432 |
" |
|
6433 |
self new askForSearchString:'foo' initialAnswer:'bla' directionInto:(false asValue) |
|
6434 |
" |
|
17394 | 6435 |
|
6436 |
"Modified: / 12-02-2017 / 11:18:11 / cg" |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6437 |
! |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6438 |
|
221 | 6439 |
autoUpdate:aBoolean |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
6440 |
"enabled/disable automatic update from the change-file (for monitoring)" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
6441 |
|
6216 | 6442 |
autoUpdate value:aBoolean |
221 | 6443 |
|
6444 |
"Created: 3.12.1995 / 14:14:24 / cg" |
|
6445 |
"Modified: 3.12.1995 / 14:20:45 / cg" |
|
6446 |
! |
|
6447 |
||
6216 | 6448 |
autoloadAsRequired:aBoolean |
6449 |
"enabled/disable automatic load of unloaded classes" |
|
6450 |
||
6451 |
autoloadAsRequired value:aBoolean |
|
6452 |
! |
|
6453 |
||
3211 | 6454 |
changeSelection:lineNrCollection |
0 | 6455 |
"show a change in the codeView" |
6456 |
||
11048 | 6457 |
|chunk lineNr lineNumbers| |
3211 | 6458 |
|
6459 |
lineNrCollection isInteger ifTrue:[ |
|
11048 | 6460 |
lineNr := lineNrCollection. |
6461 |
lineNumbers := Array with:lineNr. |
|
3211 | 6462 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6463 |
changeListView multipleSelectOk ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6464 |
lineNrCollection size == 1 ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6465 |
lineNr := lineNrCollection first. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6466 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6467 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6468 |
lineNr := lineNrCollection |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6469 |
]. |
11048 | 6470 |
lineNumbers := lineNrCollection. |
6471 |
]. |
|
6472 |
||
6473 |
self changeListSelectionHolder value:lineNumbers. |
|
16467 | 6474 |
|
2293 | 6475 |
lineNr isNil ifTrue:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6476 |
codeView contents:nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6477 |
codeView initializeDoITAction. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6478 |
changeNrShown := nil. |
16467 | 6479 |
infoHolder value:nil. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6480 |
^ self |
2293 | 6481 |
]. |
6482 |
||
16467 | 6483 |
changeNrShown := lineNr. |
6484 |
self sensor |
|
6485 |
enqueueMessage:#updateSourceCodeAfterChangedSelection for:self arguments:nil; |
|
6486 |
enqueueMessage:#updateInfoAfterChangedSelection for:self arguments:nil. |
|
6487 |
^ self. |
|
6488 |
||
3211 | 6489 |
"/ display the changes code |
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
6490 |
chunk := self sourceOfChange:lineNr. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
6491 |
chunk isNil ifTrue:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6492 |
codeView initializeDoITAction. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6493 |
^ self |
2044 | 6494 |
]. |
8391 | 6495 |
|
0 | 6496 |
codeView contents:chunk. |
13 | 6497 |
codeView acceptAction:[:theCode | self doApply "noChangesAllowed"]. |
2043
66b5276b2760
set self in changesBrowsers doIt.
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
6498 |
codeView doItAction:[:theCode | |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6499 |
|clsName cls| |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6500 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6501 |
clsName := self classNameOfChange:lineNr. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6502 |
clsName notNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6503 |
clsName := clsName asSymbolIfInterned. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6504 |
clsName notNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6505 |
cls := Smalltalk at:clsName ifAbsent:nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6506 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6507 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6508 |
Compiler |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6509 |
evaluate:theCode |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6510 |
in:nil |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6511 |
receiver:cls |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6512 |
notifying:self |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6513 |
logged:true |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6514 |
ifFail:nil |
2043
66b5276b2760
set self in changesBrowsers doIt.
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
6515 |
]. |
15 | 6516 |
changeNrShown := lineNr. |
0 | 6517 |
|
4487 | 6518 |
self showingDiffs value ifTrue:[ |
8391 | 6519 |
self withWaitCursorDo:[ |
6520 |
AbortOperationRequest catch:[ |
|
6521 |
self updateDiffViewFor:changeNrShown. |
|
6522 |
] |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6523 |
] |
4487 | 6524 |
]. |
6525 |
||
11048 | 6526 |
"Modified: / 03-01-2012 / 15:30:23 / cg" |
51 | 6527 |
! |
6528 |
||
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6529 |
classOfChange:changeNr |
3806
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
6530 |
^ self |
6386 | 6531 |
classOfChange:changeNr |
6532 |
ifAbsent:[:className | |
|
6533 |
|msg| |
|
6534 |
||
6535 |
className isNil ifTrue:[ |
|
6536 |
msg := 'Could not extract classname from change'. |
|
6537 |
] ifFalse:[ |
|
6538 |
msg := 'Class not found: ''' , className , ''''. |
|
6539 |
]. |
|
8320
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6540 |
Transcript showCR:msg. |
6386 | 6541 |
"/ self warn:msg. |
6542 |
nil |
|
6543 |
] |
|
3806
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
6544 |
! |
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
6545 |
|
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
6546 |
classOfChange:changeNr ifAbsent:exceptionBlock |
18059 | 6547 |
"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
|
6548 |
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
|
6549 |
|
8272
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
6550 |
|className cls isMeta nameSpaceForApply path ownerName owner| |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6551 |
|
5014 | 6552 |
className := self realClassNameOfChange:changeNr. |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6553 |
className isNil ifTrue:[ |
18059 | 6554 |
^ exceptionBlock valueWithOptionalArgument:nil |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6555 |
]. |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6556 |
|
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6557 |
isMeta := false. |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6558 |
(className endsWith:' class') ifTrue:[ |
12704
6f20f7d39e75
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12656
diff
changeset
|
6559 |
className := className copyButLast:6. |
6378 | 6560 |
isMeta := true. |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6561 |
]. |
3472 | 6562 |
|
8272
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
6563 |
autoloadAsRequired value ifTrue:[ |
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
6564 |
path := className asCollectionOfSubstringsSeparatedByAll:'::'. |
8320
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6565 |
path size >= 2 ifTrue:[ |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6566 |
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
|
6567 |
"/ 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
|
6568 |
"/ Transcript showCR:'loading owner'. |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6569 |
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
|
6570 |
owner := Smalltalk classNamed:ownerName. |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6571 |
owner notNil ifTrue:[ |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6572 |
owner autoload. |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6573 |
]. |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6574 |
]. |
8272
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
6575 |
]. |
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
6576 |
]. |
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
6577 |
|
7620
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6578 |
nameSpaceForApply := self nameSpaceForApply. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6579 |
autoloadAsRequired value ifTrue:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6580 |
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
|
6581 |
] ifFalse:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6582 |
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
|
6583 |
]. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6584 |
(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
|
6585 |
"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
|
6586 |
autoloadAsRequired value ifTrue:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6587 |
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
|
6588 |
] ifFalse:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6589 |
cls := Smalltalk loadedClassNamed:className |
6378 | 6590 |
]. |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6591 |
]. |
7620
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6592 |
|
6378 | 6593 |
cls isNil ifTrue:[ |
18059 | 6594 |
^ exceptionBlock valueWithOptionalArgument:className |
6378 | 6595 |
]. |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6596 |
isMeta ifTrue:[ |
6378 | 6597 |
cls := cls class |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6598 |
]. |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6599 |
^ cls |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6600 |
! |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6601 |
|
1471 | 6602 |
doubleClickOnChange:lineNr |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
6603 |
"action performed when a change-list entry is doubleClicked" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
6604 |
|
1471 | 6605 |
self doBrowse |
6606 |
||
6607 |
"Created: / 6.2.1998 / 13:08:49 / cg" |
|
6608 |
! |
|
6609 |
||
202 | 6610 |
noChangesAllowed |
6611 |
"show a warning that changes cannot be changed" |
|
93 | 6612 |
|
3211 | 6613 |
self warn:'Changes are not allowed to be changed.' |
0 | 6614 |
! |
6615 |
||
202 | 6616 |
saveClass:aClassName from:startNr |
6617 |
"user wants changes from current to end to be appended to a file" |
|
51 | 6618 |
|
202 | 6619 |
|changeNr fileName| |
51 | 6620 |
|
202 | 6621 |
changeNr := changeListView selection. |
6622 |
changeNr notNil ifTrue:[ |
|
9604 | 6623 |
fileName := Dialog |
6624 |
requestFileNameForSave:(resources string:'Append changes for class to:') |
|
6625 |
default:(lastSaveFileName ? '') |
|
6626 |
ok:(resources string:'Append') |
|
6627 |
abort:(resources string:'Abort') |
|
6628 |
pattern:'*.chg'. |
|
6629 |
||
6630 |
fileName notNil ifTrue:[ |
|
6631 |
lastSaveFileName := fileName. |
|
11685 | 6632 |
self withWriteCursorDo:[ |
9604 | 6633 |
startNr to:(self numberOfChanges) do:[:changeNr | |
6634 |
|thisClassName| |
|
6635 |
||
6636 |
thisClassName := self classNameOfChange:changeNr. |
|
6637 |
thisClassName = aClassName ifTrue:[ |
|
6638 |
self setSingleSelection:changeNr. |
|
6639 |
(self appendChange:changeNr toFile:fileName) ifFalse:[ |
|
6640 |
^ self |
|
6641 |
] |
|
6642 |
] |
|
6643 |
] |
|
6644 |
] |
|
6645 |
]. |
|
202 | 6646 |
] |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
6647 |
|
11685 | 6648 |
"Modified: / 27-07-2012 / 09:46:04 / cg" |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
6649 |
! |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
6650 |
|
11477 | 6651 |
selectionChanged |
12946 | 6652 |
self halt:'should not be here' |
11048 | 6653 |
|
6654 |
"Created: / 03-01-2012 / 15:26:36 / cg" |
|
16467 | 6655 |
! |
6656 |
||
6657 |
updateInfoAfterChangedSelection |
|
6658 |
"update the info label" |
|
6659 |
||
17172 | 6660 |
|selection lineNr selectorOrNil className nonMetaClassName metaClassName |
16476 | 6661 |
nClassChanges nMethodChanges uniqueSelectors |
17172 | 6662 |
lastLineNr firstLineNr |
6663 |
countForClassBeforeCurrent countForClassAfterLast countForClassAndSelectorAfterLast |
|
18186 | 6664 |
moreInfo countInfo selectorInfo| |
16467 | 6665 |
|
6666 |
selection := lineNr := changeListView selection. |
|
6667 |
selection isNumber ifFalse:[ |
|
6668 |
lineNr := nil. |
|
6669 |
selection notEmptyOrNil ifTrue:[ |
|
6670 |
lineNr := selection first |
|
6671 |
]. |
|
6672 |
]. |
|
6673 |
||
6674 |
lineNr isNil ifTrue:[ |
|
6675 |
infoHolder value:nil. |
|
6676 |
^ self |
|
6677 |
]. |
|
6678 |
||
6679 |
"/ |
|
6680 |
"/ now, this info is computed so fast, |
|
6681 |
"/ we can do it each time the selection changes |
|
6682 |
"/ (can we?) |
|
6683 |
className := self realClassNameOfChange:lineNr. |
|
16478 | 6684 |
className isNil ifTrue:[ |
6685 |
infoHolder value:nil. |
|
6686 |
^ self |
|
6687 |
]. |
|
17172 | 6688 |
selectorOrNil := self selectorOfMethodChange:lineNr. |
16478 | 6689 |
|
16476 | 6690 |
nonMetaClassName := (className endsWith:' class') |
6691 |
ifTrue:[ className copyButLast:' class' size ] |
|
6692 |
ifFalse:[ className ]. |
|
6693 |
metaClassName := nonMetaClassName,' class'. |
|
6694 |
||
16467 | 6695 |
nClassChanges := nMethodChanges := 0. |
6696 |
uniqueSelectors := Set new. |
|
16476 | 6697 |
lastLineNr := firstLineNr := nil. |
17172 | 6698 |
countForClassAfterLast := 0. |
6699 |
countForClassBeforeCurrent := 0. |
|
6700 |
countForClassAndSelectorAfterLast := 0. |
|
16467 | 6701 |
|
6702 |
"/ count them all |
|
6703 |
1 to:changeInfoList size do:[:i | |
|
16476 | 6704 |
|sel nameOfChange| |
17420 | 6705 |
|
6706 |
changeInfoList at:i. |
|
16476 | 6707 |
nameOfChange := self realClassNameOfChange:i. |
6708 |
((nameOfChange = nonMetaClassName) or:[nameOfChange = metaClassName]) ifTrue:[ |
|
17172 | 6709 |
sel := self selectorOfMethodChange:i. |
6710 |
||
16467 | 6711 |
lastLineNr := i. |
16476 | 6712 |
firstLineNr := firstLineNr ? i. |
17172 | 6713 |
i > lineNr ifTrue:[ |
6714 |
countForClassAfterLast := countForClassAfterLast + 1. |
|
6715 |
(nameOfChange = className |
|
6716 |
and:[ selectorOrNil notNil |
|
6717 |
and:[sel == selectorOrNil]]) ifTrue:[ |
|
6718 |
countForClassAndSelectorAfterLast := countForClassAndSelectorAfterLast + 1. |
|
16476 | 6719 |
]. |
17172 | 6720 |
] ifFalse:[ |
6721 |
i < lineNr ifTrue:[ |
|
6722 |
countForClassBeforeCurrent := countForClassBeforeCurrent + 1 |
|
6723 |
] |
|
6724 |
]. |
|
16467 | 6725 |
nClassChanges := nClassChanges + 1. |
17172 | 6726 |
sel notNil ifTrue:[ |
16467 | 6727 |
uniqueSelectors add:sel. |
6728 |
nMethodChanges := nMethodChanges + 1. |
|
6729 |
]. |
|
6730 |
]. |
|
6731 |
]. |
|
6732 |
lastLineNr == lineNr ifTrue:[ |
|
16476 | 6733 |
firstLineNr == lineNr ifTrue:[ |
6734 |
moreInfo := resources string:'. This is the only one for this class '. |
|
6735 |
] ifFalse:[ |
|
6736 |
moreInfo := resources string:'. This is the last for this class '. |
|
6737 |
] |
|
16467 | 6738 |
] ifFalse:[ |
16476 | 6739 |
firstLineNr == lineNr ifTrue:[ |
6740 |
moreInfo := resources string:'. This is the first for this class'. |
|
6741 |
]. |
|
17172 | 6742 |
countForClassAfterLast > 0 ifTrue:[ |
6743 |
moreInfo := (moreInfo ? ''),(resources string:'. %1 more for this class' with:countForClassAfterLast). |
|
6744 |
countForClassAndSelectorAfterLast > 0 ifTrue:[ |
|
17419 | 6745 |
moreInfo := moreInfo,(resources string:', %1 for selector' with:countForClassAndSelectorAfterLast). |
17172 | 6746 |
]. |
16467 | 6747 |
]. |
6748 |
]. |
|
18186 | 6749 |
|
6750 |
countInfo := resources string:'%1 changes. %2 for %3 ' |
|
6751 |
with:(changeInfoList size) |
|
6752 |
with:nClassChanges |
|
6753 |
with:className. |
|
6754 |
||
17381 | 6755 |
uniqueSelectors size == 1 ifTrue:[ |
6756 |
nMethodChanges == 1 ifTrue:[ |
|
18186 | 6757 |
selectorInfo := (resources string:'(1 for #''%1'')' |
6758 |
with:uniqueSelectors first) allBold |
|
17381 | 6759 |
] ifFalse:[ |
18186 | 6760 |
selectorInfo := (resources string:'(%1 methods / for #''%2'')' |
6761 |
with:nMethodChanges |
|
6762 |
with:uniqueSelectors first) allBold |
|
6763 |
]. |
|
18110 | 6764 |
] ifFalse:[ |
18186 | 6765 |
(nMethodChanges == 0 and:[uniqueSelectors isEmptyOrNil]) ifTrue:[ |
6766 |
selectorInfo := resources string:'(0 methods)' |
|
6767 |
] ifFalse:[ |
|
6768 |
selectorInfo := (resources string:'(%1 methods / %5 selectors)' |
|
6769 |
with:nMethodChanges |
|
6770 |
with:uniqueSelectors size) allBold |
|
6771 |
]. |
|
6772 |
]. |
|
6773 |
infoHolder value:(countInfo,selectorInfo,moreInfo). |
|
17381 | 6774 |
|
17420 | 6775 |
"Modified: / 19-02-2017 / 13:37:19 / cg" |
18186 | 6776 |
"Modified: / 08-06-2018 / 12:09:44 / Claus Gittinger" |
16467 | 6777 |
! |
6778 |
||
6779 |
updateSourceCodeAfterChangedSelection |
|
6780 |
"show a change in the codeView" |
|
6781 |
||
6782 |
|selection lineNr chunk| |
|
6783 |
||
6784 |
selection := lineNr := changeListView selection. |
|
6785 |
selection isNumber ifFalse:[ |
|
6786 |
lineNr := nil. |
|
6787 |
selection notEmptyOrNil ifTrue:[ |
|
6788 |
lineNr := selection first |
|
6789 |
]. |
|
6790 |
]. |
|
6791 |
||
6792 |
lineNr isNil ifTrue:[ |
|
6793 |
^ self |
|
6794 |
]. |
|
6795 |
||
6796 |
"/ display the changes code |
|
6797 |
chunk := self sourceOfChange:lineNr. |
|
6798 |
chunk isNil ifTrue:[ |
|
6799 |
codeView initializeDoITAction. |
|
6800 |
^ self |
|
6801 |
]. |
|
6802 |
||
6803 |
codeView contents:chunk. |
|
6804 |
codeView acceptAction:[:theCode | self doApply "noChangesAllowed"]. |
|
6805 |
codeView doItAction:[:theCode | |
|
6806 |
|clsName cls| |
|
6807 |
||
6808 |
clsName := self classNameOfChange:lineNr. |
|
6809 |
clsName notNil ifTrue:[ |
|
6810 |
clsName := clsName asSymbolIfInterned. |
|
6811 |
clsName notNil ifTrue:[ |
|
6812 |
cls := Smalltalk at:clsName ifAbsent:nil. |
|
6813 |
] |
|
6814 |
]. |
|
6815 |
Compiler |
|
6816 |
evaluate:theCode |
|
6817 |
in:nil |
|
6818 |
receiver:cls |
|
6819 |
notifying:self |
|
6820 |
logged:true |
|
6821 |
ifFail:nil |
|
6822 |
]. |
|
6823 |
||
6824 |
||
6825 |
changeNrShown := lineNr. |
|
6826 |
||
6827 |
self showingDiffs value ifTrue:[ |
|
6828 |
self withWaitCursorDo:[ |
|
6829 |
AbortOperationRequest catch:[ |
|
6830 |
self updateDiffViewFor:changeNrShown. |
|
6831 |
] |
|
6832 |
] |
|
6833 |
]. |
|
202 | 6834 |
! ! |
0 | 6835 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6836 |
!ChangesBrowser::ChangeFileReader methodsFor:'accessing'! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6837 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6838 |
autoCompare:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6839 |
autoCompare := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6840 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6841 |
|
7620
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6842 |
autoloadAsRequired |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6843 |
^ autoloadAsRequired |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6844 |
! |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6845 |
|
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6846 |
autoloadAsRequired:something |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6847 |
autoloadAsRequired := something. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6848 |
! |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6849 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6850 |
browser:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6851 |
browser := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6852 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6853 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6854 |
changeChunks |
18054 | 6855 |
self breakPoint:#cg. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6856 |
^ changeChunks |
16372 | 6857 |
|
6858 |
"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
|
6859 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6860 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6861 |
changeClassNames |
18054 | 6862 |
self breakPoint:#cg. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6863 |
^ changeClassNames |
16372 | 6864 |
|
6865 |
"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
|
6866 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6867 |
|
6516
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6868 |
changeFileName |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6869 |
^ changeFileName |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6870 |
! |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6871 |
|
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6872 |
changeFileName:something |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6873 |
changeFileName := something. |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6874 |
! |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6875 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6876 |
changeHeaderLines |
18054 | 6877 |
self breakPoint:#cg. |
16372 | 6878 |
^ changeHeaderLines |
6879 |
||
6880 |
"Modified: / 01-05-2016 / 19:10:41 / cg" |
|
6881 |
! |
|
6882 |
||
6883 |
changeInfo |
|
6884 |
^ changeInfo |
|
6885 |
||
6886 |
"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
|
6887 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6888 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6889 |
changeIsFollowupMethodChange |
18054 | 6890 |
self breakPoint:#cg. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6891 |
^ changeIsFollowupMethodChange |
16372 | 6892 |
|
6893 |
"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
|
6894 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6895 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6896 |
changePositions |
18054 | 6897 |
self breakPoint:#cg. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6898 |
^ changePositions |
16372 | 6899 |
|
6900 |
"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
|
6901 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6902 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6903 |
changeTimeStamps |
18054 | 6904 |
self breakPoint:#cg. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6905 |
^ changeTimeStamps |
16372 | 6906 |
|
6907 |
"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
|
6908 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6909 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6910 |
enforcedNameSpace:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6911 |
enforcedNameSpace := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6912 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6913 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6914 |
inStream:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6915 |
inStream := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6916 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6917 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6918 |
noColoring:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6919 |
noColoring := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6920 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6921 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6922 |
tabSpec:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6923 |
tabSpec := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6924 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6925 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6926 |
thisIsAClassSource |
7360 | 6927 |
^ thisIsAClassSource ? false |
6928 |
||
6929 |
"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
|
6930 |
! ! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6931 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6932 |
!ChangesBrowser::ChangeFileReader methodsFor:'private'! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6933 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6934 |
contractClass:className selector:selector to:maxLen |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6935 |
"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
|
6936 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6937 |
|s l| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6938 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6939 |
s := className , ' ', selector. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6940 |
s size > maxLen ifTrue:[ |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6941 |
l := maxLen - 1 - selector size max:20. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6942 |
s := (className contractTo:l) , ' ' , selector. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6943 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6944 |
s size > maxLen ifTrue:[ |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6945 |
l := maxLen - 1 - className size max:20. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6946 |
s := className , ' ', (selector contractTo:l). |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6947 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6948 |
s size > maxLen ifTrue:[ |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6949 |
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
|
6950 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6951 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6952 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6953 |
^ s |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6954 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6955 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6956 |
extractClassAndClassNameFromParseTree:rec |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6957 |
|isUnaryMessage className changeClass| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6958 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6959 |
isUnaryMessage := rec isUnaryMessage. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6960 |
|
9019 | 6961 |
Error |
6962 |
handle:[:ex | ^ '?' -> nil] |
|
6843 | 6963 |
do:[ |
9019 | 6964 |
isUnaryMessage ifTrue:[ |
6965 |
className := rec receiver name. |
|
6966 |
] ifFalse:[ |
|
6967 |
className := rec name. |
|
6968 |
]. |
|
6843 | 6969 |
]. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6970 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6971 |
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
|
6972 |
autoloadAsRequired value ifTrue:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6973 |
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
|
6974 |
] ifFalse:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6975 |
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
|
6976 |
]. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6977 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6978 |
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
|
6979 |
autoloadAsRequired value ifTrue:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6980 |
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
|
6981 |
] ifFalse:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6982 |
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
|
6983 |
]. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6984 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6985 |
isUnaryMessage ifTrue:[ |
6843 | 6986 |
changeClass notNil ifTrue:[ |
6987 |
changeClass := changeClass class. |
|
6988 |
]. |
|
6989 |
className := className , ' class'. |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6990 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6991 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6992 |
^ className -> changeClass |
6843 | 6993 |
|
6994 |
"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
|
6995 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6996 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6997 |
nameSpaceForApply |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6998 |
^ browser nameSpaceForApply |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6999 |
! ! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7000 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7001 |
!ChangesBrowser::ChangeFileReader methodsFor:'reading'! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7002 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7003 |
addHeaderLineForChangeType:changeType changeString:changeString changeDelta:changeDelta timeStampInfo:timeStampInfo |
16372 | 7004 |
changeHeaderLines add:(self headerLineForChangeType:changeType changeString:changeString changeDelta:changeDelta timeStampInfo:timeStampInfo) |
7005 |
||
7006 |
"Modified: / 01-05-2016 / 19:07:49 / cg" |
|
7007 |
! |
|
7008 |
||
18059 | 7009 |
colorizeAsCommentChange:changeType |
7010 |
|c| |
|
7011 |
||
7012 |
NoColoring ~~ true ifTrue:[ |
|
7013 |
c := changeType allItalic. |
|
7014 |
"/ changeString := changeString allItalic. |
|
7015 |
c emphasisAllAdd:(#color -> UserPreferences current commentColor). |
|
7016 |
^ c |
|
7017 |
]. |
|
7018 |
^ changeType |
|
7019 |
! |
|
7020 |
||
16372 | 7021 |
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
|
7022 |
|entry| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7023 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7024 |
entry := MultiColListEntry new. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7025 |
entry tabulatorSpecification:tabSpec. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7026 |
entry colAt:1 put:changeDelta. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7027 |
entry colAt:2 put:changeString. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7028 |
entry colAt:3 put:changeType. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7029 |
timeStampInfo notNil ifTrue:[ |
12599
827681c8f7d4
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
7030 |
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
|
7031 |
]. |
16372 | 7032 |
^ entry |
7033 |
||
7034 |
"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
|
7035 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7036 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7037 |
processChunk |
16372 | 7038 |
|info| |
7039 |
||
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7040 |
(chunkText startsWith:'''---- timestamp ') ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7041 |
timeStampInfo := (chunkText copyFrom:16 to:(chunkText size - 6)) withoutSpaces. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7042 |
^ self. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7043 |
]. |
11234 | 7044 |
(chunkText asLowercase startsWith:'''---- encoding: ') ifTrue:[ |
7045 |
^ self. |
|
7046 |
]. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7047 |
|
16372 | 7048 |
changeInfo add:(info := |
7049 |
ChangesBrowser::ChangeInfo new |
|
7050 |
position:chunkPosition chunk:chunkText className:nil selector:nil headerLine:nil |
|
7051 |
timestamp:timeStampInfo isFollowupChange:false). |
|
6530
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 := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7054 |
changeDelta := ' '. |
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 |
sawExcla ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7057 |
self processNonMethodChunk |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7058 |
] ifTrue:[ |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
7059 |
self processMethodChunkIfNone: |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
7060 |
[ |
16372 | 7061 |
changeInfo removeLast. |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
7062 |
] |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7063 |
]. |
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 notNil ifTrue:[ |
16372 | 7066 |
"/ self addHeaderLineForChangeType:changeType changeString:changeString changeDelta:changeDelta timeStampInfo:timeStampInfo. |
7067 |
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
|
7068 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7069 |
headerLine notNil ifTrue:[ |
17723 | 7070 |
changeHeaderLines add:headerLine. |
16372 | 7071 |
info headerLine:headerLine. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7072 |
] |
16372 | 7073 |
]. |
7074 |
||
7075 |
"Modified: / 01-05-2016 / 19:13:59 / cg" |
|
17723 | 7076 |
"Modified: / 27-10-2017 / 14:34:51 / stefan" |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7077 |
! |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7078 |
|
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
7079 |
processMethodChunkIfNone:emptyBlock |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7080 |
"sawExcla" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7081 |
|
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
7082 |
|askedForEditingClassSource changeClass category anyMethod |
15012 | 7083 |
sel p rec clsName done first text methodPos |
16372 | 7084 |
singleJunkOnly methodChunks classCategoryChunks methodCategoryChunks singleInfo methodSelector nameAndClass |
7085 |
info| |
|
6530
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 |
singleJunkOnly := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7088 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7089 |
classCategoryChunks := methodCategoryChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7090 |
singleInfo := false. |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
7091 |
anyMethod := false. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7092 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7093 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7094 |
method definitions actually consist of |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7095 |
two (or more) chunks; skip next chunk(s) |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7096 |
up to an empty one. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7097 |
The system only writes one chunk, |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7098 |
and we cannot handle more in this ChangesBrowser .... |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7099 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7100 |
clsName := nil. |
8665 | 7101 |
|
19263 | 7102 |
(chunkText includesString:'§') ifTrue:[ |
18054 | 7103 |
self halt:'should no longer happen' |
7104 |
]. |
|
17094 | 7105 |
|
8665 | 7106 |
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
|
7107 |
(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
|
7108 |
rec := p receiver. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7109 |
sel := p selector. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7110 |
(ChangesBrowser methodDefinitionSelectors includes:sel) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7111 |
methodChunks := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7112 |
nameAndClass := self extractClassAndClassNameFromParseTree:rec. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7113 |
clsName := nameAndClass key. changeClass := nameAndClass value. |
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 |
sel == #categoriesForClass ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7116 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7117 |
classCategoryChunks := true. |
18059 | 7118 |
changeType := self colorizeAsCommentChange:'(class category change)'. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7119 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7120 |
sel == #categoriesFor: ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7121 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7122 |
methodCategoryChunks := true. |
18059 | 7123 |
changeType := self colorizeAsCommentChange:'(category change)'. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7124 |
methodSelector := (p args at:1) evaluate. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7125 |
] ifFalse:[ |
19127 | 7126 |
(sel argumentCount == 0) ifTrue:[ |
6532 | 7127 |
category := '* As yet uncategorized *'. |
7128 |
category := sel. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7129 |
] ifFalse:[ |
6532 | 7130 |
category := (p args at:1) evaluate. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7131 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7132 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7133 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7134 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7135 |
sel == #'methodsFor:stamp:' ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7136 |
"/ Squeak timeStamp |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7137 |
timeStampInfo := (p args at:2) evaluate. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7138 |
singleInfo := true |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7139 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7140 |
sel == #'commentStamp:prior:' ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7141 |
singleJunkOnly := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7142 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7143 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7144 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7145 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7146 |
sel == #reorganize ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7147 |
singleJunkOnly := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7148 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7149 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7150 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7151 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7152 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7153 |
done := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7154 |
first := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7155 |
[done] whileFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7156 |
changeDelta := ' '. |
13314 | 7157 |
methodPos := inStream position + 1. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7158 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7159 |
text := inStream nextChunk. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7160 |
done := text isEmptyOrNil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7161 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7162 |
done ifFalse:[ |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
7163 |
anyMethod := true. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7164 |
first ifFalse:[ |
16372 | 7165 |
info := ChangesBrowser::ChangeInfo new |
7166 |
position:methodPos chunk:chunkText className:clsName |
|
7167 |
selector:nil headerLine:nil timestamp:timeStampInfo isFollowupChange:true. |
|
7168 |
changeInfo add:info. |
|
7169 |
||
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7170 |
askedForEditingClassSource ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7171 |
thisIsAClassSource := (changeFileName asFilename hasSuffix:'st'). |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7172 |
askedForEditingClassSource := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7173 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7174 |
] ifTrue:[ |
16372 | 7175 |
changeInfo last className:clsName |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7176 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7177 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7178 |
first := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7179 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7180 |
(classCategoryChunks or:[methodCategoryChunks]) ifTrue:[ |
6639 | 7181 |
text := text firstLine. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7182 |
classCategoryChunks ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7183 |
changeClass isNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7184 |
changeDelta := '?'. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7185 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7186 |
changeClass category = text ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7187 |
changeDelta := '='. |
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 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7190 |
changeString := clsName , ' category: ' , text storeString. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7191 |
]ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7192 |
changeString := '(' , clsName , ' compiledMethodAt:' , methodSelector storeString , ') category: ' , text storeString. |
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 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7195 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7196 |
try to find the selector |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7197 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7198 |
methodSelector := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7199 |
clsName notNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7200 |
methodChunks ifTrue:[ |
17094 | 7201 |
p := Parser for:(ReadStream on:text) in:nil. |
7202 |
p ignoreErrors:true. |
|
7203 |
p ignoreWarnings:true. |
|
7204 |
p parserFlags allowDollarInIdentifier:true. |
|
7205 |
p parserFlags allowParagraphInIdentifier:true. |
|
7206 |
p parseMethodSpec. |
|
7207 |
methodSelector := p selector. |
|
7208 |
"/ p := Parser |
|
7209 |
"/ parseMethodSpecification:text |
|
7210 |
"/ in:nil |
|
7211 |
"/ ignoreErrors:true |
|
7212 |
"/ ignoreWarnings:true. |
|
7213 |
"/ (p notNil and:[p ~~ #Error]) ifTrue:[ |
|
7214 |
"/ methodSelector := p selector. |
|
7215 |
"/ ] |
|
6530
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 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7218 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7219 |
methodSelector isNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7220 |
changeString := (chunkText contractTo:maxLen). |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7221 |
changeType := '(change)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7222 |
headerLine := chunkText , ' (change)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7223 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7224 |
changeString := self contractClass:clsName selector:methodSelector to:maxLen. |
18059 | 7225 |
changeType := ('{ ' , category , ' }'). |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7226 |
headerLine := clsName , ' ' , methodSelector , ' ' , '(change category: ''' , category , ''')'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7227 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7228 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7229 |
autoCompare value ifTrue:[ |
17047 | 7230 |
changeDelta := ChangeDeltaInformation |
7231 |
changeDeltaFor:text changeClass:changeClass selector:methodSelector. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7232 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7233 |
]. |
17047 | 7234 |
changeInfo last |
7235 |
headerLine:(self headerLineForChangeType:changeType |
|
7236 |
changeString:changeString |
|
7237 |
changeDelta:changeDelta |
|
7238 |
timeStampInfo:timeStampInfo). |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7239 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7240 |
changeString := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7241 |
headerLine := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7242 |
singleJunkOnly ifTrue:[done := true] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7243 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7244 |
singleInfo ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7245 |
timeStampInfo := nil |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7246 |
]. |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
7247 |
anyMethod ifFalse:[ |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
7248 |
emptyBlock value |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
7249 |
]. |
16372 | 7250 |
|
17094 | 7251 |
"Modified: / 21-11-2016 / 23:32:29 / cg" |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7252 |
! |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7253 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7254 |
processNonMethodChunk |
18059 | 7255 |
|s changeClass sel cls parseTree rec clsName ownerTree ownerName |
7256 |
m nameAndClass args instVarsArg classVarsArg categoryArg |
|
18490 | 7257 |
lastInfo newCategory newPackage| |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7258 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7259 |
(chunkText startsWith:'''---- snap') ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7260 |
self processSnapshotChunk. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7261 |
^ self |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7262 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7263 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7264 |
headerLine := chunkText , ' (doIt)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7265 |
|
18490 | 7266 |
changeString := (chunkText contractTo:maxLen) withoutSeparators. |
7267 |
||
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7268 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7269 |
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
|
7270 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7271 |
((chunkText startsWith:'''---- file') |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7272 |
or:[(chunkText startsWith:'''---- check')]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7273 |
changeType := ''. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7274 |
timeStampInfo := nil. |
19066 | 7275 |
changeString := changeString allGray. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7276 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7277 |
changeType := '(doIt)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7278 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7279 |
|
18059 | 7280 |
parseTree := browser parseExpression:fullChunkText inNameSpace:Smalltalk. |
7281 |
(parseTree notNil and:[parseTree ~~ #Error]) ifTrue:[ |
|
7282 |
parseTree isMessage ifTrue:[ |
|
7283 |
sel := parseTree selector. |
|
7284 |
rec := parseTree receiver. |
|
7285 |
args := parseTree args. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7286 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7287 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7288 |
sel := nil. |
18123 | 7289 |
Error handle:[:ex | |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7290 |
changeType := '(???)'. |
18123 | 7291 |
] do:[ |
7292 |
(Scanner new scanTokens:fullChunkText) size == 0 ifTrue:[ |
|
7293 |
"/ a comment only |
|
7294 |
changeType := self colorizeAsCommentChange:'(comment)'. |
|
7295 |
] ifFalse:[ |
|
7296 |
changeType := '(???)'. |
|
7297 |
] |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7298 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7299 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7300 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7301 |
(sel == #comment:) ifTrue:[ |
18059 | 7302 |
changeType := self colorizeAsCommentChange:'(comment)'. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7303 |
clsName := rec name. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7304 |
changeClass := (self nameSpaceForApply) classNamed:clsName. |
16372 | 7305 |
(changeInfo last) className:clsName. |
18059 | 7306 |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7307 |
autoCompare value ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7308 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7309 |
changeDelta := '?' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7310 |
] ifFalse:[ |
15087 | 7311 |
(changeClass comment = (args at:1) evaluate) ifTrue:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7312 |
changeDelta := '='. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7313 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7314 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7315 |
]. |
15087 | 7316 |
"/ sel := nil. |
7317 |
^ self. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7318 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7319 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7320 |
(sel == #removeSelector:) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7321 |
nameAndClass := self extractClassAndClassNameFromParseTree:rec. |
18059 | 7322 |
clsName := nameAndClass key. |
7323 |
changeClass := nameAndClass value. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7324 |
|
15087 | 7325 |
sel := (args at:1) evaluate. |
16372 | 7326 |
(changeInfo last) className:clsName. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7327 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7328 |
autoCompare value ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7329 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7330 |
changeDelta := '?' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7331 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7332 |
(changeClass includesSelector:sel asSymbol) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7333 |
changeDelta := '-'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7334 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7335 |
changeDelta := '='. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7336 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7337 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7338 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7339 |
changeType := '(remove)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7340 |
changeString := self contractClass:clsName selector:sel to:maxLen. |
15087 | 7341 |
"/ sel := nil. |
7342 |
^ self. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7343 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7344 |
|
18059 | 7345 |
(parseTree notNil |
7346 |
and:[parseTree ~~ #Error |
|
7347 |
and:[parseTree isMessage |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7348 |
and:[rec isMessage |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7349 |
and:[rec selector == #compiledMethodAt:]]]]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7350 |
nameAndClass := self extractClassAndClassNameFromParseTree:rec receiver. |
18059 | 7351 |
clsName := nameAndClass key. |
7352 |
changeClass := nameAndClass value. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7353 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7354 |
(sel == #category:) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7355 |
sel := (rec args at:1) evaluate. |
18059 | 7356 |
changeType := self colorizeAsCommentChange:'(category change)'. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7357 |
changeString := self contractClass:clsName selector:sel to:maxLen. |
18059 | 7358 |
newCategory := (args at:1) evaluate. |
7359 |
||
7360 |
"/ make it a category change |
|
7361 |
lastInfo := changeInfo last. |
|
7362 |
lastInfo className:clsName. |
|
7363 |
lastInfo selector:sel. |
|
7364 |
lastInfo categoryIfCategoryChange:newCategory. |
|
7365 |
||
15012 | 7366 |
autoCompare value ifTrue:[ |
7367 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
|
7368 |
changeDelta := '?' |
|
7369 |
] ifFalse:[ |
|
7370 |
m := changeClass compiledMethodAt:sel asSymbol. |
|
18059 | 7371 |
m isNil ifTrue:[ |
7372 |
"/ mhm - the method does not (no longer=) exist |
|
7373 |
changeDelta := '?' |
|
7374 |
] ifFalse:[ |
|
7375 |
m category = newCategory ifTrue:[ |
|
15012 | 7376 |
changeDelta := '='. |
7377 |
] |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7378 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7379 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7380 |
]. |
15087 | 7381 |
^ self. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7382 |
]. |
18059 | 7383 |
|
18490 | 7384 |
(sel == #package:) ifTrue:[ |
7385 |
sel := (rec args at:1) evaluate. |
|
7386 |
changeType := self colorizeAsCommentChange:'(package change)'. |
|
7387 |
changeString := self contractClass:clsName selector:sel to:maxLen. |
|
7388 |
newPackage := (args at:1) evaluate. |
|
7389 |
||
7390 |
"/ make it a category change |
|
7391 |
lastInfo := changeInfo last. |
|
7392 |
lastInfo className:clsName. |
|
7393 |
lastInfo selector:sel. |
|
7394 |
"/ lastInfo packageIfPackageChange:newPackage. |
|
7395 |
||
7396 |
autoCompare value ifTrue:[ |
|
7397 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
|
7398 |
changeDelta := '?' |
|
7399 |
] ifFalse:[ |
|
7400 |
m := changeClass compiledMethodAt:sel asSymbol. |
|
7401 |
m isNil ifTrue:[ |
|
7402 |
"/ mhm - the method does not (no longer=) exist |
|
7403 |
changeDelta := '?' |
|
7404 |
] ifFalse:[ |
|
7405 |
m package = newPackage ifTrue:[ |
|
7406 |
changeDelta := '='. |
|
7407 |
] |
|
7408 |
] |
|
7409 |
] |
|
7410 |
]. |
|
7411 |
^ self. |
|
7412 |
]. |
|
7413 |
||
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7414 |
(sel == #privacy:) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7415 |
sel := (rec args at:1) evaluate. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7416 |
changeType := '(privacy change)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7417 |
changeString := self contractClass:clsName selector:sel to:maxLen. |
16372 | 7418 |
(changeInfo last) className:clsName. |
18059 | 7419 |
|
15012 | 7420 |
autoCompare value ifTrue:[ |
7421 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
|
7422 |
changeDelta := '?' |
|
7423 |
] ifFalse:[ |
|
7424 |
changeDelta := ' ' |
|
7425 |
] |
|
7426 |
]. |
|
15087 | 7427 |
^ self. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7428 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7429 |
sel := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7430 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7431 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7432 |
(Class definitionSelectors includes:sel) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7433 |
changeType := '(class definition)'. |
15087 | 7434 |
clsName := (args at:1) evaluate. |
16372 | 7435 |
(changeInfo last) className:clsName. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7436 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7437 |
"/ is it a private-class ? |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7438 |
('*privateIn:' match:sel) ifTrue:[ |
15087 | 7439 |
ownerTree := args last. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7440 |
ownerName := ownerTree name asString. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7441 |
clsName := ownerName , '::' , clsName |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7442 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7443 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7444 |
changeString := clsName. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7445 |
NoColoring ~~ true ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7446 |
changeType := changeType allBold. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7447 |
changeString := changeString allBold. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7448 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7449 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7450 |
autoCompare value ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7451 |
cls := (self nameSpaceForApply) at:clsName asSymbol ifAbsent:nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7452 |
cls isNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7453 |
changeDelta := '+'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7454 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7455 |
(cls definitionSelector = sel |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7456 |
or:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7457 |
"/ could be an ST/V, VAge or Dolphin definition |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7458 |
cls definitionSelector = (sel , 'category:') |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7459 |
]) |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7460 |
ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7461 |
((cls superclass isNil |
18059 | 7462 |
and:[rec isLiteral |
7463 |
and:[rec evaluate isNil]]) |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7464 |
or:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7465 |
cls superclass notNil |
18059 | 7466 |
and:[rec isLiteral not |
7467 |
and:[cls superclass name = rec name]] |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7468 |
]) ifTrue:[ |
15087 | 7469 |
(sel == #'variableByteSubclass:classVariableNames:poolDictionaries:category:') |
7470 |
ifTrue:[ |
|
7471 |
"/ VSE definition message |
|
7472 |
instVarsArg := ''. |
|
7473 |
classVarsArg := (args at:2) evaluate. |
|
7474 |
categoryArg := (args at:4) evaluate. |
|
7475 |
] ifFalse:[ |
|
7476 |
instVarsArg := (args at:2) evaluate. |
|
7477 |
classVarsArg := (args at:3) evaluate. |
|
7478 |
categoryArg := (args at:5) evaluate. |
|
7479 |
]. |
|
7480 |
cls instanceVariableString asCollectionOfWords = instVarsArg asCollectionOfWords ifTrue:[ |
|
7481 |
cls classVariableString asCollectionOfWords = classVarsArg asCollectionOfWords ifTrue:[ |
|
7482 |
cls definitionSelector = (sel , 'category:') |
|
7483 |
ifTrue:[ |
|
7484 |
"/ ST/V, VAge or Dolphin definition |
|
7485 |
changeDelta := '='. |
|
7486 |
] ifFalse:[ |
|
7487 |
cls category = categoryArg ifTrue:[ |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7488 |
changeDelta := '='. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7489 |
] ifFalse:[ |
18059 | 7490 |
changeType := self colorizeAsCommentChange:'(class category change)'. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7491 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7492 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7493 |
] |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7494 |
] |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7495 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7496 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7497 |
] |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7498 |
]. |
15087 | 7499 |
"/ sel := nil. |
7500 |
^ self. |
|
7501 |
]. |
|
7502 |
||
7503 |
(#( |
|
7504 |
#'primitiveDefinitions:' |
|
7505 |
#'primitiveFunctions:' |
|
7506 |
#'primitiveVariables:' |
|
7507 |
) includes:sel) ifTrue:[ |
|
7508 |
changeType := '(class definition)'. |
|
7509 |
clsName := rec name. |
|
7510 |
^ self. |
|
7511 |
]. |
|
7512 |
||
7513 |
((sel == #instanceVariableNames:) |
|
7514 |
and:[rec isMessage |
|
7515 |
and:[rec selector == #class]]) ifTrue:[ |
|
7516 |
clsName := rec receiver name. |
|
7517 |
changeClass := (self nameSpaceForApply) classNamed:clsName. |
|
7518 |
changeType := '(class definition)'. |
|
16372 | 7519 |
(changeInfo last) className:clsName. |
15087 | 7520 |
|
7521 |
autoCompare value ifTrue:[ |
|
7522 |
changeClass isNil ifTrue:[ |
|
7523 |
changeDelta := '?'. |
|
7524 |
] ifFalse:[ |
|
18059 | 7525 |
s := (args at:1) evaluate. |
15087 | 7526 |
s = changeClass class instanceVariableString ifTrue:[ |
7527 |
changeDelta := '='. |
|
7528 |
] |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7529 |
] |
15087 | 7530 |
]. |
7531 |
^ self. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7532 |
]. |
9548 | 7533 |
|
16372 | 7534 |
"Modified: / 01-05-2016 / 19:19:54 / cg" |
18490 | 7535 |
"Modified: / 24-10-2018 / 13:01:41 / Claus Gittinger" |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7536 |
! |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7537 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7538 |
processSnapshotChunk |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7539 |
changeType := ''. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7540 |
headerLine := chunkText. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7541 |
changeString := (chunkText contractTo:maxLen) withoutSeparators. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7542 |
timeStampInfo := nil. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7543 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7544 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7545 |
readChangesFile |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7546 |
"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
|
7547 |
and a list of chunk-positions (changePositions). |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7548 |
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
|
7549 |
the cols are: |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7550 |
1 delta (only if comparing) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7551 |
'+' -> new method (w.r.t. current state) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7552 |
'-' -> removed method (w.r.t. current state) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7553 |
'?' -> class does not exist currently |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7554 |
'=' -> 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
|
7555 |
'~' -> 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
|
7556 |
2 class/selector |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7557 |
3 type of change |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7558 |
doit |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7559 |
method |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7560 |
category change |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7561 |
4 timestamp |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7562 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7563 |
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
|
7564 |
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
|
7565 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7566 |
|excla| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7567 |
|
16372 | 7568 |
changeInfo := OrderedCollection new. |
7569 |
||
7570 |
"/ changeChunks := OrderedCollection new. |
|
7571 |
"/ changeClassNames := OrderedCollection new. |
|
7572 |
"/ changeHeaderLines := OrderedCollection new. |
|
7573 |
"/ changePositions := OrderedCollection new. |
|
7574 |
"/ changeTimeStamps := OrderedCollection new. |
|
7575 |
"/ changeIsFollowupMethodChange := OrderedCollection new. |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7576 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7577 |
excla := inStream class chunkSeparator. |
9515 | 7578 |
maxLen := 100. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7579 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7580 |
[inStream atEnd] whileFalse:[ |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7581 |
" |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7582 |
get a chunk (separated by excla) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7583 |
" |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7584 |
inStream skipSeparators. |
13314 | 7585 |
chunkPosition := inStream position + 1. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7586 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7587 |
sawExcla := inStream peekFor:excla. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7588 |
chunkText := fullChunkText := inStream nextChunk. |
7619
95943c1bc289
Ignore empty chunks when reading from changes file
Stefan Vogel <sv@exept.de>
parents:
7618
diff
changeset
|
7589 |
chunkText notEmptyOrNil ifTrue:[ |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7590 |
self processChunk. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7591 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7592 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7593 |
|
9515 | 7594 |
"Modified: / 27-08-1995 / 23:06:55 / claus" |
16372 | 7595 |
"Modified: / 01-05-2016 / 18:33:36 / cg" |
7596 |
! ! |
|
7597 |
||
18059 | 7598 |
!ChangesBrowser::ChangeInfo class methodsFor:'documentation'! |
7599 |
||
7600 |
documentation |
|
7601 |
" |
|
7602 |
documentation to be added. |
|
7603 |
||
7604 |
[author:] |
|
7605 |
cg |
|
7606 |
||
7607 |
[instance variables:] |
|
7608 |
||
7609 |
[class variables:] |
|
7610 |
||
7611 |
[see also:] |
|
7612 |
||
7613 |
" |
|
7614 |
! ! |
|
7615 |
||
16372 | 7616 |
!ChangesBrowser::ChangeInfo methodsFor:'accessing'! |
7617 |
||
18059 | 7618 |
categoryIfCategoryChange |
7619 |
^ categoryIfCategoryChange |
|
7620 |
! |
|
7621 |
||
7622 |
categoryIfCategoryChange:something |
|
7623 |
categoryIfCategoryChange := something. |
|
7624 |
! |
|
7625 |
||
16372 | 7626 |
chunk |
7627 |
^ chunk |
|
7628 |
! |
|
7629 |
||
7630 |
className |
|
7631 |
^ className |
|
7632 |
! |
|
7633 |
||
7634 |
className:something |
|
7635 |
className := something. |
|
7636 |
! |
|
7637 |
||
7638 |
headerLine |
|
7639 |
^ headerLine |
|
7640 |
! |
|
7641 |
||
7642 |
headerLine:something |
|
7643 |
headerLine := something. |
|
7644 |
! |
|
7645 |
||
7646 |
isFollowupChange |
|
7647 |
^ isFollowupChange |
|
7648 |
! |
|
7649 |
||
18059 | 7650 |
isMethodCategoryChange |
7651 |
^ categoryIfCategoryChange notNil |
|
7652 |
! |
|
7653 |
||
16372 | 7654 |
position |
7655 |
^ position |
|
7656 |
! |
|
7657 |
||
7658 |
position:positionArg chunk:chunkArg className:classNameArg selector:selectorArg headerLine:headerLineArg |
|
7659 |
timestamp:timestampArg isFollowupChange:isFollowupChangeArg |
|
7660 |
||
7661 |
position := positionArg. |
|
7662 |
chunk := chunkArg. |
|
7663 |
className := classNameArg. |
|
7664 |
selector := selectorArg. |
|
7665 |
headerLine := headerLineArg. |
|
7666 |
timestamp := timestampArg. |
|
7667 |
isFollowupChange := isFollowupChangeArg. |
|
7668 |
||
7669 |
"Created: / 01-05-2016 / 19:01:03 / cg" |
|
7670 |
! |
|
7671 |
||
7672 |
selector |
|
7673 |
^ selector |
|
7674 |
! |
|
7675 |
||
7676 |
selector:something |
|
7677 |
selector := something. |
|
7678 |
! |
|
7679 |
||
7680 |
timestamp |
|
7681 |
^ timestamp |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7682 |
! ! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7683 |
|
761 | 7684 |
!ChangesBrowser class methodsFor:'documentation'! |
202 | 7685 |
|
7686 |
version |
|
15683 | 7687 |
^ '$Header$' |
8978 | 7688 |
! |
7689 |
||
7690 |
version_CVS |
|
15683 | 7691 |
^ '$Header$' |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
7692 |
! ! |
12428 | 7693 |