author | Claus Gittinger <cg@exept.de> |
Wed, 05 Jun 2019 14:16:59 +0200 | |
changeset 18805 | f6df57c6dbfb |
parent 18596 | 48275ca92cf1 |
child 18975 | 7e6179cc8f17 |
permissions | -rw-r--r-- |
18596 | 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 |
18429 | 29 |
rightCodeLabelHolder menuPanel toolbarMenu' |
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 |
^ |
|
764 |
#(Menu |
|
765 |
( |
|
766 |
(MenuItem |
|
767 |
label: 'Auto Compare' |
|
768 |
indication: autoCompare |
|
769 |
) |
|
770 |
(MenuItem |
|
771 |
label: 'Autoload As Required' |
|
772 |
indication: autoloadAsRequired |
|
773 |
) |
|
774 |
(MenuItem |
|
775 |
label: 'Show Diffs' |
|
776 |
indication: showingDiffs |
|
777 |
) |
|
778 |
(MenuItem |
|
779 |
label: 'Auto Update' |
|
780 |
indication: autoUpdate |
|
781 |
) |
|
782 |
(MenuItem |
|
783 |
label: '-' |
|
784 |
) |
|
785 |
(MenuItem |
|
786 |
label: 'Add to ChangeSet when Applying' |
|
787 |
indication: updateChangeSet |
|
788 |
) |
|
789 |
(MenuItem |
|
790 |
label: 'Ignore Public/Private in Categories (Dolphin code)' |
|
791 |
itemValue: ignorePublicPrivateCategories: |
|
792 |
isVisible: false |
|
793 |
indication: ignorePublicPrivateCategories |
|
794 |
) |
|
795 |
(MenuItem |
|
796 |
label: '-' |
|
797 |
) |
|
798 |
(MenuItem |
|
799 |
label: 'Apply into Package...' |
|
800 |
itemValue: setEnforcedPackage |
|
801 |
) |
|
802 |
(MenuItem |
|
803 |
label: 'Apply into NameSpace...' |
|
804 |
itemValue: setEnforcedNameSpace |
|
805 |
) |
|
806 |
(MenuItem |
|
807 |
label: '-' |
|
808 |
) |
|
809 |
(MenuItem |
|
810 |
label: 'Settings...' |
|
811 |
itemValue: openSettingsDialog |
|
7096 | 812 |
) |
813 |
) |
|
814 |
nil |
|
815 |
nil |
|
3202 | 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). |
|
1680 |
buttonPanel verticalLayout:#topSpace; horizontalLayout:#leftSpace. |
|
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 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1842 |
doApply |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1843 |
"user wants a change to be applied" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1844 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1845 |
self withSelectedChangesDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1846 |
(self applyChange:changeNr) ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1847 |
^ self "/ cancel |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1848 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1849 |
self autoSelect:(changeNr + 1) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1850 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1851 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1852 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1853 |
doApplyAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1854 |
"user wants all changes to be applied" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1855 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1856 |
self withExecuteCursorDo:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1857 |
|lastNr "{ Class: SmallInteger }" | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1858 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1859 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1860 |
lastNr := self numberOfChanges. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1861 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1862 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1863 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1864 |
multipleApply := lastNr > 1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1865 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1866 |
1 to:lastNr do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1867 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1868 |
self applyChange:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1869 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1870 |
self autoSelectLast |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1871 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1872 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1873 |
"Modified: 21.1.1997 / 22:26:30 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1874 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1875 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1876 |
doApplyClassFromBeginning |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1877 |
"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
|
1878 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1879 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1880 |
|thisClassName classNameToApply lastChange |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1881 |
lastNr "{ Class: SmallInteger }" | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1882 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1883 |
classNameToApply := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1884 |
classNameToApply notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1885 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1886 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1887 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1888 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1889 |
multipleApply := changeNr ~= 1. |
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 |
1 to:changeNr do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1892 |
thisClassName := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1893 |
thisClassName = classNameToApply ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1894 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1895 |
self applyChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1896 |
lastChange := changeNr |
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 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1899 |
self autoSelect:changeNr+1. |
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 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1902 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1903 |
"Modified: 21.1.1997 / 22:26:04 / cg" |
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1906 |
doApplyClassRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1907 |
"user wants all changes for this class from changeNr to be applied" |
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 withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1910 |
|thisClassName classNameToApply lastChange |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1911 |
lastNr "{ Class: SmallInteger }" | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1912 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1913 |
classNameToApply := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1914 |
classNameToApply notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1915 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1916 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1917 |
lastNr := self numberOfChanges. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1918 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1919 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1920 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1921 |
multipleApply := (lastNr - changeNr) > 1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1922 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1923 |
changeNr to:lastNr do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1924 |
thisClassName := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1925 |
thisClassName = classNameToApply ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1926 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1927 |
self applyChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1928 |
lastChange := changeNr |
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 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1931 |
self autoSelect:lastChange. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1932 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1933 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1934 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1935 |
"Modified: 21.1.1997 / 22:26:04 / cg" |
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 |
doApplyFromBeginning |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1939 |
"user wants all changes from 1 to changeNr to be applied" |
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 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1942 |
|lastNr "{ Class: SmallInteger }" | |
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 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1945 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1946 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1947 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1948 |
multipleApply := changeNr ~= 1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1949 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1950 |
1 to:changeNr do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1951 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1952 |
self applyChange:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1953 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1954 |
self autoSelect:changeNr+1. |
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 |
! |
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 |
doApplyRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1959 |
"apply all changes from changeNr to the end" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1960 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1961 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1962 |
|lastNr "{ Class: SmallInteger }" | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1963 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1964 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1965 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1966 |
lastNr := self numberOfChanges. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1967 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1968 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1969 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1970 |
multipleApply := (lastNr - changeNr) > 1. |
15087 | 1971 |
AbortAllOperationRequest handle:[:ex | |
1972 |
ex return |
|
1973 |
] do:[ |
|
1974 |
changeNr to:lastNr do:[:changeNr | |
|
1975 |
changeListView setSelection:changeNr. |
|
1976 |
self applyChange:changeNr |
|
1977 |
]. |
|
1978 |
self autoSelect:self numberOfChanges. |
|
1979 |
] |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1980 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1981 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1982 |
"Modified: 21.1.1997 / 22:25:29 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1983 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1984 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1985 |
doApplyToConflictOrEnd |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1986 |
"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
|
1987 |
or the end." |
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 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1990 |
|lastNr "{ Class: SmallInteger }"| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1991 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1992 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1993 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1994 |
lastNr := self numberOfChanges. |
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 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1997 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1998 |
multipleApply := (lastNr - changeNr) > 1. |
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 |
changeNr to:lastNr do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2001 |
| cls sel | |
18059 | 2002 |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2003 |
changeListView setSelection:changeNr. |
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 |
((cls := self classOfChange:changeNr ifAbsent:[:className| nil]) notNil |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2006 |
and:[(sel := self selectorOfMethodChange:changeNr) notNil]) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2007 |
ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2008 |
(cls includesSelector:sel) ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2009 |
self autoSelect:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2010 |
^ self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2011 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2012 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2013 |
self applyChange:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2014 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2015 |
self autoSelect:self numberOfChanges. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2016 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2017 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2018 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2019 |
doBrowse |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2020 |
"user wants a browser on the class of a change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2021 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2022 |
self withSingleSelectedChangeDo:[:changeNr | |
17666 | 2023 |
|cls| |
2024 |
||
2025 |
cls := self classOfChange:changeNr. |
|
2026 |
cls notNil ifTrue:[ |
|
2027 |
SystemBrowser default |
|
2028 |
openInClass:cls |
|
2029 |
selector:(self selectorOfMethodChange:changeNr) |
|
2030 |
] |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2031 |
] |
17666 | 2032 |
|
2033 |
"Modified: / 01-09-2017 / 14:20:00 / cg" |
|
11499
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2036 |
doBrowseImplementors |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2037 |
"open an implementors-browser" |
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 initial selector| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2040 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2041 |
(changeNr := self theSingleSelection) notNil ifTrue:[ |
17666 | 2042 |
initial := self selectorOfMethodChange:changeNr. |
11499
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2045 |
selector := Dialog |
17666 | 2046 |
request:'Selector to browse implementors of:' |
2047 |
initialAnswer:(initial ? ''). |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2048 |
selector size ~~ 0 ifTrue:[ |
17666 | 2049 |
SystemBrowser default browseImplementorsMatching:selector. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2050 |
] |
17666 | 2051 |
|
2052 |
"Modified (format): / 01-09-2017 / 14:20:06 / cg" |
|
11499
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2055 |
doBrowseSenders |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2056 |
"user wants a browser on the class of a change" |
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 |
|changeNr initial selector| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2059 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2060 |
(changeNr := self theSingleSelection) notNil ifTrue:[ |
17666 | 2061 |
initial := self selectorOfMethodChange:changeNr. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2062 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2063 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2064 |
selector := Dialog |
17666 | 2065 |
request:'Selector to browse senders of:' |
2066 |
initialAnswer:(initial ? ''). |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2067 |
selector size ~~ 0 ifTrue:[ |
17666 | 2068 |
SystemBrowser default browseAllCallsOn:selector asSymbol. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2069 |
] |
17666 | 2070 |
|
2071 |
"Modified: / 01-09-2017 / 14:20:13 / cg" |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2072 |
! |
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 |
doCheckinAndDeleteClassAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2075 |
"first checkin the selected changes class then delete all changes |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2076 |
for it." |
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 |
|classes answer logTitle checkinInfo| |
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 |
"/ self theSingleSelection isNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2081 |
"/ ^ self information:'Only possible if a single change is selected.'. |
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 |
self withExecuteCursorDo:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2085 |
classes := IdentitySet new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2086 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2087 |
self withSelectedChangesDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2088 |
| className class | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2089 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2090 |
className := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2091 |
className notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2092 |
class := Smalltalk classNamed:className. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2093 |
class isNil ifTrue:[ |
18152 | 2094 |
self proceedableError:'oops - no class: ', className. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2095 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2096 |
class notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2097 |
class := class theNonMetaclass. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2098 |
(classes includes:class) ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2099 |
class isPrivate ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2100 |
(classes includes:class owningClass) ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2101 |
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
|
2102 |
bindWith:class owningClass name allBold) withCRs. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2103 |
answer isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2104 |
answer ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2105 |
classes add:class owningClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2106 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2107 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2108 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2109 |
classes add:class |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2110 |
]. |
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 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2114 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2115 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2116 |
classes size == 1 ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2117 |
logTitle := classes first name. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2118 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2119 |
logTitle := '%1 classes' bindWith:classes size. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2120 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2121 |
checkinInfo := SourceCodeManagerUtilities default |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2122 |
getCheckinInfoFor:logTitle |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2123 |
initialAnswer:nil. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2124 |
checkinInfo isNil ifTrue:[^ self ]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2125 |
|
18059 | 2126 |
self unselect. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2127 |
classes do:[:eachClass | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2128 |
(SourceCodeManagerUtilities default checkinClass:eachClass withInfo:checkinInfo) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2129 |
ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2130 |
self silentDeleteChangesForClassAndPrivateClasses:eachClass name |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2131 |
from:1 to:(self numberOfChanges). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2132 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2133 |
]. |
18059 | 2134 |
self updateChangeList. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2135 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2136 |
|
18152 | 2137 |
"Modified: / 06-09-1995 / 17:11:16 / claus" |
2138 |
"Modified: / 17-11-2001 / 14:21:13 / cg" |
|
2139 |
"Modified: / 24-05-2018 / 14:55:14 / Claus Gittinger" |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2140 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2141 |
|
18059 | 2142 |
doCleanup |
2143 |
"cleanup the changefile/changeset. |
|
2144 |
actions done: |
|
2145 |
- from the end, find changes which are equal to the current version |
|
18061 | 2146 |
and not in the current changeset (i.e. represents the current version as built from CVS). |
18059 | 2147 |
Then delete it incl. previous versions of it." |
2148 |
||
2149 |
|numChanges nextChangeNr changeNr changeSelector changeClass numDeleted| |
|
2150 |
||
2151 |
numChanges := self numberOfChanges. |
|
2152 |
self unselect. |
|
2153 |
||
2154 |
self withWaitCursorDo:[ |
|
2155 |
"/ find the last method change which is equal |
|
2156 |
changeNr := numChanges. |
|
2157 |
[changeNr > 0] whileTrue:[ |
|
2158 |
nextChangeNr := changeNr - 1. |
|
2159 |
||
2160 |
(changeClass := self classOfChange:changeNr ifAbsent:nil) notNil ifTrue:[ |
|
2161 |
||
2162 |
(changeInfoList at:changeNr) isMethodCategoryChange ifTrue:[ |
|
2163 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
|
2164 |
(changeSelector := self selectorOfMethodCategoryChange:changeNr) notNil ifTrue:[ |
|
2165 |
(ChangeSet current includesChangeForClass:changeClass selector:changeSelector) ifFalse:[ |
|
2166 |
infoHolder value:('Deleting category changes for %1 >> %2' bindWith:changeClass name with:changeSelector). |
|
2167 |
self windowGroup repairDamage. |
|
2168 |
numDeleted := self |
|
2169 |
silentDeleteMethodCategoryChangesFor:changeClass name selector:changeSelector |
|
2170 |
from:1 to:changeNr. |
|
2171 |
"/ self selectChange:changeNr. |
|
2172 |
"/ self doDeleteClassSelectorOlder. |
|
2173 |
nextChangeNr := (changeNr - numDeleted + 1) min:self numberOfChanges. |
|
2174 |
]. |
|
2175 |
]. |
|
2176 |
]. |
|
2177 |
] ifFalse:[ |
|
2178 |
(changeSelector := self selectorOfMethodChange:changeNr) notNil ifTrue:[ |
|
2179 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
|
2180 |
"/ found a method change, which is the same as the current version |
|
2181 |
"/ if in the current changeSet, then do not delete (needs checkin first) |
|
2182 |
(ChangeSet current includesChangeForClass:changeClass selector:changeSelector) ifFalse:[ |
|
2183 |
infoHolder value:('Deleting changes for %1 >> %2' bindWith:changeClass name with:changeSelector). |
|
2184 |
self windowGroup repairDamage. |
|
2185 |
numDeleted := self |
|
2186 |
silentDeleteChangesFor:changeClass name selector:changeSelector |
|
2187 |
from:1 to:changeNr. |
|
2188 |
"/ self selectChange:changeNr. |
|
2189 |
"/ self doDeleteClassSelectorOlder. |
|
2190 |
nextChangeNr := (changeNr - numDeleted + 1) min:self numberOfChanges. |
|
2191 |
]. |
|
2192 |
]. |
|
2193 |
]. |
|
2194 |
]. |
|
2195 |
]. |
|
2196 |
changeNr := nextChangeNr. |
|
2197 |
]. |
|
2198 |
]. |
|
2199 |
self updateChangeList. |
|
2200 |
! |
|
2201 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2202 |
doCompare |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2203 |
"compare change with current system version" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2204 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2205 |
classesNotToBeAutoloaded removeAll. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2206 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2207 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2208 |
self withExecuteCursorDo:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2209 |
self compareChange:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2210 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2211 |
self newLabel:'' |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2212 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2213 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2214 |
"Modified: 24.2.1996 / 19:37:19 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2215 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2216 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2217 |
doCompareAndCompress |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2218 |
"remove all changes, which are equivalent to the current image version" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2219 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2220 |
|toDelete| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2221 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2222 |
classesNotToBeAutoloaded removeAll. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2223 |
toDelete := OrderedCollection new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2224 |
self withExecuteCursorDo:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2225 |
1 to:self numberOfChanges do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2226 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2227 |
toDelete add:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2228 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2229 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2230 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2231 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2232 |
toDelete reverseDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2233 |
self silentDeleteChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2234 |
]. |
18059 | 2235 |
self updateChangeList. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2236 |
" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2237 |
scroll back a bit, if we are left way behind the list |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2238 |
" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2239 |
changeListView firstLineShown > self numberOfChanges ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2240 |
changeListView makeLineVisible:self numberOfChanges |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2241 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2242 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2243 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2244 |
self newLabel:''. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2245 |
classesNotToBeAutoloaded removeAll. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2246 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2247 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2248 |
doCompress |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2249 |
"compress the change-set; this replaces multiple method-changes by the last |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2250 |
(i.e. the most recent) change" |
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 |
self compressForClass:nil |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2253 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2254 |
"Modified: / 29.10.1997 / 01:03:26 / cg" |
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2257 |
doCompressClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2258 |
"compress changes for the selected class. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2259 |
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
|
2260 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2261 |
self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2262 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2263 |
self selectedClassNames do:[:classNameToCompress | |
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2264 |
self compressForClass:classNameToCompress. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2265 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2266 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2267 |
"Created: / 29.10.1997 / 01:05:16 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2268 |
"Modified: / 19.11.2001 / 21:55:17 / cg" |
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 |
doCompressSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2272 |
"compress changes for the selected class & selector. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2273 |
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
|
2274 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2275 |
|classSelectorPairs| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2276 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2277 |
self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2278 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2279 |
classSelectorPairs := Set new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2280 |
self withSelectedChangesDo:[:changeNr | |
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2281 |
| classNameToCompress selector | |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2282 |
|
17600 | 2283 |
classNameToCompress := self realClassNameOfChange:changeNr. |
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2284 |
classNameToCompress notNil ifTrue:[ |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2285 |
selector := self selectorOfMethodChange:changeNr. |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2286 |
selector notNil ifTrue:[ |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2287 |
classSelectorPairs add:(classNameToCompress -> selector). |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2288 |
] |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2289 |
] |
11499
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2292 |
classSelectorPairs do:[:pair | |
17600 | 2293 |
self compressForClass:(pair key) selector:(pair value). |
11499
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 |
"Created: / 19.11.2001 / 21:50:59 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2297 |
"Modified: / 19.11.2001 / 22:10:08 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2298 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2299 |
|
17096 | 2300 |
doCopyToClipboard |
2301 |
"user wants a change text to be copied to the clipboard" |
|
2302 |
||
2303 |
|text| |
|
2304 |
||
2305 |
self withSingleSelectedChangeDo:[:changeNr | |
|
2306 |
text := self sourceOfMethodChange:changeNr. |
|
2307 |
]. |
|
2308 |
text notEmptyOrNil ifTrue:[ |
|
2309 |
self window setClipboardText:text |
|
2310 |
] |
|
2311 |
||
2312 |
"Created: / 21-11-2016 / 23:38:11 / cg" |
|
2313 |
! |
|
2314 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2315 |
doDelete |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2316 |
"delete currently selected change(s)" |
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 |
|rangeEnd rangeStart firstDeleted| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2319 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2320 |
changeListView selection size <= 5 ifTrue:[ |
16467 | 2321 |
self withSelectedChangesReverseDo:[:changeNr | |
2322 |
self deleteChange:changeNr. |
|
2323 |
self autoSelectOrEnd:changeNr |
|
2324 |
]. |
|
2325 |
self showNumberOfChanges. |
|
2326 |
^ self |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2327 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2328 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2329 |
self withSelectedChangesReverseDo:[:changeNr | |
16467 | 2330 |
rangeEnd isNil ifTrue:[ |
2331 |
rangeEnd := rangeStart := changeNr |
|
2332 |
] ifFalse:[ |
|
2333 |
(changeNr = (rangeEnd + 1)) ifTrue:[ |
|
2334 |
rangeEnd := changeNr |
|
2335 |
] ifFalse:[ |
|
2336 |
(changeNr = (rangeStart - 1)) ifTrue:[ |
|
2337 |
rangeStart := changeNr |
|
2338 |
] ifFalse:[ |
|
2339 |
self deleteChangesFrom:rangeStart to:rangeEnd. |
|
2340 |
firstDeleted := (firstDeleted ? rangeStart) min:rangeStart. |
|
2341 |
rangeStart := rangeEnd := nil. |
|
2342 |
]. |
|
2343 |
]. |
|
2344 |
]. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2345 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2346 |
rangeStart notNil ifTrue:[ |
16467 | 2347 |
self deleteChangesFrom:rangeStart to:rangeEnd. |
2348 |
firstDeleted := (firstDeleted ? rangeStart) min:rangeStart. |
|
2349 |
]. |
|
2350 |
self autoSelectOrEnd:firstDeleted. |
|
2351 |
self showNumberOfChanges |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2352 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2353 |
|
12428 | 2354 |
doDeleteAllForNamespace |
2355 |
"delete all changes for classes with same namespace as currently selected change" |
|
2356 |
||
2357 |
|namespacesToDelete lastChangeNr overAllNumDeletedBefore| |
|
2358 |
||
2359 |
lastChangeNr := -1. |
|
2360 |
namespacesToDelete := Set new. |
|
2361 |
self withSelectedChangesDo:[:changeNr | |
|
2362 |
|namespaceToDelete| |
|
2363 |
||
2364 |
namespaceToDelete := self namespaceOfChange:changeNr. |
|
2365 |
namespaceToDelete notNil ifTrue:[ |
|
2366 |
namespacesToDelete add:namespaceToDelete |
|
2367 |
]. |
|
2368 |
lastChangeNr := lastChangeNr max:changeNr. |
|
2369 |
]. |
|
2370 |
namespacesToDelete isEmpty ifTrue:[^ self]. |
|
2371 |
||
2372 |
overAllNumDeletedBefore := 0. |
|
18059 | 2373 |
self unselect. |
12428 | 2374 |
|
2375 |
self withExecuteCursorDo:[ |
|
2376 |
namespacesToDelete do:[:namespaceToDelete | |
|
2377 |
|numDeletedBefore| |
|
2378 |
||
2379 |
self |
|
2380 |
silentDeleteChangesForNamespace:namespaceToDelete |
|
2381 |
from:lastChangeNr |
|
2382 |
to:(self numberOfChanges). |
|
2383 |
numDeletedBefore := self |
|
2384 |
silentDeleteChangesForNamespace:namespaceToDelete |
|
2385 |
from:1 |
|
2386 |
to:(lastChangeNr-1). |
|
2387 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
2388 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
2389 |
]. |
|
2390 |
]. |
|
2391 |
||
18059 | 2392 |
self updateChangeList. |
16467 | 2393 |
self autoSelectOrEnd:lastChangeNr. |
12428 | 2394 |
! |
2395 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2396 |
doDeleteAndSelectPrevious |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2397 |
"delete currently selected change(s)" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2398 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2399 |
self withSelectedChangesReverseDo:[:changeNr | |
16467 | 2400 |
self deleteChange:changeNr. |
2401 |
self autoSelectOrEnd:changeNr-1 |
|
2402 |
]. |
|
2403 |
||
2404 |
"/mh - don't we need a |
|
2405 |
"/ self setChangeList |
|
2406 |
"/ here? |
|
2407 |
self showNumberOfChanges |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2408 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2409 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2410 |
doDeleteClassAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2411 |
"delete all changes with same class as currently selected change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2412 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2413 |
|classNamesToDelete lastChangeNr overAllNumDeletedBefore| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2414 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2415 |
lastChangeNr := -1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2416 |
classNamesToDelete := Set new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2417 |
self withSelectedChangesDo:[:changeNr | |
16467 | 2418 |
|classNameToDelete| |
2419 |
||
2420 |
classNameToDelete := self classNameOfChange:changeNr. |
|
2421 |
classNameToDelete notNil ifTrue:[ |
|
2422 |
classNamesToDelete add:classNameToDelete. |
|
2423 |
]. |
|
2424 |
lastChangeNr := lastChangeNr max:changeNr. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2425 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2426 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2427 |
overAllNumDeletedBefore := 0. |
18059 | 2428 |
self unselect. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2429 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2430 |
self withExecuteCursorDo:[ |
16467 | 2431 |
classNamesToDelete do:[:classNameToDelete | |
2432 |
|numDeletedBefore| |
|
2433 |
||
2434 |
self silentDeleteChangesFor:classNameToDelete |
|
2435 |
from:lastChangeNr |
|
2436 |
to:(self numberOfChanges). |
|
2437 |
numDeletedBefore := self |
|
2438 |
silentDeleteChangesFor:classNameToDelete |
|
2439 |
from:1 |
|
2440 |
to:(lastChangeNr-1). |
|
2441 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
2442 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
2443 |
]. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2444 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2445 |
|
18059 | 2446 |
self updateChangeList. |
16467 | 2447 |
self autoSelectOrEnd:lastChangeNr. |
11499
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 |
"Created: / 13.12.1995 / 16:07:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2450 |
"Modified: / 28.1.1998 / 20:42:14 / cg" |
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2453 |
doDeleteClassAndPrivateClassesAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2454 |
"delete all changes with same class and private classes |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2455 |
as currently selected change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2456 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2457 |
|lastChangeNr classNamesToDelete overAllNumDeletedBefore| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2458 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2459 |
lastChangeNr := -1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2460 |
classNamesToDelete := Set new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2461 |
self withSelectedChangesDo:[:changeNr | |
16467 | 2462 |
|classNameToDelete| |
2463 |
||
2464 |
classNameToDelete := self ownerClassNameOfChange:changeNr. |
|
2465 |
classNameToDelete notNil ifTrue:[ |
|
2466 |
classNamesToDelete add:classNameToDelete. |
|
2467 |
]. |
|
2468 |
lastChangeNr := lastChangeNr max:changeNr. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2469 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2470 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2471 |
overAllNumDeletedBefore := 0. |
18059 | 2472 |
self unselect. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2473 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2474 |
self withExecuteCursorDo:[ |
16467 | 2475 |
classNamesToDelete do:[:classNameToDelete | |
2476 |
| changeNr numDeletedBefore| |
|
2477 |
||
2478 |
classNameToDelete notNil ifTrue:[ |
|
2479 |
changeListView setSelection:nil. |
|
2480 |
self silentDeleteChangesForClassAndPrivateClasses:classNameToDelete |
|
2481 |
from:lastChangeNr |
|
2482 |
to:(self numberOfChanges). |
|
2483 |
numDeletedBefore := self |
|
2484 |
silentDeleteChangesForClassAndPrivateClasses:classNameToDelete |
|
2485 |
from:1 |
|
2486 |
to:(lastChangeNr-1). |
|
2487 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
2488 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
2489 |
] |
|
2490 |
] |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2491 |
]. |
18059 | 2492 |
self updateChangeList. |
16467 | 2493 |
self autoSelectOrEnd:lastChangeNr. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2494 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2495 |
"Created: / 13.12.1995 / 16:07:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2496 |
"Modified: / 28.1.1998 / 20:42:14 / cg" |
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2499 |
doDeleteClassFromBeginning |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2500 |
"delete changes with same class as currently selected change from the beginning |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2501 |
up to the selected change. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2502 |
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
|
2503 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2504 |
self withSingleSelectedChangeDo:[:changeNr | |
18059 | 2505 |
|classNameToDelete prevSelection numDeleted| |
2506 |
||
2507 |
classNameToDelete := self classNameOfChange:changeNr. |
|
2508 |
classNameToDelete notNil ifTrue:[ |
|
2509 |
prevSelection := changeNr. |
|
2510 |
self unselect. |
|
2511 |
numDeleted := self |
|
2512 |
silentDeleteChangesFor:classNameToDelete |
|
2513 |
from:1 |
|
2514 |
to:changeNr. |
|
2515 |
self updateChangeList. |
|
2516 |
self autoSelectOrEnd:(changeNr + 1 - numDeleted) |
|
2517 |
] |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2518 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2519 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2520 |
"Created: 13.12.1995 / 15:41:58 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2521 |
"Modified: 25.5.1996 / 12:26:34 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2522 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2523 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2524 |
doDeleteClassRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2525 |
"delete rest of changes with same class as currently selected change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2526 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2527 |
self withSingleSelectedChangeDo:[:changeNr | |
18059 | 2528 |
| classNameToDelete | |
2529 |
||
2530 |
classNameToDelete := self classNameOfChange:changeNr. |
|
2531 |
classNameToDelete notNil ifTrue:[ |
|
2532 |
self unselect. |
|
2533 |
self silentDeleteChangesFor:classNameToDelete |
|
2534 |
from:changeNr |
|
2535 |
to:(self numberOfChanges). |
|
2536 |
self updateChangeList. |
|
2537 |
self autoSelectOrEnd:changeNr |
|
2538 |
] |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2539 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2540 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2541 |
"Modified: / 18.5.1998 / 14:25:07 / cg" |
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2544 |
doDeleteClassSelectorAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2545 |
"delete all changes with same class and selector as currently selected change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2546 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2547 |
|classNameSelectorPairsToDelete lastChangeNr overAllNumDeletedBefore| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2548 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2549 |
lastChangeNr := -1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2550 |
classNameSelectorPairsToDelete := Set new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2551 |
self withSelectedChangesDo:[:changeNr | |
17600 | 2552 |
|className selector| |
2553 |
||
2554 |
className := self realClassNameOfChange:changeNr. |
|
2555 |
selector := self selectorOfMethodChange:changeNr. |
|
2556 |
selector notNil ifTrue:[ |
|
2557 |
(className notNil and:[selector notNil]) ifTrue:[ |
|
2558 |
classNameSelectorPairsToDelete add:(className -> selector). |
|
2559 |
] |
|
2560 |
]. |
|
2561 |
lastChangeNr := lastChangeNr max:changeNr. |
|
11499
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2564 |
overAllNumDeletedBefore := 0. |
18059 | 2565 |
self unselect. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2566 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2567 |
self withExecuteCursorDo:[ |
17600 | 2568 |
classNameSelectorPairsToDelete do:[:pair | |
2569 |
|numDeletedBefore className selector| |
|
2570 |
||
2571 |
className := pair key. |
|
2572 |
selector := pair value. |
|
2573 |
self silentDeleteChangesFor:className selector:selector |
|
2574 |
from:lastChangeNr |
|
2575 |
to:(self numberOfChanges). |
|
2576 |
numDeletedBefore := self |
|
2577 |
silentDeleteChangesFor:className selector:selector |
|
2578 |
from:1 |
|
2579 |
to:(lastChangeNr-1). |
|
2580 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
2581 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
2582 |
]. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2583 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2584 |
|
18059 | 2585 |
self updateChangeList. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2586 |
self autoSelectOrEnd:lastChangeNr |
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 |
"Created: / 13.12.1995 / 16:07:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2589 |
"Modified: / 28.1.1998 / 20:42:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2590 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2591 |
|
16475 | 2592 |
doDeleteClassSelectorOlder |
18596 | 2593 |
"delete this and older changes with same class and selector |
2594 |
as the currently selected change(s). |
|
2595 |
If the selected change is a class-definition change, |
|
2596 |
older definitions for this class are deleted. |
|
2597 |
If the selected change is a method-category change, |
|
2598 |
older category changes for this method are deleted" |
|
16475 | 2599 |
|
18232 | 2600 |
|classNameSelectorTypeTuplesToDelete |
18596 | 2601 |
lastChangeNr overAllNumDeletedBefore hasCheckinInfoSelected| |
2602 |
||
2603 |
hasCheckinInfoSelected := false. |
|
16475 | 2604 |
lastChangeNr := -1. |
18232 | 2605 |
classNameSelectorTypeTuplesToDelete := OrderedCollection new. |
16475 | 2606 |
|
17597 | 2607 |
"/ collect info on what is to be deleted |
18232 | 2608 |
self withSelectedChangesInOrder:#reverse do:[:changeNr | |
2609 |
|className selector changeType| |
|
2610 |
||
17600 | 2611 |
className := self realClassNameOfChange:changeNr. |
16475 | 2612 |
selector := self selectorOfMethodChange:changeNr. |
18596 | 2613 |
selector notNil ifTrue:[ |
2614 |
changeType := #methodChange. |
|
2615 |
] ifFalse:[ |
|
18232 | 2616 |
(changeInfoList at:changeNr) isMethodCategoryChange ifTrue:[ |
2617 |
selector := self selectorOfMethodCategoryChange:changeNr. |
|
2618 |
selector notNil ifTrue:[ |
|
2619 |
changeType := #methodCategoryChange. |
|
2620 |
] |
|
18596 | 2621 |
] ifFalse:[ |
2622 |
(self isClassDefinitionChange:changeNr) ifTrue:[ |
|
2623 |
changeType := #classDefinitionChange. |
|
2624 |
] ifFalse:[ |
|
2625 |
(self changeIsCheckinInfo:changeNr) ifTrue:[ |
|
2626 |
changeType := #checkinInfo. |
|
2627 |
hasCheckinInfoSelected := true. |
|
2628 |
] |
|
2629 |
] |
|
2630 |
]. |
|
16475 | 2631 |
]. |
18596 | 2632 |
changeType notNil ifTrue:[ |
18232 | 2633 |
classNameSelectorTypeTuplesToDelete add:{ className . selector . changeType . changeNr}. |
2634 |
]. |
|
16475 | 2635 |
lastChangeNr := lastChangeNr max:changeNr. |
2636 |
]. |
|
2637 |
||
2638 |
overAllNumDeletedBefore := 0. |
|
18059 | 2639 |
self unselect. |
16475 | 2640 |
|
2641 |
self withExecuteCursorDo:[ |
|
18232 | 2642 |
classNameSelectorTypeTuplesToDelete do:[:tuple | |
2643 |
|numDeletedBefore className selector changeType lastToDelete| |
|
2644 |
||
2645 |
className := tuple at:1. |
|
2646 |
selector := tuple at:2. |
|
2647 |
changeType := tuple at:3. |
|
2648 |
lastToDelete := (tuple at:4) - overAllNumDeletedBefore. |
|
2649 |
||
2650 |
changeType == #methodCategoryChange ifTrue:[ |
|
2651 |
numDeletedBefore := self |
|
2652 |
silentDeleteMethodCategoryChangesFor:className selector:selector |
|
2653 |
from:1 to:lastToDelete. |
|
18596 | 2654 |
] ifFalse:[ |
2655 |
changeType == #classDefinitionChange ifTrue:[ |
|
2656 |
numDeletedBefore := self |
|
2657 |
silentDeleteClassDefinitionChangesFor:className |
|
2658 |
from:1 to:lastToDelete. |
|
2659 |
] ifFalse:[ |
|
2660 |
changeType == #checkinInfo ifTrue:[ |
|
2661 |
numDeletedBefore := self |
|
2662 |
silentDeleteCheckinInfosFor:className |
|
2663 |
from:1 to:lastToDelete. |
|
2664 |
] ifFalse:[ |
|
2665 |
changeType == #methodChange ifTrue:[ |
|
2666 |
numDeletedBefore := self |
|
2667 |
silentDeleteChangesFor:className selector:selector |
|
2668 |
from:1 to:lastToDelete. |
|
2669 |
] ifFalse:[ |
|
2670 |
numDeletedBefore := 0. |
|
2671 |
self halt:'oops'. |
|
2672 |
]. |
|
2673 |
] |
|
2674 |
] |
|
18232 | 2675 |
]. |
16475 | 2676 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
2677 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
2678 |
]. |
|
2679 |
]. |
|
2680 |
||
18059 | 2681 |
self updateChangeList. |
18596 | 2682 |
|
2683 |
hasCheckinInfoSelected ifFalse:[ |
|
2684 |
"/ skip over info chunks |
|
2685 |
[ |
|
2686 |
lastChangeNr > 1 |
|
2687 |
and:[ self changeIsSpecialInfo:lastChangeNr anyOf:#('snapshot' 'checkin')] |
|
2688 |
] whileTrue:[ |
|
2689 |
lastChangeNr := lastChangeNr - 1 |
|
2690 |
]. |
|
2691 |
]. |
|
16475 | 2692 |
self autoSelectOrEnd:lastChangeNr |
17597 | 2693 |
|
2694 |
"Modified: / 25-07-2017 / 10:57:31 / cg" |
|
18596 | 2695 |
"Modified: / 15-02-2019 / 12:26:02 / Claus Gittinger" |
16475 | 2696 |
! |
2697 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2698 |
doDeleteFromBeginning |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2699 |
"delete all changes from 1 to the current" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2700 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2701 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2702 |
self deleteChangesFrom:1 to:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2703 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2704 |
self autoSelectOrEnd:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2705 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2706 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2707 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2708 |
doDeleteRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2709 |
"delete all changes from current to the end" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2710 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2711 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2712 |
self deleteChangesFrom:changeNr to:(self numberOfChanges). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2713 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2714 |
self autoSelectOrEnd:changeNr-1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2715 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2716 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2717 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2718 |
doFileoutAndDeleteClassAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2719 |
"first fileOut the selected changes class then delete all changes |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2720 |
for it." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2721 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2722 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2723 |
| className class | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2724 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2725 |
className := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2726 |
className notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2727 |
class := Smalltalk classNamed:className. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2728 |
class notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2729 |
Class fileOutErrorSignal handle:[:ex | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2730 |
self warn:('fileout failed: ' , ex description). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2731 |
] do:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2732 |
class fileOut. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2733 |
self doDeleteClassAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2734 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2735 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2736 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2737 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2738 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2739 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2740 |
"Modified: 6.9.1995 / 17:11:16 / claus" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2741 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2742 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2743 |
doMakePatch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2744 |
"user wants a change to be made a patch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2745 |
- copy it over to the patches file" |
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 |
self withSelectedChangesDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2748 |
self makeChangeAPatch:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2749 |
self autoSelect:(changeNr + 1) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2750 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2751 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2752 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2753 |
doMakePermanent |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2754 |
"user wants a change to be made permanent |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2755 |
- rewrite the source file where this change has to go" |
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 |
|yesNoBox| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2758 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2759 |
self checkSingleSelectedChange. |
11499
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 |
yesNoBox := YesNoBox new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2762 |
yesNoBox title:(resources string:'Warning: this operation cannot be undone'). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2763 |
yesNoBox okText:(resources string:'continue') noText:(resources string:'abort'). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2764 |
yesNoBox okAction:[ |changeNr| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2765 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2766 |
changeNr := self theSingleSelection. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2767 |
changeNr notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2768 |
self makeChangePermanent:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2769 |
self autoSelect:(changeNr + 1) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2770 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2771 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2772 |
yesNoBox showAtPointer. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2773 |
yesNoBox destroy |
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 |
"Modified: 7.1.1997 / 23:03:33 / cg" |
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 |
doSave |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2779 |
"user wants a change to be appended to a file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2780 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2781 |
|fileName| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2782 |
|
13651 | 2783 |
fileName := Dialog |
2784 |
requestFileNameForSave:(resources string:'Append change to:') |
|
2785 |
default:(lastSaveFileName ? '') |
|
2786 |
ok:(resources string:'Append') |
|
2787 |
abort:(resources string:'Abort') |
|
2788 |
pattern:'*.chg'. |
|
2789 |
fileName isEmptyOrNil ifTrue:[ |
|
2790 |
^ self |
|
2791 |
]. |
|
2792 |
lastSaveFileName := fileName. |
|
2793 |
||
2794 |
self withWriteCursorDo:[ |
|
2795 |
self withSelectedChangesDo:[:changeNr | |
|
2796 |
self appendChange:changeNr toFile:fileName. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2797 |
self autoSelect:(changeNr + 1) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2798 |
]. |
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 |
|
11685 | 2801 |
"Modified: / 27-07-2012 / 09:46:14 / cg" |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2802 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2803 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2804 |
doSaveClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2805 |
"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
|
2806 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2807 |
self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2808 |
self doSaveClassFrom: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 |
doSaveClassAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2812 |
"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
|
2813 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2814 |
self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2815 |
self doSaveClassFrom:1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2816 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2817 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2818 |
doSaveClassFrom:startNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2819 |
"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
|
2820 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2821 |
|changeNr classNameToSave| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2822 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2823 |
changeNr := self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2824 |
classNameToSave := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2825 |
classNameToSave notNil ifTrue:[ |
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2826 |
self saveClass:classNameToSave from:startNr |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2827 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2828 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2829 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2830 |
doSaveClassRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2831 |
"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
|
2832 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2833 |
|changeNr| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2834 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2835 |
changeNr := self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2836 |
self doSaveClassFrom:changeNr. |
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 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2839 |
"/ self changeSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2840 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2841 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2842 |
doSaveRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2843 |
"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
|
2844 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2845 |
|changeNr fileName| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2846 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2847 |
(changeNr := self theSingleSelection) isNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2848 |
^ self information:(resources string:'Only possible if a single change is selected.'). |
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2851 |
fileName := Dialog |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2852 |
requestFileNameForSave:(resources string:'Append changes to:') |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2853 |
default:(lastSaveFileName ? '') |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2854 |
ok:(resources string:'Append') |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2855 |
abort:(resources string:'Abort') |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2856 |
pattern:'*.chg'. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2857 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2858 |
fileName notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2859 |
lastSaveFileName := fileName. |
11685 | 2860 |
self withWriteCursorDo:[ |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2861 |
changeNr to:(self numberOfChanges) do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2862 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2863 |
(self appendChange:changeNr toFile:fileName) ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2864 |
^ self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2865 |
] |
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 |
|
11685 | 2870 |
"Modified: / 27-07-2012 / 09:46:09 / cg" |
11499
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2873 |
doUpdate |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2874 |
"reread the changes-file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2875 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2876 |
self readChangesFileInBackground:true. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2877 |
self newLabel:''. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2878 |
realized ifTrue:[ |
18059 | 2879 |
self updateChangeList. |
11499
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 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2882 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2883 |
doWriteBack |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2884 |
"write back the list onto the changes file" |
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 |
anyChanges ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2887 |
(self writeBackChanges) ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2888 |
realized ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2889 |
self readChangesFile. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2890 |
realized ifTrue:[ |
18059 | 2891 |
self updateChangeList |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2892 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2893 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2894 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2895 |
] |
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 |
"Modified: 5.9.1996 / 17:19:46 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2898 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2899 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2900 |
findClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2901 |
"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
|
2902 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2903 |
|current| |
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 |
changeNrShown notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2906 |
current := self classNameOfChange:changeNrShown. |
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2909 |
self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2910 |
askForSearch:'Class to search for:' |
17394 | 2911 |
initialAnswer:(current ? lastSearchString) |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2912 |
thenSearchUsing:[:searchString :changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2913 |
|thisClassName| |
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 |
thisClassName := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2916 |
thisClassName notNil |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2917 |
and:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2918 |
(thisClassName sameAs: searchString) |
13440 | 2919 |
or:[searchString includesMatchCharacters and:[searchString match:thisClassName caseSensitive:false]]] |
11499
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 |
onCancel:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2922 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2923 |
lastSearchType := #class. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2924 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
17382 | 2925 |
|
17394 | 2926 |
"Modified: / 12-02-2017 / 11:31:47 / cg" |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2927 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2928 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2929 |
findFirstForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2930 |
"findNextForClass menu action: select the next change for the selected changes class" |
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 |
self findNextForClassStartingAt:1 |
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 |
"Created: / 20-11-2006 / 16:37:56 / cg" |
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 |
|
15674 | 2937 |
findFirstForClass:className |
2938 |
"findNextForClass menu action: select the next change for the selected changes class" |
|
2939 |
||
2940 |
self findNextForClass:className startingAt:1 |
|
2941 |
! |
|
2942 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2943 |
findLastForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2944 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2945 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2946 |
self findPreviousForClassStartingAt:(self numberOfChanges) |
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 |
"Created: / 20-11-2006 / 16:39:15 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2949 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2950 |
|
15674 | 2951 |
findLastForClass:className |
2952 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
|
2953 |
||
2954 |
self findPreviousForClass:className startingAt:(self numberOfChanges) |
|
2955 |
||
2956 |
"Created: / 20-11-2006 / 16:39:15 / cg" |
|
2957 |
! |
|
2958 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2959 |
findLastSnapshot |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2960 |
"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
|
2961 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2962 |
"/ lastSearchType := #snapshot. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2963 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2964 |
self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2965 |
findPreviousForWhich: [:changeNr | self changeIsSnapShotInfo:changeNr ] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2966 |
startingAt:(self numberOfChanges) |
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 |
"Created: / 06-10-2006 / 11:03:39 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2969 |
! |
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 |
findNext |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2972 |
"findNext menu action: select the next change. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2973 |
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
|
2974 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2975 |
lastSearchType == #selector ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2976 |
^ self findNextForSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2977 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2978 |
lastSearchType == #snapshot ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2979 |
^ self findNextSnapshot |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2980 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2981 |
lastSearchType == #string ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2982 |
^ self findNextForString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2983 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2984 |
lastSearchType == #difference ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2985 |
^ self findNextDifference |
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2988 |
^ self findNextForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2989 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2990 |
"Created: / 18.6.1998 / 22:15:00 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2991 |
"Modified: / 18.6.1998 / 22:15:25 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2992 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2993 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2994 |
findNextDifference |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2995 |
lastSearchType := #difference. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2996 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2997 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2998 |
self findNextForWhich:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2999 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3000 |
"/ same |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3001 |
false |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3002 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3003 |
"/ different |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3004 |
true |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3005 |
] |
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 |
! |
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 |
findNextForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3010 |
"findNextForClass menu action: select the next change for the selected changes class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3011 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3012 |
self findNextForClassStartingAt: changeNrShown + 1 |
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 |
"Modified: / 20-11-2006 / 16:37:49 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3015 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3016 |
|
15674 | 3017 |
findNextForClass:className startingAt:startNr |
3018 |
"findNextForClass menu action: select the next change for the selected changes class" |
|
3019 |
||
3020 |
lastSearchType := #class. |
|
3021 |
||
3022 |
self |
|
3023 |
findNextForWhich:[:changeNr | |
|
3024 |
|thisClass| |
|
3025 |
||
3026 |
thisClass := self classNameOfChange:changeNr. |
|
3027 |
(thisClass = className |
|
3028 |
or:[className includesMatchCharacters |
|
3029 |
and:[className match:thisClass]])] |
|
3030 |
startingAt:startNr |
|
3031 |
! |
|
3032 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3033 |
findNextForClassStartingAt:startNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3034 |
"findNextForClass menu action: select the next change for the selected changes class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3035 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3036 |
|cls| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3037 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3038 |
lastSearchType := #class. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3039 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3040 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3041 |
cls := self classNameOfChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3042 |
cls isNil ifTrue:[^ self]. |
15674 | 3043 |
self findNextForClass:cls startingAt:startNr. |
11499
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 |
"Created: / 20-11-2006 / 16:37:37 / cg" |
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 |
findNextForSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3049 |
"findNextForSelector menu action: select the next change for the selected changes selector" |
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 |
|sel| |
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 |
lastSearchType := #selector. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3054 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3055 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3056 |
sel := self selectorOfMethodChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3057 |
sel isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3058 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3059 |
self findNextForWhich: [:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3060 |
|thisSelector| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3061 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3062 |
thisSelector := self selectorOfMethodChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3063 |
(thisSelector = sel or:[sel includesMatchCharacters and:[sel match:thisSelector]]) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3064 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3065 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3066 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3067 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3068 |
findNextForString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3069 |
lastSearchString isNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3070 |
^ self findString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3071 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3072 |
self findNextWithString:lastSearchString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3073 |
! |
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 |
findNextForWhich:aBlock |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3076 |
"helper: select the next change for which aBlock evaluates to true" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3077 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3078 |
^ self findNextForWhich:aBlock startingAt:changeNrShown + 1 |
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 |
"Modified: / 20-11-2006 / 16:34:23 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3081 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3082 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3083 |
findNextForWhich:aBlock startingAt:changeNrToStartSearch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3084 |
"helper: select the next change for which aBlock evaluates to true" |
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 |
^ self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3087 |
findNextOrPrevious:#next |
18059 | 3088 |
forWhich:aBlock |
3089 |
startingAt:changeNrToStartSearch |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3090 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3091 |
"Created: / 20-11-2006 / 16:34:06 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3092 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3093 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3094 |
findNextOrPrevious:direction forWhich:aBlock startingAt:changeNrToStartSearch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3095 |
"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
|
3096 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3097 |
self withCursor:Cursor questionMark do:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3098 |
Object userInterruptSignal handle:[:ex | |
17941 | 3099 |
self beepInEditor. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3100 |
^ 0 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3101 |
] do:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3102 |
|increment nr lastNr| |
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 |
increment := (direction == #previous) ifTrue:[-1] ifFalse:[1]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3105 |
lastNr := self numberOfChanges. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3106 |
nr := changeNrToStartSearch. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3107 |
[ (direction == #previous and:[nr >= 1]) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3108 |
or:[ direction == #next and:[ nr <= lastNr]] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3109 |
] whileTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3110 |
(aBlock value:nr) ifTrue:[ |
18059 | 3111 |
self selectChange:nr. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3112 |
^ nr |
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 |
nr := nr + increment. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3115 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3116 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3117 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3118 |
self showNotFound. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3119 |
self windowGroup sensor flushKeyboard. "/ avoid multiple beeps, in case of type ahead |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3120 |
^ 0 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3121 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3122 |
"Created: / 08-03-2012 / 11:57:26 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3123 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3124 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3125 |
findNextSnapshot |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3126 |
"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
|
3127 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3128 |
lastSearchType := #snapshot. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3129 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3130 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3131 |
self findNextForWhich: [:changeNr | self changeIsSnapShotInfo:changeNr ] |
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3134 |
findNextWithString:searchString |
14939 | 3135 |
|includesMatchCharacters| |
3136 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3137 |
lastSearchType := #string. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3138 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3139 |
lastSearchString := searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3140 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3141 |
changeNrShown isNil ifTrue:[ |
14939 | 3142 |
changeNrShown := 0. |
3143 |
]. |
|
3144 |
||
3145 |
includesMatchCharacters := searchString includesMatchCharacters. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3146 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3147 |
self findNextForWhich: |
14939 | 3148 |
[:changeNr | |
3149 |
|s| |
|
3150 |
||
3151 |
s := self sourceOfMethodChange:changeNr. |
|
3152 |
s notNil and:[ |
|
3153 |
(includesMatchCharacters not and:[(s findString:searchString) ~~ 0]) |
|
3154 |
or:[ includesMatchCharacters and:[('*' , searchString , '*') match:s ]]] |
|
3155 |
]. |
|
11499
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 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3158 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3159 |
codeView setSearchPattern:searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3160 |
codeView |
14939 | 3161 |
searchFwd:searchString |
3162 |
ignoreCase:false |
|
3163 |
startingAtLine:1 col:0 |
|
3164 |
ifAbsent:nil. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3165 |
! |
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 |
findPrevious |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3168 |
"findPrevious menu action: select the previous change. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3169 |
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
|
3170 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3171 |
lastSearchType == #selector ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3172 |
^ self findPreviousForSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3173 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3174 |
lastSearchType == #snapshot ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3175 |
^ self findPreviousSnapshot |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3176 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3177 |
lastSearchType == #string ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3178 |
^ self findPreviousForString |
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 |
lastSearchType == #difference ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3181 |
^ self findPreviousDifference |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3182 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3183 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3184 |
^ self findPreviousForClass |
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 |
"Created: / 18.6.1998 / 22:15:15 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3187 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3188 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3189 |
findPreviousDifference |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3190 |
lastSearchType := #difference. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3191 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3192 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3193 |
self findPreviousForWhich:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3194 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3195 |
"/ same |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3196 |
false |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3197 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3198 |
"/ different |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3199 |
true |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3200 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3201 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3202 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3203 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3204 |
findPreviousForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3205 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3206 |
|
12738 | 3207 |
self findPreviousForClassStartingAt:((changeNrShown ? 1) - 1) |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3208 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3209 |
"Modified: / 20-11-2006 / 16:39:04 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3210 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3211 |
|
15674 | 3212 |
findPreviousForClass:className startingAt:startNr |
3213 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
|
3214 |
||
3215 |
lastSearchType := #class. |
|
3216 |
||
3217 |
self |
|
3218 |
findPreviousForWhich: |
|
3219 |
[:changeNr | |
|
3220 |
|thisClass| |
|
3221 |
||
3222 |
thisClass := self classNameOfChange:changeNr. |
|
3223 |
(thisClass = className |
|
3224 |
or:[className includesMatchCharacters |
|
3225 |
and:[className match:thisClass]])] |
|
3226 |
startingAt:startNr |
|
3227 |
! |
|
3228 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3229 |
findPreviousForClassStartingAt:startNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3230 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
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 |
|cls| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3233 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3234 |
lastSearchType := #class. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3235 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3236 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3237 |
cls := self classNameOfChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3238 |
cls isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3239 |
|
15674 | 3240 |
self findPreviousForClass:cls startingAt:startNr |
11499
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 |
"Created: / 20-11-2006 / 16:38:37 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3243 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3244 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3245 |
findPreviousForSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3246 |
"findPreviousForSelector menu action: select the previous change for the selected changes selector" |
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 |
|sel| |
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 |
lastSearchType := #selector. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3251 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3252 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3253 |
sel := self selectorOfMethodChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3254 |
sel isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3255 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3256 |
self findPreviousForWhich: |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3257 |
[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3258 |
|thisSelector| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3259 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3260 |
thisSelector := self selectorOfMethodChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3261 |
(thisSelector = sel |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3262 |
or:[sel includesMatchCharacters and:[sel match:thisSelector]]) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3263 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3264 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3265 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3266 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3267 |
findPreviousForString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3268 |
lastSearchString isNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3269 |
^ self findString |
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 |
self findPreviousWithString:lastSearchString |
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3274 |
findPreviousForWhich:aBlock |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3275 |
"helper: select the previous change for which aBlock evaluates to true" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3276 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3277 |
^ self findPreviousForWhich:aBlock startingAt:(changeNrShown - 1) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3278 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3279 |
"Modified: / 06-10-2006 / 11:01:38 / cg" |
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3282 |
findPreviousForWhich:aBlock startingAt:changeNrToStartSearch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3283 |
"helper: select the previous change for which aBlock evaluates to true" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3284 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3285 |
^ self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3286 |
findNextOrPrevious:#previous |
18059 | 3287 |
forWhich:aBlock |
3288 |
startingAt:changeNrToStartSearch |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3289 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3290 |
"Created: / 06-10-2006 / 11:01:09 / cg" |
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 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3293 |
findPreviousSnapshot |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3294 |
"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
|
3295 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3296 |
lastSearchType := #snapshot. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3297 |
changeNrShown isNil ifTrue:[^ self]. |
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 |
self findPreviousForWhich: [:changeNr | self changeIsSnapShotInfo:changeNr ] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3300 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3301 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3302 |
findPreviousWithString:searchString |
14939 | 3303 |
|includesMatchCharacters| |
3304 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3305 |
lastSearchType := #string. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3306 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3307 |
lastSearchString := searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3308 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3309 |
changeNrShown isNil ifTrue:[ |
14939 | 3310 |
changeNrShown := 0. |
3311 |
]. |
|
3312 |
||
3313 |
includesMatchCharacters := searchString includesMatchCharacters. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3314 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3315 |
self findPreviousForWhich: |
14939 | 3316 |
[:changeNr | |
3317 |
|s | |
|
3318 |
||
3319 |
s := self sourceOfMethodChange:changeNr. |
|
3320 |
s notNil and:[ |
|
3321 |
(includesMatchCharacters not and:[(s findString:searchString) ~~ 0]) |
|
3322 |
or:[includesMatchCharacters and:[('*' , searchString , '*') match:s ]]] |
|
3323 |
]. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3324 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3325 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3326 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3327 |
codeView setSearchPattern:searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3328 |
codeView |
14939 | 3329 |
searchFwd:searchString |
3330 |
ignoreCase:false |
|
3331 |
startingAtLine:1 col:0 |
|
3332 |
ifAbsent:nil. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3333 |
! |
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 |
findSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3336 |
"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
|
3337 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3338 |
|current| |
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 |
changeNrShown notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3341 |
current := self selectorOfMethodChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3342 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3343 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3344 |
self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3345 |
askForSearch:'Selector to search for:' |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3346 |
initialAnswer:current |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3347 |
thenSearchUsing:[:searchString :changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3348 |
|thisSelector| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3349 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3350 |
thisSelector := self selectorOfMethodChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3351 |
(thisSelector = searchString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3352 |
or:[searchString includesMatchCharacters and:[searchString match:thisSelector]]) |
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 |
onCancel:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3355 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3356 |
lastSearchType := #selector. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3357 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3358 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3359 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3360 |
findString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3361 |
|searchString directionHolder| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3362 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3363 |
lastSearchType := #string. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3364 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3365 |
searchString := codeView selection. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3366 |
searchString size == 0 ifTrue:[searchString := lastSearchString]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3367 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3368 |
searchString := self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3369 |
askForSearchString:'String to search for:' |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3370 |
initialAnswer:(searchString ? '') |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3371 |
directionInto:(directionHolder := ValueHolder new). |
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 |
searchString size == 0 ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3374 |
^ self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3375 |
]. |
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 |
directionHolder value == #backward ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3378 |
self findPreviousWithString:searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3379 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3380 |
self findNextWithString:searchString. |
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 |
|
10719 | 3384 |
ignorePublicPrivateCategories:aBoolean |
3385 |
UserPreferences current ignorePublicPrivateCategories:aBoolean |
|
3386 |
||
3387 |
"Created: / 23-09-2011 / 19:52:21 / cg" |
|
3388 |
! |
|
3389 |
||
3202 | 3390 |
menuExit |
3204 | 3391 |
self closeRequest |
3202 | 3392 |
! |
3393 |
||
3394 |
openAboutThisApplication |
|
3395 |
"opens an about box for this application." |
|
3396 |
||
7115 | 3397 |
Dialog aboutClass:self class. |
3398 |
||
3399 |
"Modified: / 12-09-2006 / 17:20:22 / cg" |
|
3202 | 3400 |
! |
3401 |
||
3402 |
openHTMLDocument:relativeDocPath |
|
3403 |
HTMLDocumentView openFullOnDocumentationFile:relativeDocPath |
|
3404 |
! |
|
3405 |
||
9055 | 3406 |
openSettingsDialog |
14558 | 3407 |
|settingsList| |
9055 | 3408 |
|
3409 |
settingsList := |
|
3410 |
#( |
|
3411 |
#('Editor' #'AbstractSettingsApplication::EditSettingsAppl' ) |
|
3412 |
"/ #('Syntax Color' #'AbstractSettingsApplication::SyntaxColorSettingsAppl' ) |
|
3413 |
"/ #('Code Format' #'AbstractSettingsApplication::SourceCodeFormatSettingsAppl' ) |
|
3414 |
"/ #('System Browser' #'AbstractSettingsApplication::SystemBrowserSettingsAppl' ) |
|
3415 |
#('Compiler' #'AbstractSettingsApplication::GeneralCompilerSettingsAppl' ) |
|
3416 |
#('Compiler/ByteCode' #'AbstractSettingsApplication::ByteCodeCompilerSettingsAppl' ) |
|
3417 |
"/ #('Source Code Management' #'AbstractSettingsApplication::SourceCodeManagementSettingsAppl') |
|
3418 |
). |
|
3419 |
||
14558 | 3420 |
SettingsDialog |
3421 |
openWithList:settingsList |
|
3422 |
label:(resources string:'Change Browser Settings'). |
|
9055 | 3423 |
! |
3424 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3425 |
setEnforcedNameSpace |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3426 |
|nsName listOfKnownNameSpaces keepAsDefaultHolder| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3427 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3428 |
listOfKnownNameSpaces := Set new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3429 |
NameSpace |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3430 |
allNameSpaces |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3431 |
do:[:eachNameSpace | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3432 |
listOfKnownNameSpaces add:eachNameSpace name |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3433 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3434 |
listOfKnownNameSpaces := listOfKnownNameSpaces asOrderedCollection sort. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3435 |
|
15450 | 3436 |
Dialog modifyingBoxWith:[:box | |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3437 |
keepAsDefaultHolder := true asValue. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3438 |
box verticalPanel |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3439 |
add:((CheckBox |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3440 |
label:(resources string:'Use this as default in the future')) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3441 |
model:keepAsDefaultHolder). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3442 |
] do:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3443 |
nsName := Dialog |
15450 | 3444 |
request:(resources string:'When applying, new classes are created in nameSpace:') |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3445 |
initialAnswer:(enforcedNameSpace ? LastEnforcedNameSpace ? Class nameSpaceQuerySignal query name) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3446 |
list:listOfKnownNameSpaces. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3447 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3448 |
nsName isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3449 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3450 |
(nsName isEmpty or:[nsName = 'Smalltalk']) ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3451 |
applyInOriginalNameSpace value:true. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3452 |
LastEnforcedNameSpace := enforcedNameSpace := nil. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3453 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3454 |
applyInOriginalNameSpace value:false. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3455 |
LastEnforcedNameSpace := enforcedNameSpace := NameSpace name:nsName. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3456 |
autoCompare value ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3457 |
self doUpdate |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3458 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3459 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3460 |
KeepEnforcedNameSpace := keepAsDefaultHolder value. |
11680
5b1a15736f97
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11499
diff
changeset
|
3461 |
codeView nameSpaceForDoits:enforcedNameSpace. |
5b1a15736f97
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11499
diff
changeset
|
3462 |
diffView textViews do:[:each | each nameSpaceForDoits:enforcedNameSpace]. |
5b1a15736f97
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11499
diff
changeset
|
3463 |
|
5b1a15736f97
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11499
diff
changeset
|
3464 |
"Modified: / 26-07-2012 / 23:06:23 / cg" |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3465 |
! |
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 |
setEnforcedPackage |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3468 |
|pkg listOfKnownPackages| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3469 |
|
16207 | 3470 |
listOfKnownPackages := Smalltalk allPackageIDs. |
12645 | 3471 |
"/ Smalltalk allClassesDo:[:eachClass | |
3472 |
"/ |package| |
|
3473 |
"/ |
|
3474 |
"/ package := eachClass package. |
|
3475 |
"/ package size > 0 ifTrue:[ |
|
3476 |
"/ listOfKnownPackages add:package |
|
3477 |
"/ ] |
|
3478 |
"/ ]. |
|
3479 |
listOfKnownPackages := listOfKnownPackages asNewOrderedCollection sort. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3480 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3481 |
pkg := Dialog |
12645 | 3482 |
request:'When applying, changes go into package:' |
3483 |
initialAnswer:(enforcedPackage ? Class packageQuerySignal query) |
|
3484 |
list:listOfKnownPackages. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3485 |
pkg size ~~ 0 ifTrue:[ |
12645 | 3486 |
enforcedPackage := pkg |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3487 |
] |
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 |
|
3202 | 3490 |
showAboutSTX |
3491 |
ToolApplicationModel openAboutSTX |
|
3492 |
! ! |
|
3493 |
||
202 | 3494 |
!ChangesBrowser methodsFor:'private'! |
3495 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3496 |
autoSelect:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3497 |
"select a change" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3498 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3499 |
self class autoSelectNext ifTrue:[ |
18059 | 3500 |
(changeNr <= self numberOfChanges) ifTrue:[ |
3501 |
self selectChange:changeNr. |
|
3502 |
^ self |
|
3503 |
] |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3504 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3505 |
self clearCodeView. |
18059 | 3506 |
self unselect. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3507 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3508 |
"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
|
3509 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3510 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3511 |
autoSelectLast |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3512 |
"select the last change" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3513 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3514 |
self autoSelect:(self numberOfChanges) |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3515 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3516 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3517 |
autoSelectOrEnd:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3518 |
"select the next change or the last" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3519 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3520 |
|last| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3521 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3522 |
last := self numberOfChanges. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3523 |
changeNr < last ifTrue:[ |
18059 | 3524 |
self autoSelect:changeNr |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3525 |
] ifFalse:[ |
18059 | 3526 |
last == 0 ifTrue:[ |
3527 |
last := nil |
|
3528 |
]. |
|
3529 |
self selectChange:last. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3530 |
] |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3531 |
|
3406
8fe22b36fbc2
fixed autoselectNext if list is empty
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
3532 |
"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
|
3533 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3534 |
|
16372 | 3535 |
changeChunkAt:index |
3536 |
^ (changeInfoList at:index) chunk |
|
3537 |
"/ ^ changeChunks at:index |
|
3538 |
||
3539 |
"Created: / 01-05-2016 / 18:24:28 / cg" |
|
3540 |
! |
|
3541 |
||
3542 |
changeClassNameAt:index |
|
3543 |
^ (changeInfoList at:index) className |
|
3544 |
||
3545 |
"Created: / 01-05-2016 / 18:28:13 / cg" |
|
3546 |
"Modified: / 01-05-2016 / 19:32:42 / cg" |
|
3547 |
! |
|
3548 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3549 |
checkClassIsLoaded:aClass |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3550 |
"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
|
3551 |
|
6162
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
3552 |
|cls answer| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3553 |
|
3359
2cc7eff866e4
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
3341
diff
changeset
|
3554 |
cls := aClass theNonMetaclass. |
5825 | 3555 |
cls isLoaded ifTrue:[ |
6357 | 3556 |
^ true. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3557 |
]. |
11805 | 3558 |
(classesNotToBeAutoloaded includes:#all) ifTrue:[ |
3559 |
^ false. |
|
3560 |
]. |
|
8026
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3561 |
(classesNotToBeAutoloaded includes:cls) ifTrue:[ |
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3562 |
^ false. |
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3563 |
]. |
5825 | 3564 |
|
6216 | 3565 |
autoloadAsRequired value == true ifTrue:[ |
6357 | 3566 |
answer := true |
6216 | 3567 |
] ifFalse:[ |
11805 | 3568 |
answer := Dialog |
3569 |
confirmWithCancel:(resources |
|
17400 | 3570 |
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 | 3571 |
with:cls name allBold) |
3572 |
labels:(resources array:#('Cancel' 'No for All' 'No' 'Yes')) |
|
3573 |
values:#(nil #never false true) |
|
3574 |
default:4. |
|
3575 |
answer isNil ifTrue:[ |
|
3576 |
"cancel the operation" |
|
3577 |
AbortAllOperationRequest raise. |
|
3578 |
"not reached" |
|
3579 |
]. |
|
3580 |
answer == #never ifTrue:[ |
|
3581 |
classesNotToBeAutoloaded add:#all. |
|
3582 |
^ false. |
|
3583 |
]. |
|
8026
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3584 |
]. |
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3585 |
|
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3586 |
answer ifTrue:[ |
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3587 |
Autoload autoloadFailedSignal catch:[ |
6357 | 3588 |
^ cls autoload isLoaded |
3589 |
] |
|
5825 | 3590 |
]. |
6162
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
3591 |
|
8026
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3592 |
classesNotToBeAutoloaded add:cls. |
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3593 |
|
6162
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
3594 |
^ false. |
17400 | 3595 |
|
3596 |
"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
|
3597 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3598 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3599 |
checkSingleSelectedChange |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3600 |
"just a helper, check for a single selection" |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3601 |
|
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3602 |
|changeNr| |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3603 |
|
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3604 |
(changeNr := self theSingleSelection) isNil ifTrue:[ |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3605 |
self information:'Only possible if a single change is selected.'. |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3606 |
AbortSignal raise. |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3607 |
^ nil. |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3608 |
]. |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3609 |
^ changeNr |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3610 |
! |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3611 |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3612 |
classFromEvaluatingTree:aParseTree |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3613 |
|thisClass| |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3614 |
|
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3615 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3616 |
do:[ |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3617 |
thisClass := Parser undefinedVariableError handle:[:ex | ] do:[ aParseTree evaluate ]. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3618 |
]. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3619 |
^ thisClass |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3620 |
|
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3621 |
"Created: / 05-03-2012 / 14:28:01 / cg" |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3622 |
! |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3623 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3624 |
clearCodeView |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3625 |
"clear the (lower) code view." |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3626 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3627 |
self unselect "changeListView deselect". |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3628 |
codeView contents:nil. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3629 |
changeNrShown := nil |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3630 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3631 |
|
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3632 |
currentSourceForParseTree:parseTree |
12845 | 3633 |
|selector thisClass method mClass thisClassSym ownerClass receiver classGlobalNode| |
4857 | 3634 |
|
6288 | 3635 |
(parseTree isNil |
3636 |
or:[parseTree == #Error |
|
4857 | 3637 |
or:[ parseTree isMessage not ]]) ifTrue:[ |
6614 | 3638 |
^ nil |
4857 | 3639 |
]. |
3640 |
||
3641 |
selector := parseTree selector. |
|
3642 |
receiver := parseTree receiver. |
|
3643 |
||
3644 |
selector == #'removeSelector:' ifTrue:[ |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3645 |
thisClass := self classFromEvaluatingTree:receiver. |
6614 | 3646 |
thisClass isBehavior ifTrue:[ |
3647 |
thisClass isLoaded ifTrue:[ |
|
3648 |
selector := (parseTree arg1 evaluate). |
|
3649 |
(thisClass includesSelector:selector) ifTrue:[ |
|
3650 |
^ (thisClass compiledMethodAt:selector) source. |
|
3651 |
] |
|
3652 |
] ifFalse:[ |
|
3653 |
^ 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
3654 |
] |
|
3655 |
] ifFalse:[ |
|
3656 |
^ 'Cannot compare this change (class not present)'. |
|
3657 |
]. |
|
4857 | 3658 |
]. |
3659 |
selector == #'comment:' ifTrue:[ |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3660 |
thisClass := self classFromEvaluatingTree:receiver. |
6614 | 3661 |
thisClass isBehavior ifTrue:[ |
3662 |
thisClass isLoaded ifTrue:[ |
|
3663 |
^ thisClass name , ' comment: ' , thisClass comment storeString. |
|
3664 |
] ifFalse:[ |
|
3665 |
^ 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
3666 |
] |
|
3667 |
] ifFalse:[ |
|
3668 |
^ 'Cannot compare this change (class not present)'. |
|
3669 |
]. |
|
4857 | 3670 |
]. |
3671 |
||
7953 | 3672 |
(#(#'category:' #'package:') includes:selector) ifTrue:[ |
6614 | 3673 |
receiver isMessage ifTrue:[ |
3674 |
receiver selector == #compiledMethodAt: ifTrue:[ |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3675 |
"/ thisClass := self classFromEvaluatingTree:receiver receiver. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3676 |
"/ thisClass isNil ifTrue:[ |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3677 |
"/ ^ 'Class does not exist.'. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3678 |
"/ ]. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3679 |
|
6614 | 3680 |
classGlobalNode := receiver receiver. |
3681 |
(classGlobalNode isMessage and:[classGlobalNode selector == #class]) ifTrue:[ |
|
3682 |
classGlobalNode := classGlobalNode receiver |
|
3683 |
]. |
|
3684 |
classGlobalNode isUndeclared ifTrue:[ |
|
3685 |
^ 'Class does not exist.'. |
|
3686 |
]. |
|
3687 |
Error handle:[method := nil] do:[method := receiver evaluate]. |
|
7953 | 3688 |
method isMethod ifFalse:[ |
3689 |
^ 'There is no such method'. |
|
3690 |
]. |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3691 |
mClass := method mclass. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3692 |
|
7953 | 3693 |
selector == #category: ifTrue:[ |
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3694 |
"/ method category = parseTree arg1 evaluate ifFalse:[ |
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3695 |
^ '(' , mClass name , ' compiledMethodAt: ' , method selector storeString , ') category: ' , method category storeString. |
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3696 |
"/ ]. |
6614 | 3697 |
] ifFalse:[ |
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3698 |
"/ method package = parseTree arg1 evaluate ifFalse:[ |
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3699 |
^ '(' , mClass name , ' compiledMethodAt: ' , method selector storeString , ') package: ' , method package storeString. |
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3700 |
"/ ]. |
7953 | 3701 |
]. |
3702 |
^ nil |
|
6614 | 3703 |
] |
3704 |
] |
|
4857 | 3705 |
]. |
3706 |
||
3707 |
selector == #'instanceVariableNames:' ifTrue:[ |
|
6614 | 3708 |
receiver isMessage ifTrue:[ |
3709 |
receiver selector == #class ifTrue:[ |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3710 |
thisClass := self classFromEvaluatingTree:receiver. |
6614 | 3711 |
thisClass isBehavior ifTrue:[ |
3712 |
thisClass isLoaded ifTrue:[ |
|
4857 | 3713 |
"/ varsHere := thisClass instanceVariableString asCollectionOfWords. |
3714 |
"/ varsInChange := (parseTree arguments at:1) evaluate asCollectionOfWords. |
|
6614 | 3715 |
^ thisClass definition. |
3716 |
] ifFalse:[ |
|
3717 |
^ 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
3718 |
]. |
|
3719 |
] ifFalse:[ |
|
3720 |
^ 'Cannot compare this change (class not present)'. |
|
3721 |
] |
|
3722 |
]. |
|
3723 |
] |
|
4857 | 3724 |
]. |
3725 |
||
3726 |
(Class definitionSelectors includes:selector) |
|
6288 | 3727 |
"/ selector == #'subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:' |
4857 | 3728 |
ifTrue:[ |
6614 | 3729 |
"/ Class nameSpaceQuerySignal |
3730 |
"/ answer:(self nameSpaceForApply) |
|
3731 |
"/ do:[ |
|
3732 |
"/ superClass := receiver evaluate. |
|
3733 |
"/ ]. |
|
3734 |
"/ superClass isBehavior ifFalse:[ |
|
3735 |
"/ self nameSpaceForApply classNamed:receiver name |
|
3736 |
"/ ]. |
|
3737 |
"/ superClass isBehavior ifFalse:[ |
|
3738 |
"/ |rest matchingKeys superClassName| |
|
3739 |
"/ |
|
3740 |
"/ rest := '::' , receiver name. |
|
3741 |
"/ matchingKeys := Smalltalk keys select:[:nm | nm endsWith:rest]. |
|
3742 |
"/ superClassName := Dialog choose:'Which Class ?' fromList:matchingKeys lines:10. |
|
3743 |
"/ superClassName notEmptyOrNil ifTrue:[ |
|
3744 |
"/ superClass := Smalltalk at:superClassName asSymbol. |
|
3745 |
"/ ]. |
|
3746 |
"/ ]. |
|
3747 |
"/ superClass isBehavior ifFalse:[ |
|
3748 |
"/ ^ 'Cannot compare this change\\(no such superclass).' withCRs. |
|
3749 |
"/ ]. |
|
3750 |
"/ superClass isLoaded ifFalse:[ |
|
3751 |
"/ ^ 'Cannot compare this change\\(superclass not loaded).' withCRs. |
|
3752 |
"/ ]. |
|
3753 |
||
3754 |
thisClassSym := (parseTree arguments at:1) evaluate. |
|
3755 |
||
3756 |
(selector endsWith:':privateIn:') ifTrue:[ |
|
3757 |
ownerClass := (parseTree arguments at:5). |
|
3758 |
ownerClass isUndeclared ifFalse:[ |
|
3759 |
ownerClass := ownerClass evaluate. |
|
3760 |
] ifTrue:[ |
|
3761 |
ownerClass := nil. |
|
3762 |
]. |
|
3763 |
ownerClass isNil ifTrue:[ |
|
3764 |
^ 'Cannot compare this change\\(owning class is not loaded).' withCRs. |
|
3765 |
]. |
|
3766 |
thisClass := ownerClass privateClassesAt:thisClassSym. |
|
3767 |
] ifFalse:[ |
|
3768 |
thisClass := (self nameSpaceForApply) at:thisClassSym ifAbsent:nil. |
|
3769 |
]. |
|
3770 |
thisClass notNil ifTrue:[ |
|
3771 |
thisClass isLoaded ifFalse:[ |
|
3772 |
^ 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
3773 |
] ifTrue:[ |
|
3774 |
^ thisClass definition. |
|
3775 |
] |
|
3776 |
] |
|
4857 | 3777 |
]. |
3778 |
||
3779 |
^ nil. |
|
9570
f81993219003
changed: #oldSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
9548
diff
changeset
|
3780 |
|
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3781 |
"Created: / 15-02-2012 / 15:11:15 / cg" |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3782 |
! |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3783 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3784 |
isChangeSetBrowser |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3785 |
^ false |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3786 |
! |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3787 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3788 |
makeDiffViewInvisible |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3789 |
diffViewBox lower |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3790 |
! |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3791 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3792 |
makeDiffViewVisible |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3793 |
diffViewBox raise |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3794 |
! |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3795 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3796 |
nameSpaceForApply |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3797 |
applyInOriginalNameSpace value ifFalse:[ |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3798 |
^ enforcedNameSpace ? Class nameSpaceQuerySignal query. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3799 |
]. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3800 |
^ Smalltalk. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3801 |
! |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3802 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3803 |
newLabel:how |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3804 |
|l| |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3805 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3806 |
l := self class defaultLabel. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3807 |
(changeFileName notNil and:[changeFileName ~= 'changes']) ifTrue:[ |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3808 |
l := l , ': ', changeFileName |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3809 |
]. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3810 |
l := l , ' ' , how. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3811 |
self label:l |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3812 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3813 |
"Created: / 08-09-1995 / 19:32:04 / claus" |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3814 |
"Modified: / 12-11-2006 / 16:23:53 / cg" |
4857 | 3815 |
! |
3816 |
||
8665 | 3817 |
parseExpression:chunk |
18059 | 3818 |
"parse an expression; return a parseTree" |
3819 |
||
8665 | 3820 |
^ self parseExpression:chunk inNameSpace:(self nameSpaceForApply). |
3821 |
! |
|
3822 |
||
3823 |
parseExpression:text inNameSpace:nameSpace |
|
18059 | 3824 |
"parse an expression; return a parseTree" |
3825 |
||
3826 |
|parser parseTree| |
|
8665 | 3827 |
|
3828 |
"/ old: |
|
3829 |
"/ does not care for VW qualified names |
|
3830 |
"/ ^ Parser parseExpression:text inNameSpace:nameSpace. |
|
3831 |
||
18596 | 3832 |
(text includesString:'§') ifTrue:[ |
18054 | 3833 |
self halt:'should no longer happen' |
3834 |
]. |
|
17094 | 3835 |
|
8665 | 3836 |
"/ new: |
3837 |
parser := Parser for:(ReadStream on:text). |
|
18059 | 3838 |
parser parserFlags |
3839 |
allowQualifiedNames:true; |
|
3840 |
allowDollarInIdentifier:true; |
|
3841 |
allowParagraphInIdentifier:true. |
|
3842 |
||
9228
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3843 |
Error handle:[:ex | |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3844 |
^ nil |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3845 |
] do:[ |
18059 | 3846 |
parseTree := parser |
9228
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3847 |
parseExpressionWithSelf:nil |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3848 |
notifying:nil |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3849 |
ignoreErrors:true |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3850 |
ignoreWarnings:true |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3851 |
inNameSpace:nameSpace. |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3852 |
]. |
18059 | 3853 |
^ parseTree |
17094 | 3854 |
|
3855 |
"Modified: / 21-11-2016 / 23:25:48 / cg" |
|
8665 | 3856 |
! |
3857 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3858 |
queryCloseText |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3859 |
"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
|
3860 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3861 |
^ 'Quit without updating changeFile ?' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3862 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3863 |
|
18059 | 3864 |
selectChange:changeNr |
3865 |
changeListView setSelection:changeNr. |
|
3866 |
self changeSelection:changeNr. |
|
3867 |
! |
|
3868 |
||
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3869 |
selectedClassNames |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3870 |
|classes| |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3871 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3872 |
classes := Set new. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3873 |
self withSelectedChangesDo:[:changeNr | |
6288 | 3874 |
| classNameToCompress | |
3875 |
||
3876 |
classNameToCompress := self classNameOfChange:changeNr. |
|
3877 |
classNameToCompress notNil ifTrue:[ |
|
3878 |
classes add:classNameToCompress. |
|
3879 |
] |
|
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3880 |
]. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3881 |
^ classes |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3882 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3883 |
"Created: / 19.11.2001 / 21:54:59 / cg" |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3884 |
! |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3885 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3886 |
setChangeList |
18059 | 3887 |
<resource: #obsolete> |
16467 | 3888 |
"update the selection-list; |
3889 |
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
|
3890 |
|
18059 | 3891 |
self updateChangeList |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3892 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3893 |
|
3211 | 3894 |
setSingleSelection:changeNr |
3895 |
changeListView multipleSelectOk ifFalse:[ |
|
6288 | 3896 |
changeListView setSelection:changeNr. |
3211 | 3897 |
] ifTrue:[ |
6288 | 3898 |
changeListView setSelection:(Array with:changeNr). |
3211 | 3899 |
]. |
3900 |
! |
|
3901 |
||
16467 | 3902 |
showNumberOfChanges |
3903 |
infoHolder value:(resources string:'%1 changes.' with:changeInfoList size). |
|
3904 |
! |
|
3905 |
||
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3906 |
sourceOfChange:changeNr |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3907 |
|aStream sawExcla chunk| |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3908 |
|
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3909 |
aStream := self streamForChange:changeNr. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3910 |
aStream isNil ifTrue:[ |
6288 | 3911 |
^ nil |
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3912 |
]. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3913 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3914 |
chunk := aStream nextChunk. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3915 |
sawExcla ifTrue:[ |
6288 | 3916 |
chunk := aStream nextChunk |
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3917 |
]. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3918 |
aStream close. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3919 |
^ chunk |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3920 |
! |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3921 |
|
12599
827681c8f7d4
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
3922 |
timeStampPrintStringOf:ts |
827681c8f7d4
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
3923 |
^ ts printString |
17838 | 3924 |
|
3925 |
" |
|
3926 |
self basicNew timeStampPrintStringOf:(Timestamp now) |
|
3927 |
" |
|
3928 |
||
3929 |
"Modified (format): / 05-12-2017 / 15:08:48 / cg" |
|
12599
827681c8f7d4
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
3930 |
! |
827681c8f7d4
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
3931 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3932 |
unselect |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3933 |
"common unselect" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3934 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3935 |
changeListView setSelection:nil. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3936 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3937 |
"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
|
3938 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3939 |
|
18059 | 3940 |
updateChangeList |
3941 |
"update the selection-list; |
|
3942 |
called after the changeList has been modified" |
|
3943 |
||
3944 |
|headerList| |
|
3945 |
||
3946 |
headerList := changeInfoList collect:[:info | info headerLine]. |
|
3947 |
changeListView setList:headerList expandTabs:false redraw:false. |
|
3948 |
changeListView invalidate. |
|
3949 |
self showNumberOfChanges. |
|
3950 |
||
3951 |
"/ changeListView deselect. |
|
3952 |
||
3953 |
"Modified: / 01-05-2016 / 19:27:35 / cg" |
|
3954 |
! |
|
3955 |
||
3211 | 3956 |
withSelectedChangesDo:aBlock |
3957 |
"just a helper, check for a selected change and evaluate aBlock |
|
3958 |
with busy cursor" |
|
3959 |
||
3960 |
self withSelectedChangesInOrder:nil do:aBlock |
|
3961 |
! |
|
3962 |
||
3963 |
withSelectedChangesInOrder:order do:aBlock |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3964 |
"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
|
3965 |
with busy cursor" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3966 |
|
3211 | 3967 |
|changeNrSelection| |
3968 |
||
3969 |
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
|
3970 |
|
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3971 |
"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
|
3972 |
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
|
3973 |
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
|
3974 |
|
3211 | 3975 |
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
|
3976 |
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
|
3977 |
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
|
3978 |
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
|
3979 |
] |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3980 |
] |
3211 | 3981 |
] 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
|
3982 |
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
|
3983 |
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
|
3984 |
|changeNumbers| |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3985 |
|
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3986 |
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
|
3987 |
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
|
3988 |
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
|
3989 |
]. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3990 |
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
|
3991 |
] |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3992 |
] |
3211 | 3993 |
]. |
3994 |
! |
|
3995 |
||
3996 |
withSelectedChangesReverseDo:aBlock |
|
3997 |
"just a helper, check for a selected change and evaluate aBlock |
|
3998 |
with busy cursor" |
|
3999 |
||
4000 |
self withSelectedChangesInOrder:#reverse do:aBlock |
|
3668 | 4001 |
! |
4002 |
||
4003 |
withSingleSelectedChangeDo:aBlock |
|
4004 |
"just a helper, check for a single selection, and evaluate aBlock |
|
4005 |
with busy cursor" |
|
4006 |
||
4007 |
self theSingleSelection isNil ifTrue:[ |
|
6288 | 4008 |
^ self information:'Only possible if a single change is selected.'. |
3668 | 4009 |
]. |
4010 |
||
4011 |
self withSelectedChangesInOrder:nil do:aBlock |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4012 |
! ! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4013 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4014 |
!ChangesBrowser methodsFor:'private-change access'! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4015 |
|
18596 | 4016 |
changeIsCheckinInfo:changeNr |
4017 |
"return true, if a change is a snapShot info chunk" |
|
4018 |
||
4019 |
^ self changeIsSpecialInfo:changeNr anyOf:#('checkin') |
|
4020 |
||
4021 |
"Created: / 15-02-2019 / 11:44:33 / Claus Gittinger" |
|
4022 |
! |
|
4023 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4024 |
changeIsFollowupMethodChange:changeNr |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4025 |
"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
|
4026 |
in a bunch of methodsFor-changes)" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4027 |
|
16372 | 4028 |
^ (changeInfoList at:changeNr) isFollowupChange |
4029 |
||
4030 |
"Created: / 06-02-1998 / 13:03:39 / cg" |
|
4031 |
"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
|
4032 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4033 |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4034 |
changeIsSnapShotInfo:changeNr |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4035 |
"return true, if a change is a snapShot info chunk" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4036 |
|
18596 | 4037 |
^ self changeIsSpecialInfo:changeNr anyOf:#('snapshot') |
4038 |
||
4039 |
"Modified: / 01-05-2016 / 18:25:25 / cg" |
|
4040 |
"Modified: / 15-02-2019 / 11:46:55 / Claus Gittinger" |
|
4041 |
! |
|
4042 |
||
4043 |
changeIsSpecialInfo:changeNr anyOf:wordsToCheck |
|
4044 |
"return true, if a change is an info chunk |
|
4045 |
with info being any from wordsToCheck |
|
4046 |
(i.e. this should contain something like 'checkin', snapshot' etc.)" |
|
4047 |
||
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4048 |
|words chunk| |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4049 |
|
18596 | 4050 |
(changeInfoList at:changeNr) className |
4051 |
"(self classNameOfChange:changeNr)" isNil ifTrue:[ |
|
16372 | 4052 |
" |
4053 |
get the chunk |
|
4054 |
" |
|
4055 |
chunk := self changeChunkAt:changeNr. |
|
4056 |
"mhmh - empty ??" |
|
4057 |
chunk notNil ifTrue:[ |
|
4058 |
(chunk startsWith:'''---') ifTrue:[ |
|
4059 |
words := chunk asCollectionOfWords. |
|
4060 |
words size > 2 ifTrue:[ |
|
18596 | 4061 |
(wordsToCheck includes:(words at:2)) ifTrue:[ |
16372 | 4062 |
^ true |
4063 |
]. |
|
4064 |
]. |
|
4065 |
]. |
|
4066 |
]. |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4067 |
]. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4068 |
^ false |
16372 | 4069 |
|
18596 | 4070 |
"Created: / 15-02-2019 / 11:46:36 / Claus Gittinger" |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4071 |
! |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4072 |
|
11396 | 4073 |
classNameFromAttributeChangeParseTree:aParseTree |
4074 |
"mhmh - seems to always return the name of the nonMeta class - is this OK?" |
|
4075 |
||
11397 | 4076 |
|recTree isMeta name| |
11396 | 4077 |
|
4078 |
recTree := aParseTree receiver. |
|
4079 |
||
4080 |
(recTree notNil |
|
4081 |
and:[recTree ~~ #Error |
|
4082 |
and:[recTree isMessage |
|
4083 |
and:[recTree selector == #compiledMethodAt:]]]) ifTrue:[ |
|
4084 |
isMeta := false. |
|
4085 |
recTree := recTree receiver. |
|
4086 |
recTree isUnaryMessage ifTrue:[ |
|
4087 |
(recTree selector ~~ #class) ifTrue:[^ nil]. |
|
4088 |
"id class " |
|
4089 |
recTree := recTree receiver |
|
4090 |
]. |
|
4091 |
recTree isPrimary ifTrue:[ |
|
4092 |
name := recTree name. |
|
4093 |
isMeta ifTrue:[ |
|
4094 |
^ name , ' class'. |
|
4095 |
]. |
|
4096 |
^ name |
|
4097 |
] |
|
4098 |
]. |
|
4099 |
"very strange" |
|
4100 |
^ nil |
|
4101 |
||
4102 |
"Created: / 08-03-2012 / 09:42:36 / cg" |
|
4103 |
! |
|
4104 |
||
4105 |
classNameFromClassDefinitionChange:changeNr |
|
11397 | 4106 |
|changeStream chunk fullParseTree sel arg1Tree ownerTree ownerName name| |
11396 | 4107 |
|
4108 |
"/ must parse the full changes text, to get privacy information. |
|
4109 |
||
4110 |
changeStream := self streamForChange:changeNr. |
|
4111 |
changeStream isNil ifTrue:[ ^ nil]. |
|
4112 |
||
4113 |
chunk := changeStream nextChunk. |
|
4114 |
changeStream close. |
|
4115 |
fullParseTree := self parseExpression:chunk. |
|
4116 |
(fullParseTree isNil or:[fullParseTree == #Error]) ifTrue:[ |
|
4117 |
^ nil |
|
4118 |
]. |
|
4119 |
fullParseTree isMessage ifFalse:[ |
|
4120 |
^ nil |
|
4121 |
]. |
|
4122 |
||
4123 |
sel := fullParseTree selector. |
|
18596 | 4124 |
"/ (Class definitionSelectors includes:sel) ifFalse:[ |
4125 |
"/ ^ nil |
|
4126 |
"/ ]. |
|
4127 |
||
11396 | 4128 |
arg1Tree := fullParseTree arg1. |
16390 | 4129 |
(arg1Tree notNil and:[arg1Tree isLiteral]) ifTrue:[ |
11396 | 4130 |
name := arg1Tree value asString. |
4131 |
||
4132 |
"/ is it a private-class ? |
|
4133 |
('*privateIn:' match:sel) ifTrue:[ |
|
4134 |
ownerTree := fullParseTree args last. |
|
4135 |
ownerName := ownerTree name asString. |
|
4136 |
^ ownerName , '::' , name |
|
4137 |
]. |
|
4138 |
^ name |
|
4139 |
]. |
|
4140 |
"very strange" |
|
4141 |
^ nil |
|
4142 |
||
4143 |
"Created: / 08-03-2012 / 09:34:04 / cg" |
|
18596 | 4144 |
"Modified: / 15-02-2019 / 12:08:55 / Claus Gittinger" |
11396 | 4145 |
! |
4146 |
||
4147 |
classNameFromReceiverInParseTree:aParseTree |
|
4148 |
"extrat the class name from a method-change, methodRemove or comment-change's |
|
4149 |
parse tree" |
|
4150 |
||
4151 |
|recTree isMeta cls name| |
|
4152 |
||
4153 |
recTree := aParseTree receiver. |
|
4154 |
(recTree isNil or:[recTree == #Error]) ifTrue:[ |
|
4155 |
"more strange things" |
|
4156 |
^ nil |
|
4157 |
]. |
|
4158 |
||
4159 |
isMeta := false. |
|
4160 |
recTree isUnaryMessage ifTrue:[ |
|
4161 |
(recTree selector ~~ #class) ifTrue:[^ nil]. |
|
4162 |
"id class methodsFor:..." |
|
4163 |
recTree := recTree receiver. |
|
4164 |
isMeta := true. |
|
4165 |
]. |
|
4166 |
recTree isPrimary ifTrue:[ |
|
4167 |
cls := self classFromEvaluatingTree:recTree. |
|
4168 |
cls notNil ifTrue:[^ cls name]. |
|
4169 |
||
4170 |
name := recTree name. |
|
4171 |
isMeta ifTrue:[ |
|
4172 |
^ name , ' class'. |
|
4173 |
]. |
|
4174 |
^ name |
|
4175 |
]. |
|
4176 |
||
4177 |
"more strange things" |
|
4178 |
^ nil |
|
4179 |
||
4180 |
"Created: / 08-03-2012 / 09:26:57 / cg" |
|
4181 |
! |
|
4182 |
||
4183 |
classNameFromRemoveClassParseTree:aParseTree |
|
11397 | 4184 |
"tree is: Smalltalk removeClass: class" |
4185 |
||
11396 | 4186 |
|recTree arg1Tree| |
4187 |
||
4188 |
recTree := aParseTree receiver. |
|
4189 |
||
4190 |
(recTree notNil |
|
4191 |
and:[recTree ~~ #Error |
|
4192 |
and:[recTree isPrimary |
|
4193 |
and:[recTree name = 'Smalltalk']]]) ifTrue:[ |
|
4194 |
arg1Tree := aParseTree arg1. |
|
13663 | 4195 |
(arg1Tree notNil and:[arg1Tree isVariable]) ifTrue:[ |
11397 | 4196 |
^ arg1Tree name. |
11396 | 4197 |
]. |
4198 |
]. |
|
4199 |
"very strange" |
|
4200 |
^ nil |
|
4201 |
||
4202 |
"Created: / 08-03-2012 / 09:36:59 / cg" |
|
4203 |
! |
|
4204 |
||
11397 | 4205 |
classNameFromRenameClassParseTree:aParseTree |
4206 |
"tree is: Smalltalk renameClass: oldClass to: 'newName'" |
|
4207 |
||
4208 |
|recTree arg1Tree arg2Tree oldName newName| |
|
4209 |
||
4210 |
recTree := aParseTree receiver. |
|
4211 |
||
4212 |
(recTree notNil |
|
4213 |
and:[recTree ~~ #Error |
|
4214 |
and:[recTree isPrimary |
|
4215 |
and:[recTree name = 'Smalltalk']]]) ifTrue:[ |
|
4216 |
arg1Tree := aParseTree arg1. |
|
4217 |
(arg1Tree notNil and:[arg1Tree isPrimary]) ifTrue:[ |
|
4218 |
oldName := arg1Tree name. |
|
4219 |
arg2Tree := aParseTree arg2. |
|
16390 | 4220 |
(arg2Tree notNil and:[arg2Tree isLiteral]) ifTrue:[ |
11397 | 4221 |
newName := arg2Tree evaluate. |
4222 |
(Smalltalk classNamed:oldName) notNil ifTrue:[^ oldName ]. |
|
4223 |
(Smalltalk classNamed:newName) notNil ifTrue:[^ newName ]. |
|
4224 |
]. |
|
4225 |
]. |
|
4226 |
]. |
|
4227 |
"very strange" |
|
4228 |
^ nil |
|
4229 |
||
4230 |
"Created: / 08-03-2012 / 11:42:25 / cg" |
|
4231 |
! |
|
4232 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4233 |
classNameOfChange:changeNr |
6288 | 4234 |
"return the classname of a change |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4235 |
(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
|
4236 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4237 |
|name| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4238 |
|
3364 | 4239 |
name := self realClassNameOfChange:changeNr. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4240 |
name isNil ifTrue:[^ nil]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4241 |
(name endsWith:' class') ifTrue:[ |
12704
6f20f7d39e75
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12656
diff
changeset
|
4242 |
name := name copyButLast:6 |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4243 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4244 |
^ name |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4245 |
|
3364 | 4246 |
"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
|
4247 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4248 |
|
3202 | 4249 |
extractSelectorOfMethodChange:changeNr |
17400 | 4250 |
"return a method-changes selector, or nil if it's not a methodChange" |
3202 | 4251 |
|
4252 |
|source parser sel chunk aParseTree | |
|
4253 |
||
4254 |
source := self sourceOfMethodChange:changeNr. |
|
4255 |
source isNil ifTrue:[ |
|
8665 | 4256 |
(self classNameOfChange:changeNr) notNil ifTrue:[ |
16372 | 4257 |
chunk := self changeChunkAt:changeNr. |
8665 | 4258 |
chunk isNil ifTrue:[^ nil]. "mhmh - empty" |
4259 |
||
4260 |
aParseTree := self parseExpression:chunk. |
|
4261 |
(aParseTree isNil |
|
4262 |
or:[aParseTree == #Error |
|
4263 |
or:[aParseTree isMessage not]]) ifTrue:[ |
|
4264 |
^ nil "seems strange ... (could be a comment)" |
|
4265 |
]. |
|
4266 |
sel := aParseTree selector. |
|
4267 |
(#( |
|
4268 |
#'removeSelector:' |
|
4269 |
) includes:sel) ifTrue:[ |
|
4270 |
sel := aParseTree arguments at:1. |
|
16390 | 4271 |
sel isLiteral ifTrue:[ |
8665 | 4272 |
sel := sel evaluate. |
4273 |
sel isSymbol ifTrue:[ |
|
4274 |
^ sel |
|
4275 |
] |
|
4276 |
] |
|
4277 |
] |
|
4278 |
]. |
|
4279 |
^ nil |
|
3202 | 4280 |
]. |
4281 |
||
4282 |
||
6288 | 4283 |
parser := Parser |
8665 | 4284 |
parseMethodArgAndVarSpecification:source |
4285 |
in:nil |
|
4286 |
ignoreErrors:true |
|
4287 |
ignoreWarnings:true |
|
4288 |
parseBody:false. |
|
3202 | 4289 |
|
4290 |
(parser notNil and:[parser ~~ #Error]) ifTrue:[ |
|
8665 | 4291 |
sel := parser selector. |
3202 | 4292 |
]. |
4293 |
^ sel |
|
4294 |
||
16372 | 4295 |
"Created: / 24-11-1995 / 14:30:46 / cg" |
4296 |
"Modified: / 01-05-2016 / 18:25:39 / cg" |
|
17400 | 4297 |
"Modified (comment): / 13-02-2017 / 19:57:20 / cg" |
3202 | 4298 |
! |
4299 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4300 |
fullClassNameOfChange:changeNr |
6288 | 4301 |
"return the full classname of a change |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
4302 |
(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
|
4303 |
|
11396 | 4304 |
|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
|
4305 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4306 |
changeNr isNil ifTrue:[^ nil]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4307 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4308 |
first look, if not already known |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4309 |
" |
16372 | 4310 |
name := self changeClassNameAt:changeNr. |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
4311 |
name notNil ifTrue:[ |
7953 | 4312 |
name == #nil ifTrue:[^ nil]. |
4313 |
^ name |
|
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
4314 |
]. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4315 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4316 |
prevMethodDefNr := changeNr. |
16372 | 4317 |
[ (changeInfoList at:prevMethodDefNr) isFollowupChange ] whileTrue:[ |
7953 | 4318 |
prevMethodDefNr := prevMethodDefNr - 1. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4319 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4320 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4321 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4322 |
get the chunk |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4323 |
" |
16372 | 4324 |
chunk := self changeChunkAt:prevMethodDefNr. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4325 |
chunk isNil ifTrue:[^ nil]. "mhmh - empty" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4326 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4327 |
(chunk startsWith:'''---') ifTrue:[ |
7953 | 4328 |
words := chunk asCollectionOfWords. |
4329 |
words size > 2 ifTrue:[ |
|
4330 |
(words at:2) = 'checkin' ifTrue:[ |
|
4331 |
name := words at:3. |
|
4332 |
^ name |
|
4333 |
] |
|
4334 |
]. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4335 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4336 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4337 |
"/ fix it - otherwise, it cannot be parsed |
11396 | 4338 |
((chunk endsWith:'primitiveDefinitions:') |
4339 |
or:[(chunk endsWith:'primitiveFunctions:') |
|
4340 |
or:[(chunk endsWith:'primitiveVariables:')]]) ifTrue:[ |
|
7953 | 4341 |
chunk := chunk , '''''' |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4342 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4343 |
|
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 |
use parser to construct a parseTree |
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 |
oldDollarSetting := Parser allowDollarInIdentifier. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4348 |
[ |
7953 | 4349 |
Parser allowDollarInIdentifier:true. |
5014 | 4350 |
"/ Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
4351 |
"/ do:[ |
|
8665 | 4352 |
aParseTree := self parseExpression:chunk. |
5014 | 4353 |
"/ ]. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4354 |
|
7953 | 4355 |
aParseTree == #Error ifTrue:[ |
4356 |
(chunk includesString:'comment') ifTrue:[ |
|
4357 |
"/ could be a comment ... |
|
8665 | 4358 |
aParseTree := self parseExpression:chunk , ''''. |
7953 | 4359 |
] |
4360 |
]. |
|
3597
2e7fc0ae28c9
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
4361 |
] ensure:[ |
7953 | 4362 |
Parser allowDollarInIdentifier:oldDollarSetting |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4363 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4364 |
(aParseTree isNil or:[aParseTree == #Error]) ifTrue:[ |
7953 | 4365 |
^ 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
|
4366 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4367 |
aParseTree isMessage ifFalse:[ |
7953 | 4368 |
^ nil "very strange ... (whats that ?)" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4369 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4370 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4371 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4372 |
ask parser for selector |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4373 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4374 |
sel := aParseTree selector. |
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 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4377 |
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
|
4378 |
" |
6288 | 4379 |
(#(#'methodsFor:' |
4380 |
#'privateMethodsFor:' |
|
4381 |
#'protectedMethodsFor:' |
|
4382 |
#'ignoredMethodsFor:' |
|
4383 |
#'publicMethodsFor:' |
|
4384 |
#'removeSelector:' |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4385 |
#'comment:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4386 |
#'primitiveDefinitions:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4387 |
#'primitiveFunctions:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4388 |
#'primitiveVariables:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4389 |
#'renameCategory:to:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4390 |
#'instanceVariableNames:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4391 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4392 |
#'methodsFor:stamp:' "/ Squeak support |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4393 |
#'commentStamp:prior:' "/ Squeak support |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4394 |
#'addClassVarName:' "/ Squeak support |
2527
afa639104477
some support for dolphin source files
Claus Gittinger <cg@exept.de>
parents:
2511
diff
changeset
|
4395 |
#methodsFor "/ Dolphin support |
3472 | 4396 |
#categoriesForClass "/ Dolphin support |
4397 |
#categoriesFor: "/ Dolphin support |
|
2606 | 4398 |
#methods "/ STV support |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4399 |
) includes:sel) ifTrue:[ |
7953 | 4400 |
" |
4401 |
yes, the className is the receiver |
|
4402 |
" |
|
11396 | 4403 |
^ self classNameFromReceiverInParseTree:aParseTree |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4404 |
]. |
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 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4407 |
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
|
4408 |
" |
6288 | 4409 |
(('subclass:*' match:sel) |
2322 | 4410 |
or:[('variable*ubclass:*' match:sel)]) ifTrue:[ |
7953 | 4411 |
"/ must parse the full changes text, to get |
4412 |
"/ privacy information. |
|
11396 | 4413 |
^ self classNameFromClassDefinitionChange:changeNr |
2263
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 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4417 |
is it a class remove ? |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4418 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4419 |
(sel == #removeClass:) ifTrue:[ |
11396 | 4420 |
^ self classNameFromRemoveClassParseTree:aParseTree |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4421 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4422 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4423 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4424 |
is it a method category change ? |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4425 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4426 |
((sel == #category:) |
7953 | 4427 |
or:[sel == #package: |
4428 |
or:[sel == #privacy:]]) ifTrue:[ |
|
11396 | 4429 |
^ self classNameFromAttributeChangeParseTree:aParseTree |
4430 |
]. |
|
4431 |
||
4432 |
sel == #renameClass:to: ifTrue:[ |
|
11397 | 4433 |
^ self classNameFromRenameClassParseTree:aParseTree |
11396 | 4434 |
]. |
4435 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4436 |
^ nil |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4437 |
|
16372 | 4438 |
"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
|
4439 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4440 |
|
18596 | 4441 |
isClassDefinitionChange:changeNr |
4442 |
|changeStream chunk fullParseTree sel| |
|
4443 |
||
4444 |
"/ must parse the full changes text, to get privacy information. |
|
4445 |
||
4446 |
changeStream := self streamForChange:changeNr. |
|
4447 |
changeStream isNil ifTrue:[ ^ false]. |
|
4448 |
||
4449 |
chunk := changeStream nextChunk. |
|
4450 |
changeStream close. |
|
4451 |
fullParseTree := self parseExpression:chunk. |
|
4452 |
(fullParseTree isNil or:[fullParseTree == #Error]) ifTrue:[ |
|
4453 |
^ false |
|
4454 |
]. |
|
4455 |
fullParseTree isMessage ifFalse:[ |
|
4456 |
^ false |
|
4457 |
]. |
|
4458 |
||
4459 |
sel := fullParseTree selector. |
|
4460 |
^ (Class definitionSelectors includes:sel). |
|
4461 |
||
4462 |
"Created: / 15-02-2019 / 12:08:44 / Claus Gittinger" |
|
4463 |
! |
|
4464 |
||
12428 | 4465 |
namespaceOfChange:changeNr |
4466 |
"return the namespace of a change or nil" |
|
4467 |
||
15116 | 4468 |
|className namespace idx| |
12428 | 4469 |
|
4470 |
className := self classNameOfChange:changeNr. |
|
4471 |
className isNil ifTrue:[ ^ nil ]. |
|
4472 |
||
15116 | 4473 |
idx := className indexOfSubCollection:'::'. |
4474 |
idx == 0 ifTrue:[ ^ nil ]. |
|
4475 |
namespace := className copyTo:idx-1. |
|
12428 | 4476 |
^ namespace |
4477 |
! |
|
4478 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4479 |
numberOfChanges |
16372 | 4480 |
^ changeInfoList size |
4481 |
||
4482 |
"Created: / 03-12-1995 / 18:15:39 / cg" |
|
4483 |
"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
|
4484 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4485 |
|
2511 | 4486 |
ownerClassNameOfChange:changeNr |
6288 | 4487 |
"return the owner classname of a change |
2511 | 4488 |
For a normal class, this is the className; |
4489 |
for a private class, this is the name of the owning class" |
|
4490 |
||
4706 | 4491 |
|name "ns idx" cls| |
2511 | 4492 |
|
4493 |
name := self classNameOfChange:changeNr. |
|
4494 |
name isNil ifTrue:[^ nil]. |
|
4495 |
cls := Smalltalk at:name asSymbol. |
|
4496 |
(cls notNil and:[cls isBehavior]) ifTrue:[ |
|
6288 | 4497 |
cls owningClass notNil ifTrue:[ |
4498 |
^ cls owningClass name |
|
4499 |
]. |
|
4500 |
^ cls name |
|
2511 | 4501 |
]. |
4502 |
||
4503 |
"/ (name includes:$:) ifTrue:[ |
|
4504 |
"/ idx := name indexOf:$:. |
|
4505 |
"/ ns := name copyTo:idx-1. |
|
4506 |
"/ ns := Smalltalk at:ns asSymbol. |
|
4507 |
"/ ns notNil ifTrue:[ |
|
6288 | 4508 |
"/ |
2511 | 4509 |
"/ ]. |
4510 |
"/ |
|
4511 |
"/ name := name copyFrom:idx+2. |
|
4512 |
"/ (Smalltalk at:ns asSymbol) notNil ifTrue:[ |
|
4513 |
"/ cls |
|
4514 |
"/ ]. |
|
13851 | 4515 |
"/ ^ name copyButLast:6 |
2511 | 4516 |
"/ ]. |
4517 |
^ name |
|
4518 |
||
4519 |
"Modified: 6.12.1995 / 17:06:31 / cg" |
|
4520 |
! |
|
4521 |
||
3364 | 4522 |
realClassNameOfChange:changeNr |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
4523 |
"return the classname of a change. |
6288 | 4524 |
- 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
|
4525 |
changeClassNames for the next query" |
3364 | 4526 |
|
4527 |
|name| |
|
4528 |
||
16372 | 4529 |
name := self changeClassNameAt:changeNr. |
3364 | 4530 |
name isNil ifTrue:[ |
16372 | 4531 |
name := self fullClassNameOfChange:changeNr. |
4532 |
name isNil ifTrue:[ |
|
4533 |
(changeInfoList at:changeNr) className:#nil. |
|
4534 |
]. |
|
3364 | 4535 |
]. |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
4536 |
name == #nil ifTrue:[^ nil]. |
3364 | 4537 |
^ name |
4538 |
||
16372 | 4539 |
"Created: / 05-11-2001 / 18:09:46 / cg" |
4540 |
"Modified: / 01-05-2016 / 19:24:53 / cg" |
|
3364 | 4541 |
! |
4542 |
||
18059 | 4543 |
selectorOfMethodCategoryChange:changeNr |
4544 |
"return a methodCategory-change's selector, |
|
4545 |
or nil if it's not a methodCategoryChange" |
|
4546 |
||
4547 |
(changeInfoList at:changeNr) isMethodCategoryChange ifFalse:[^ nil]. |
|
4548 |
^ (changeInfoList at:changeNr) selector. |
|
4549 |
||
4550 |
"Modified: / 01-05-2016 / 19:26:21 / cg" |
|
4551 |
! |
|
4552 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4553 |
selectorOfMethodChange:changeNr |
18059 | 4554 |
"return a method-change's selector, |
16467 | 4555 |
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
|
4556 |
|
3202 | 4557 |
|sel | |
4558 |
||
16372 | 4559 |
changeInfoList size >= changeNr ifTrue:[ |
18059 | 4560 |
(changeInfoList at:changeNr) isMethodCategoryChange ifTrue:[^ nil]. |
16372 | 4561 |
sel := (changeInfoList at:changeNr) selector. |
15652 | 4562 |
sel notNil ifTrue:[ ^ sel ]. |
3202 | 4563 |
]. |
4564 |
||
4565 |
sel := self extractSelectorOfMethodChange:changeNr. |
|
4566 |
sel notNil ifTrue:[ |
|
18059 | 4567 |
self assert:(changeInfoList at:changeNr) isMethodCategoryChange not. |
16372 | 4568 |
(changeInfoList at:changeNr) selector:sel. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4569 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4570 |
^ sel |
16372 | 4571 |
|
4572 |
"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
|
4573 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4574 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4575 |
sourceOfMethodChange:changeNr |
17400 | 4576 |
"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
|
4577 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4578 |
|aStream chunk sawExcla parseTree sourceChunk sel| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4579 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4580 |
aStream := self streamForChange:changeNr. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4581 |
aStream isNil ifTrue:[^ nil]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4582 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4583 |
(self changeIsFollowupMethodChange:changeNr) ifFalse:[ |
8665 | 4584 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
4585 |
chunk := aStream nextChunk. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4586 |
] ifTrue:[ |
16372 | 4587 |
chunk := self changeChunkAt:changeNr. |
8665 | 4588 |
sawExcla := true. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4589 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4590 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4591 |
sawExcla ifTrue:[ |
8665 | 4592 |
parseTree := self parseExpression:chunk. |
4593 |
(parseTree notNil |
|
4594 |
and:[parseTree ~~ #Error |
|
4595 |
and:[parseTree isMessage]]) ifTrue:[ |
|
4596 |
sel := parseTree selector. |
|
4597 |
(#( |
|
4598 |
#methodsFor: |
|
4599 |
#privateMethodsFor: |
|
4600 |
#publicMethodsFor: |
|
4601 |
#ignoredMethodsFor: |
|
4602 |
#protectedMethodsFor: |
|
4603 |
||
4604 |
#methodsFor:stamp: "/ Squeak support |
|
4605 |
#commentStamp:prior: "/ Squeak support |
|
4606 |
#methodsFor "/ Dolphin support |
|
4607 |
#methods "/ STV support |
|
4608 |
) |
|
4609 |
includes:sel) ifTrue:[ |
|
4610 |
sourceChunk := aStream nextChunk. |
|
4611 |
] |
|
4612 |
]. |
|
2263
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 |
aStream close. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4615 |
^ sourceChunk |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4616 |
|
16372 | 4617 |
"Created: / 05-09-1996 / 17:11:32 / cg" |
4618 |
"Modified: / 01-05-2016 / 18:25:53 / cg" |
|
17400 | 4619 |
"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
|
4620 |
! |
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 |
streamForChange:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4623 |
"answer a stream for change" |
6288 | 4624 |
|
15858 | 4625 |
|aStream encoding| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4626 |
|
16372 | 4627 |
(changeNr between:1 and:changeInfoList size) ifFalse:[^ nil]. |
5702 | 4628 |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
4629 |
aStream := changeFileName asFilename readStreamOrNil. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4630 |
aStream isNil ifTrue:[^ nil]. |
5702 | 4631 |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4632 |
encodingIfKnown isNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4633 |
encoding := CharacterEncoder guessEncodingOfStream:aStream. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4634 |
encodingIfKnown := encoding ? #none |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4635 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4636 |
(encodingIfKnown notNil and:[encodingIfKnown ~~ #none]) ifTrue:[ |
15858 | 4637 |
aStream := EncodedStream stream:aStream encoding:encodingIfKnown. |
5702 | 4638 |
]. |
4639 |
||
16372 | 4640 |
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
|
4641 |
^ aStream |
16372 | 4642 |
|
4643 |
"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
|
4644 |
! ! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4645 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4646 |
!ChangesBrowser methodsFor:'private-changeFile access'! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4647 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4648 |
changeFileName:aFileName |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4649 |
"set the name of the changeFile" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4650 |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4651 |
changeFileName := aFileName. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4652 |
encodingIfKnown := nil. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4653 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4654 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4655 |
checkIfFileHasChanged |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4656 |
"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
|
4657 |
install a timeout for rechecking after some time." |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4658 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4659 |
|f info | |
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 |
Processor removeTimedBlock:checkBlock. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4662 |
f := changeFileName asFilename. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4663 |
(info := f info) isNil ifTrue:[ |
16092 | 4664 |
self newLabel:'(unaccessible)' |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4665 |
] ifFalse:[ |
16092 | 4666 |
(info modificationTime) > changeFileTimestamp ifTrue:[ |
4667 |
self newLabel:'(outdated)'. |
|
4668 |
autoUpdate value ifTrue:[ |
|
4669 |
self doUpdate |
|
4670 |
] |
|
4671 |
] ifFalse:[ |
|
4672 |
self newLabel:'' |
|
4673 |
] |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4674 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4675 |
Processor addTimedBlock:checkBlock afterSeconds:5. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4676 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4677 |
"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
|
4678 |
"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
|
4679 |
"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
|
4680 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4681 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4682 |
readChangesFile |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4683 |
"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
|
4684 |
and a list of chunk-positions (changePositions)" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4685 |
|
5178 | 4686 |
self readChangesFileInBackground:false. |
4687 |
self newLabel:''. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4688 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4689 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4690 |
readChangesFileInBackground:inBackground |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4691 |
"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
|
4692 |
and a list of chunk-positions (changePositions). |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4693 |
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
|
4694 |
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
|
4695 |
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
|
4696 |
'+' -> 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
|
4697 |
'-' -> 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
|
4698 |
'?' -> class does not exist currently |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4699 |
'=' -> 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
|
4700 |
'~' -> 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
|
4701 |
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
|
4702 |
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
|
4703 |
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
|
4704 |
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
|
4705 |
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
|
4706 |
4 timestamp |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4707 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4708 |
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
|
4709 |
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
|
4710 |
|
12635 | 4711 |
|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
|
4712 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4713 |
editingClassSource := false. |
2641 | 4714 |
askedForEditingClassSource := false. |
17953 | 4715 |
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
|
4716 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4717 |
"/ maxLen := 60. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4718 |
|
3674 | 4719 |
self newLabel:'updating ...'. |
4720 |
||
4721 |
(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
|
4722 |
^ self class readXMLChangesFromFile:changeFileName inBackground:inBackground |
3674 | 4723 |
]. |
4724 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4725 |
f := changeFileName asFilename. |
7346 | 4726 |
f exists ifFalse:[^ self]. |
12635 | 4727 |
inStream := EncodedStream decodedStreamFor:(f readStream). |
5696 | 4728 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4729 |
i := f info. |
3965
e499c0dae8fc
use #fileSize instead of #size
Claus Gittinger <cg@exept.de>
parents:
3962
diff
changeset
|
4730 |
changeFileSize := i fileSize. |
3962
3906b10c42fd
modified -> modificationTime
Claus Gittinger <cg@exept.de>
parents:
3930
diff
changeset
|
4731 |
changeFileTimestamp := i modificationTime. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4732 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4733 |
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
|
4734 |
" |
3b2616b53ab3
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 |
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
|
4736 |
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
|
4737 |
" |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4738 |
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
|
4739 |
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
|
4740 |
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
|
4741 |
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
|
4742 |
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
|
4743 |
]. |
3b2616b53ab3
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 |
|
3b2616b53ab3
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 |
[ |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4746 |
|reader| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4747 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4748 |
reader := ChangeFileReader new. |
6516
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
4749 |
reader changeFileName:changeFileName. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4750 |
reader browser:self. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4751 |
reader enforcedNameSpace:enforcedNameSpace. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4752 |
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
|
4753 |
reader autoloadAsRequired:autoloadAsRequired. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4754 |
reader tabSpec:tabSpec. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4755 |
reader inStream:inStream. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4756 |
reader noColoring:(NoColoring == true). |
16467 | 4757 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4758 |
reader readChangesFile. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4759 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4760 |
editingClassSource := reader thisIsAClassSource. |
16372 | 4761 |
changeInfoList := reader changeInfo. |
16467 | 4762 |
|
4763 |
self showNumberOfChanges. |
|
7360 | 4764 |
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
|
4765 |
] 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
|
4766 |
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
|
4767 |
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
|
4768 |
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
|
4769 |
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
|
4770 |
]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4771 |
]. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4772 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4773 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4774 |
self checkIfFileHasChanged |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4775 |
|
7360 | 4776 |
"Modified: / 27-08-1995 / 23:06:55 / claus" |
16372 | 4777 |
"Modified: / 01-05-2016 / 19:13:09 / cg" |
17953 | 4778 |
"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
|
4779 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4780 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4781 |
writeBackChanges |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4782 |
"write back the changes file. To avoid problems when the disk is full |
6288 | 4783 |
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
|
4784 |
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
|
4785 |
rename the old change-file to a .bak file and finally rename the |
6288 | 4786 |
tempfile back to the change-file. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4787 |
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
|
4788 |
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
|
4789 |
|
15858 | 4790 |
|inFilename inStream outStream stamp encoding tempFilename| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4791 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4792 |
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
|
4793 |
(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
|
4794 |
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
|
4795 |
^ 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
|
4796 |
] |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4797 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4798 |
|
13123 | 4799 |
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
|
4800 |
[ |
13123 | 4801 |
inStream := inFilename readStream. |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4802 |
] on:FileStream openErrorSignal do:[:ex| |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4803 |
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
|
4804 |
^ 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
|
4805 |
]. |
9020 | 4806 |
[ |
4807 |
[ |
|
13123 | 4808 |
outStream := FileStream newTemporaryIn:inFilename directory. |
4809 |
tempFilename := outStream fileName. |
|
9020 | 4810 |
] on:FileStream openErrorSignal do:[:ex| |
4811 |
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
|
4812 |
^ false |
9020 | 4813 |
]. |
4814 |
||
11234 | 4815 |
outStream nextPutLine:'''---- encoding: utf8 ----''!!'. |
9020 | 4816 |
outStream := EncodedStream stream:outStream encoder:(CharacterEncoder encoderForUTF8). |
4817 |
||
4818 |
encoding := CharacterEncoder guessEncodingOfStream:inStream. |
|
4819 |
encoding notNil ifTrue:[ |
|
15858 | 4820 |
inStream := EncodedStream stream:inStream encoding:encoding. |
9020 | 4821 |
]. |
4822 |
||
11685 | 4823 |
self withWriteCursorDo:[ |
9020 | 4824 |
|excla sawExcla done first chunk |
4825 |
nChanges "{Class:SmallInteger}" | |
|
4826 |
||
4827 |
Stream writeErrorSignal handle:[:ex | |
|
4828 |
self warn:('Could not update the changes file.\\' , ex description) withCRs. |
|
13123 | 4829 |
outStream close. |
4830 |
tempFilename remove. |
|
9020 | 4831 |
^ false |
4832 |
] do:[ |
|
4833 |
excla := inStream class chunkSeparator. |
|
4834 |
nChanges := self numberOfChanges. |
|
4835 |
||
4836 |
1 to:nChanges do:[:index | |
|
16372 | 4837 |
inStream position:((changeInfoList at:index) position)-1. |
9020 | 4838 |
sawExcla := inStream peekFor:excla. |
4839 |
chunk := inStream nextChunk. |
|
4840 |
||
4841 |
(chunk notNil |
|
4842 |
and:[(chunk startsWith:'''---- snap') not]) ifTrue:[ |
|
16372 | 4843 |
(stamp := (changeInfoList at:index) timestamp) notNil ifTrue:[ |
9020 | 4844 |
outStream nextPutAll:'''---- timestamp ' , stamp , ' ----'''. |
4845 |
outStream nextPut:excla; cr. |
|
4846 |
]. |
|
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
|
4847 |
]. |
9020 | 4848 |
|
4849 |
sawExcla ifTrue:[ |
|
4850 |
outStream nextPut:excla. |
|
4851 |
outStream nextChunkPut:chunk. |
|
4852 |
outStream cr; cr. |
|
4853 |
" |
|
4854 |
a method-definition chunk - output followups |
|
4855 |
" |
|
4856 |
done := false. |
|
4857 |
first := true. |
|
4858 |
[done] whileFalse:[ |
|
4859 |
chunk := inStream nextChunk. |
|
4860 |
chunk isNil ifTrue:[ |
|
4861 |
outStream cr; cr. |
|
4862 |
done := true |
|
4863 |
] ifFalse:[ |
|
4864 |
chunk isEmpty ifTrue:[ |
|
4865 |
outStream space; nextChunkPut:chunk; cr; cr. |
|
4866 |
done := true. |
|
4867 |
] ifFalse:[ |
|
4868 |
first ifFalse:[ |
|
4869 |
outStream cr; cr. |
|
4870 |
]. |
|
4871 |
outStream nextChunkPut:chunk. |
|
4872 |
]. |
|
4873 |
]. |
|
4874 |
first := false. |
|
4875 |
]. |
|
4876 |
] ifFalse:[ |
|
4877 |
outStream nextChunkPut:chunk. |
|
4878 |
outStream cr |
|
4879 |
] |
|
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
|
4880 |
]. |
9020 | 4881 |
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
|
4882 |
]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4883 |
inStream close. |
9020 | 4884 |
|
17376 | 4885 |
inFilename renameTo:inFilename asBackupFilename. |
13123 | 4886 |
tempFilename renameTo:changeFileName. |
9020 | 4887 |
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
|
4888 |
]. |
9020 | 4889 |
] ensure:[ |
4890 |
inStream close. |
|
4891 |
]. |
|
4892 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4893 |
^ true |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4894 |
|
16372 | 4895 |
"Modified: / 01-05-2016 / 19:30:34 / cg" |
17376 | 4896 |
"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
|
4897 |
! ! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4898 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4899 |
!ChangesBrowser methodsFor:'private-user interaction ops'! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4900 |
|
5735 | 4901 |
appendChange:changeNr toFile:aFileNameOrFileNameString |
202 | 4902 |
"append change to a file. return true if ok." |
4903 |
||
5735 | 4904 |
|fileName changeInStream outStream chunk chunk2 sawExcla separator encoding| |
4905 |
||
4906 |
changeInStream := self streamForChange:changeNr. |
|
4907 |
changeInStream isNil ifTrue:[ |
|
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4908 |
self warn:'Cannot read change'. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4909 |
^ false |
2394
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
4910 |
]. |
5735 | 4911 |
changeInStream skipSeparators. |
4912 |
||
4913 |
separator := changeInStream class chunkSeparator. |
|
2394
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
4914 |
|
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
4915 |
(self changeIsFollowupMethodChange:changeNr) ifTrue:[ |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4916 |
sawExcla := true. |
16372 | 4917 |
chunk := self changeChunkAt:changeNr. |
2394
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
4918 |
] ifFalse:[ |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4919 |
sawExcla := changeInStream peekFor:separator. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4920 |
chunk := changeInStream nextChunk. |
3991 | 4921 |
]. |
4922 |
chunk withoutSeparators isEmpty ifTrue:[ |
|
18152 | 4923 |
self proceedableError:'Empty chunk - should not happen'. |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4924 |
^ false. |
5735 | 4925 |
]. |
4926 |
||
4927 |
fileName := aFileNameOrFileNameString asFilename. |
|
202 | 4928 |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
4929 |
[ |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4930 |
outStream := fileName readWriteStream. |
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
4931 |
] on:FileStream openErrorSignal do:[:ex| |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4932 |
self warn:'Cannot update file: ''%1''' with:fileName. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4933 |
^ false |
73 | 4934 |
]. |
202 | 4935 |
|
11476
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4936 |
outStream fileSize = 0 ifTrue:[ |
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4937 |
encoding := #utf8. |
15090 | 4938 |
outStream nextPutLine:'"{ Encoding: utf8 }" !!'. |
11476
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4939 |
] ifFalse:[ |
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4940 |
encoding := CharacterEncoder guessEncodingOfStream:outStream. |
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4941 |
]. |
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4942 |
|
5735 | 4943 |
encoding notNil ifTrue:[ |
15858 | 4944 |
outStream := EncodedStream stream:outStream encoding:encoding. |
11476
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4945 |
]. |
202 | 4946 |
outStream setToEnd. |
4947 |
||
4948 |
sawExcla ifTrue:[ |
|
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4949 |
outStream nextPut:separator |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4950 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4951 |
outStream nextChunkPut:chunk; cr. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4952 |
sawExcla ifTrue:[ |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4953 |
chunk2 := changeInStream nextChunk. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4954 |
chunk2 withoutSeparators isEmpty ifTrue:[ |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4955 |
self error:'Empty chunk - should not happen'. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4956 |
]. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4957 |
outStream nextChunkPut:chunk2; space |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4958 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4959 |
sawExcla ifTrue:[ |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4960 |
outStream nextPut:separator |
202 | 4961 |
]. |
4962 |
outStream cr. |
|
5735 | 4963 |
|
4964 |
changeInStream close. |
|
202 | 4965 |
outStream close. |
4966 |
^ true |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4967 |
|
16372 | 4968 |
"Modified: / 01-05-2016 / 18:25:00 / cg" |
18152 | 4969 |
"Modified: / 24-05-2018 / 14:54:56 / Claus Gittinger" |
73 | 4970 |
! |
4971 |
||
51 | 4972 |
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
|
4973 |
"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
|
4974 |
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
|
4975 |
|
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
4976 |
|aStream applyAction nameSpace className changeClass ownerName ownerClass reader doItChunk methodsForChunk pkg |
4877 | 4977 |
alternativeClass shortName orgClassName nsClass aborted| |
45 | 4978 |
|
51 | 4979 |
aStream := self streamForChange:changeNr. |
12973 | 4980 |
aStream isNil ifTrue:[^ false]. |
51 | 4981 |
|
2965 | 4982 |
className := self classNameOfChange:changeNr. |
4983 |
className notNil ifTrue:[ |
|
6378 | 4984 |
className := className asSymbol. |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
4985 |
enforcedNameSpace notNil ifTrue:[ |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
4986 |
changeClass := enforcedNameSpace at:className ifAbsent:nil. |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
4987 |
] ifFalse:[ |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
4988 |
changeClass := Smalltalk at:className ifAbsent:nil. |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
4989 |
]. |
6378 | 4990 |
changeClass isNil ifTrue:[ |
4991 |
changeClass := self classOfChange:changeNr. |
|
4992 |
]. |
|
8351
e99a28a6288b
changed #applyChange: load class before applying a change
Stefan Vogel <sv@exept.de>
parents:
8320
diff
changeset
|
4993 |
changeClass notNil ifTrue:[ |
e99a28a6288b
changed #applyChange: load class before applying a change
Stefan Vogel <sv@exept.de>
parents:
8320
diff
changeset
|
4994 |
"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
|
4995 |
will create a class without methods" |
e99a28a6288b
changed #applyChange: load class before applying a change
Stefan Vogel <sv@exept.de>
parents:
8320
diff
changeset
|
4996 |
changeClass autoload. |
e99a28a6288b
changed #applyChange: load class before applying a change
Stefan Vogel <sv@exept.de>
parents:
8320
diff
changeset
|
4997 |
]. |
51 | 4998 |
]. |
45 | 4999 |
|
51 | 5000 |
changeNrProcessed := changeNr. |
4877 | 5001 |
aborted := false. |
45 | 5002 |
|
6288 | 5003 |
applyAction := |
6378 | 5004 |
[ |
7783
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
5005 |
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
|
5006 |
"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
|
5007 |
Send AbortAllOperationRequest to abort multiple operations" |
6378 | 5008 |
aborted := true. |
5009 |
ex return. |
|
5010 |
] do:[ |
|
5011 |
nameSpace := self nameSpaceForApply. |
|
5012 |
||
5013 |
pkg := enforcedPackage ? Class packageQuerySignal query. |
|
5014 |
Class packageQuerySignal answer:pkg |
|
5015 |
do:[ |
|
5016 |
Class nameSpaceQuerySignal answer:nameSpace |
|
5017 |
do:[ |
|
11244 | 5018 |
Class defaultApplicationQuerySignal handle:[:ex | |
5019 |
ex proceedWith:defaultApplicationForVAGEClasses |
|
5020 |
] do:[ |
|
5021 |
Class changeDefaultApplicationNotificationSignal handle:[:ex | |
|
5022 |
defaultApplicationForVAGEClasses := ex parameter. |
|
5023 |
] do:[ |
|
17899 | 5024 |
|skip| |
5025 |
||
5026 |
skip := false. |
|
11244 | 5027 |
|
5028 |
"/ a followup methodsFor: chunk ... |
|
5029 |
(self changeIsFollowupMethodChange:changeNr) ifTrue:[ |
|
16372 | 5030 |
methodsForChunk := self changeChunkAt:changeNr. |
11244 | 5031 |
] ifFalse:[ |
5032 |
doItChunk := aStream nextChunk. "/ an empty chunk sometimes ... |
|
5033 |
doItChunk notEmpty ifTrue:[ |
|
5034 |
doItChunk first = (Character value:16rFEFF) ifTrue:[ |
|
5035 |
doItChunk := doItChunk copyFrom:2. |
|
5036 |
]. |
|
5037 |
Compiler evaluate:doItChunk notifying:self. |
|
6378 | 5038 |
] ifFalse:[ |
11244 | 5039 |
methodsForChunk := aStream nextChunk. "/ the real one |
6378 | 5040 |
] |
5041 |
]. |
|
11244 | 5042 |
methodsForChunk notNil ifTrue:[ |
5043 |
changeClass isNil ifTrue:[ |
|
5044 |
orgClassName := className. |
|
5045 |
||
5046 |
(className includes:$:) ifTrue:[ |
|
5047 |
ownerName := className copyTo:(className lastIndexOf:$:) - 1. |
|
5048 |
(ownerName endsWith:$:) ifTrue:[ |
|
12704
6f20f7d39e75
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12656
diff
changeset
|
5049 |
ownerName := ownerName copyButLast:1. |
11244 | 5050 |
]. |
5051 |
||
5052 |
ownerClass := Smalltalk at:(ownerName asSymbol) ifAbsent:[]. |
|
5053 |
ownerClass notNil ifTrue:[ |
|
5054 |
ownerClass autoload |
|
5055 |
]. |
|
5056 |
]. |
|
5057 |
(nameSpace notNil and:[nameSpace ~~ Smalltalk]) ifTrue:[ |
|
5058 |
changeClass := nameSpace at:className ifAbsent:[]. |
|
5059 |
]. |
|
5060 |
changeClass isNil ifTrue:[ |
|
5061 |
changeClass := Smalltalk at:className ifAbsent:[]. |
|
5062 |
]. |
|
5063 |
[changeClass isNil] whileTrue:[ |
|
5064 |
(NameSpace allNameSpaces |
|
15683 | 5065 |
contains:[:ns | (nsClass := (ns at:className asSymbol)) notNil]) |
11244 | 5066 |
ifTrue:[ |
5067 |
shortName := nsClass name. |
|
5068 |
] ifFalse:[ |
|
5069 |
shortName := className copyFrom:(className lastIndexOf:$:) + 1. |
|
5070 |
shortName = className ifTrue:[ |
|
5071 |
shortName := '' |
|
5072 |
]. |
|
5073 |
]. |
|
17899 | 5074 |
|
5075 |
skip := false. |
|
5076 |
||
5077 |
Dialog modifyingBoxWith:[:box | |
|
18054 | 5078 |
"/ self halt. |
17899 | 5079 |
box |
5080 |
addButton:(Button label:'Skip' action:[skip := true. box hide]) |
|
5081 |
after:box noButton |
|
5082 |
] do:[ |
|
5083 |
className := Dialog |
|
12973 | 5084 |
request:'No class ''' , className , ''' for change. Add to which class? (enter empty string to skip this change)' |
11244 | 5085 |
initialAnswer:shortName. |
5086 |
]. |
|
17899 | 5087 |
skip ifFalse:[ |
5088 |
className isNil ifTrue:[ |
|
5089 |
AbortAllOperationRequest raise. |
|
5090 |
]. |
|
5091 |
className isEmpty ifTrue:[ |
|
5092 |
^ false |
|
5093 |
]. |
|
5094 |
alternativeClass := Smalltalk classNamed:className. |
|
5095 |
alternativeClass notNil ifTrue:[ |
|
5096 |
changeClass := alternativeClass |
|
5097 |
] |
|
5098 |
]. |
|
11244 | 5099 |
]. |
17899 | 5100 |
skip ifFalse:[ |
5101 |
methodsForChunk := methodsForChunk copyFrom:(methodsForChunk indexOfSeparator). |
|
5102 |
methodsForChunk := changeClass name , methodsForChunk. |
|
5103 |
]. |
|
11244 | 5104 |
]. |
17899 | 5105 |
skip ifFalse:[ |
5106 |
reader := Compiler evaluate:methodsForChunk notifying:self. |
|
5107 |
reader fileInFrom:aStream notifying:self passChunk:false single:true. |
|
5108 |
] |
|
11244 | 5109 |
] |
5110 |
] |
|
6378 | 5111 |
] |
5112 |
] |
|
5113 |
] |
|
5114 |
]. |
|
5115 |
changeNrProcessed := nil. |
|
5116 |
]. |
|
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
5117 |
|
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
5118 |
"/ |
17026 | 5119 |
"/ 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
|
5120 |
"/ |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
5121 |
changeFileName = ObjectMemory nameForChanges ifTrue:[ |
6378 | 5122 |
Class withoutUpdatingChangesDo:[ |
5123 |
Class updateChangeListQuerySignal answer:updateChangeSet value do:applyAction |
|
5124 |
] |
|
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
5125 |
] ifFalse:[ |
6378 | 5126 |
applyAction value |
45 | 5127 |
]. |
4877 | 5128 |
aStream close. |
5129 |
||
5130 |
^ aborted not |
|
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
5131 |
|
16372 | 5132 |
"Modified: / 01-05-2016 / 18:25:18 / cg" |
45 | 5133 |
! |
5134 |
||
7953 | 5135 |
compareCategoryChange:parseTree |
9888 | 5136 |
|receiverExpression method thisClass| |
7953 | 5137 |
|
5138 |
receiverExpression := parseTree receiver. |
|
5139 |
receiverExpression isMessage ifTrue:[ |
|
5140 |
receiverExpression selector == #compiledMethodAt: ifTrue:[ |
|
9888 | 5141 |
[ |
5142 |
thisClass := receiverExpression receiver evaluate. |
|
5143 |
] on:Parser undefinedVariableError do:[:ex| ]. |
|
5144 |
||
5145 |
(thisClass isBehavior |
|
7953 | 5146 |
and:[(method := receiverExpression evaluate) isMethod]) ifTrue:[ |
5147 |
method category = parseTree arg1 evaluate ifTrue:[ |
|
5148 |
^ true -> 'Change has no effect\\(same category)'. |
|
5149 |
] ifFalse:[ |
|
8173 | 5150 |
^ false -> ('Category is different (''' , method category , ''' vs. ''' , parseTree arg1 evaluate , ''')'). |
7953 | 5151 |
] |
5152 |
] ifFalse:[ |
|
5153 |
^ nil -> 'There is no such method'. |
|
5154 |
] |
|
5155 |
] |
|
5156 |
]. |
|
5157 |
^ nil -> 'Unhandled receiver' |
|
5158 |
! |
|
5159 |
||
255 | 5160 |
compareChange:changeNr |
18059 | 5161 |
"compare a change with the current (in-image) version; |
5162 |
show the result of the compare (as dialog)" |
|
2835 | 5163 |
|
5164 |
^ self compareChange:changeNr showResult:true |
|
5165 |
! |
|
5166 |
||
5167 |
compareChange:changeNr showResult:doShowResult |
|
5168 |
"compare a change with current version. |
|
18059 | 5169 |
Return the result of the compare |
5170 |
same -> true, |
|
5171 |
different -> false, |
|
5172 |
uncomparable -> nil. |
|
2835 | 5173 |
If doShowResult is true, the outcome is shown in a dialog/diffViewer." |
255 | 5174 |
|
15016 | 5175 |
|aStream chunk sawExcla parseTree thisClass cat oldSource newSource outcome showDiff d selector isLoaded beep superClass thisClassSym varsHere varsInChange addedVars removedVars |
9888 | 5176 |
isSame ownerClass superClassHere superClassInChange sameAndOutcome| |
255 | 5177 |
|
5178 |
aStream := self streamForChange:changeNr. |
|
2835 | 5179 |
aStream isNil ifTrue:[^ nil]. |
255 | 5180 |
|
275
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
5181 |
showDiff := false. |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
5182 |
|
1472 | 5183 |
(self changeIsFollowupMethodChange:changeNr) ifFalse:[ |
6357 | 5184 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
5185 |
chunk := aStream nextChunk. |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
5186 |
] ifTrue:[ |
16372 | 5187 |
chunk := self changeChunkAt:changeNr. |
6357 | 5188 |
sawExcla := true. |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
5189 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
5190 |
|
2835 | 5191 |
isSame := nil. |
5192 |
||
761 | 5193 |
beep := false. |
255 | 5194 |
sawExcla ifFalse:[ |
6357 | 5195 |
outcome := 'cannot compare this change\\(i.e. this is not a method change).'. |
5196 |
||
5197 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
|
5198 |
do:[ |
|
8665 | 5199 |
parseTree := self parseExpression:chunk. |
6357 | 5200 |
]. |
5201 |
(parseTree notNil and:[parseTree ~~ #Error and:[ parseTree isMessage ]]) ifTrue:[ |
|
5202 |
selector := parseTree selector. |
|
5203 |
||
5204 |
selector == #'removeSelector:' ifTrue:[ |
|
7953 | 5205 |
sameAndOutcome := self compareRemoveSelectorChange:parseTree. |
5206 |
isSame := sameAndOutcome key. |
|
5207 |
outcome := sameAndOutcome value. |
|
5208 |
]. |
|
5209 |
selector == #'package:' ifTrue:[ |
|
5210 |
sameAndOutcome := self comparePackageChange:parseTree. |
|
5211 |
isSame := sameAndOutcome key. |
|
5212 |
outcome := sameAndOutcome value. |
|
6357 | 5213 |
]. |
5214 |
selector == #'category:' ifTrue:[ |
|
7953 | 5215 |
sameAndOutcome := self compareCategoryChange:parseTree. |
5216 |
isSame := sameAndOutcome key. |
|
5217 |
outcome := sameAndOutcome value. |
|
6357 | 5218 |
]. |
5219 |
selector == #'comment:' ifTrue:[ |
|
7953 | 5220 |
sameAndOutcome := self compareCommentChange:parseTree. |
5221 |
isSame := sameAndOutcome key. |
|
5222 |
outcome := sameAndOutcome value. |
|
6357 | 5223 |
]. |
5224 |
||
5225 |
selector == #'instanceVariableNames:' ifTrue:[ |
|
7953 | 5226 |
sameAndOutcome := self compareInstanceVariableNamesChange:parseTree. |
5227 |
isSame := sameAndOutcome key. |
|
5228 |
outcome := sameAndOutcome value. |
|
6357 | 5229 |
]. |
5230 |
||
5231 |
(Class definitionSelectors includes:selector) |
|
5232 |
"/ selector == #'subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:' |
|
5233 |
ifTrue:[ |
|
9888 | 5234 |
[ |
5235 |
superClass := parseTree receiver evaluate. |
|
5236 |
] on:Parser undefinedVariableError do:[:ex| ]. |
|
6357 | 5237 |
superClass isBehavior ifFalse:[ |
5238 |
outcome := 'Cannot compare this change\\(superclass not loaded).'. |
|
5239 |
isSame := nil. |
|
5240 |
] ifTrue:[ |
|
5241 |
(self checkClassIsLoaded:superClass) ifTrue:[ |
|
5242 |
thisClassSym := (parseTree arguments at:1) evaluate. |
|
5243 |
||
5244 |
(selector endsWith:':privateIn:') ifTrue:[ |
|
11475
b6fdfe902263
changed: #compareChange:showResult:
Stefan Vogel <sv@exept.de>
parents:
11397
diff
changeset
|
5245 |
Parser undefinedVariableError catch:[ |
b6fdfe902263
changed: #compareChange:showResult:
Stefan Vogel <sv@exept.de>
parents:
11397
diff
changeset
|
5246 |
ownerClass := (parseTree arguments at:5) evaluate. |
b6fdfe902263
changed: #compareChange:showResult:
Stefan Vogel <sv@exept.de>
parents:
11397
diff
changeset
|
5247 |
ownerClass isBehavior ifTrue:[ |
b6fdfe902263
changed: #compareChange:showResult:
Stefan Vogel <sv@exept.de>
parents:
11397
diff
changeset
|
5248 |
thisClass := ownerClass privateClassesAt:thisClassSym. |
b6fdfe902263
changed: #compareChange:showResult:
Stefan Vogel <sv@exept.de>
parents:
11397
diff
changeset
|
5249 |
]. |
6357 | 5250 |
]. |
5251 |
] ifFalse:[ |
|
5252 |
thisClass := (self nameSpaceForApply) at:thisClassSym ifAbsent:nil. |
|
5253 |
]. |
|
5254 |
thisClass isNil ifTrue:[ |
|
5255 |
outcome := 'Change defines the class: ' , thisClassSym allBold. |
|
5256 |
isSame := false. |
|
5257 |
] ifFalse:[ |
|
5258 |
(isLoaded := self checkClassIsLoaded:thisClass) ifFalse:[ |
|
5259 |
outcome := 'Cannot compare this change\\(compare requires class to be loaded).'. |
|
5260 |
isSame := nil. |
|
5261 |
] ifTrue:[ |
|
5262 |
superClassHere := thisClass superclass name. |
|
5263 |
superClassInChange := parseTree receiver name. |
|
5264 |
superClassHere ~~ superClassInChange ifTrue:[ |
|
5265 |
outcome := 'Superclass is different.'. |
|
5266 |
isSame := false. |
|
5267 |
] ifFalse:[ |
|
5268 |
varsHere := thisClass instanceVariableString asCollectionOfWords. |
|
5269 |
varsInChange := (parseTree arguments at:2) evaluate asCollectionOfWords. |
|
5270 |
varsHere = varsInChange ifTrue:[ |
|
5271 |
thisClass classVariableString asCollectionOfWords = (parseTree arguments at:3) evaluate asCollectionOfWords ifTrue:[ |
|
9689
72819fbf329a
changed: #compareChange:showResult:
Claus Gittinger <cg@exept.de>
parents:
9621
diff
changeset
|
5272 |
((thisClass sharedPoolNames size == 0) and:[(parseTree arguments at:4) evaluate = '']) ifTrue:[ |
6357 | 5273 |
((selector endsWith:':category:') |
5274 |
and:[thisClass category ~= (parseTree arguments at:5) evaluate]) ifTrue:[ |
|
5275 |
outcome := 'Category is different'. |
|
5276 |
isSame := false. |
|
5277 |
] ifFalse:[ |
|
5278 |
outcome := 'Change has no effect\\(same definition)'. |
|
5279 |
isSame := true. |
|
5280 |
] |
|
4296
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5281 |
"/ thisClass category = (parseTree arguments at:5) evaluate ifTrue:[ |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5282 |
"/ outcome := 'Change has no effect\\(same definition)'. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5283 |
"/ isSame := true. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5284 |
"/ ] ifFalse:[ |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5285 |
"/ outcome := 'Category is different'. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5286 |
"/ isSame := false. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5287 |
"/ ] |
6357 | 5288 |
] ifFalse:[ |
5289 |
outcome := 'SharedPool definition is different'. |
|
5290 |
isSame := false. |
|
5291 |
]. |
|
5292 |
] ifFalse:[ |
|
5293 |
outcome := 'ClassVariable definition is different'. |
|
5294 |
isSame := false. |
|
5295 |
] |
|
5296 |
] ifFalse:[ |
|
5297 |
outcome := 'InstanceVariable definition is different'. |
|
5298 |
isSame := false. |
|
12825 | 5299 |
addedVars := varsInChange reject:[:eachVar | (varsHere includes:eachVar)]. |
5300 |
removedVars := varsHere reject:[:eachVar | (varsInChange includes:eachVar)]. |
|
6357 | 5301 |
addedVars isEmpty ifTrue:[ |
5302 |
removedVars isEmpty ifTrue:[ |
|
5303 |
outcome := 'Change reorders instanceVariable(s)'. |
|
5304 |
] ifFalse:[ |
|
5305 |
removedVars := removedVars collect:[:eachVar | '''' , eachVar , '''']. |
|
5306 |
outcome := 'Change removes instanceVariable(s): ' , (removedVars asStringWith:Character space) allBold. |
|
5307 |
] |
|
5308 |
] ifFalse:[ |
|
5309 |
removedVars isEmpty ifTrue:[ |
|
5310 |
addedVars := addedVars collect:[:eachVar | '''' , eachVar , '''']. |
|
5311 |
outcome := 'Change adds instanceVariable(s): ' , (addedVars asStringWith:Character space) allBold. |
|
5312 |
]. |
|
5313 |
]. |
|
5314 |
] |
|
5315 |
] |
|
5316 |
] |
|
5317 |
] |
|
5318 |
] |
|
5319 |
] |
|
5320 |
] |
|
5321 |
] |
|
255 | 5322 |
] ifTrue:[ |
15016 | 5323 |
Class nameSpaceQuerySignal |
5324 |
answer:(self nameSpaceForApply) |
|
5325 |
do:[ |
|
5326 |
parseTree := self parseExpression:chunk. |
|
5327 |
]. |
|
5328 |
||
6357 | 5329 |
(parseTree notNil |
5330 |
and:[parseTree ~~ #Error |
|
5331 |
and:[parseTree isMessage]]) ifTrue:[ |
|
5332 |
"/ Squeak support (#methodsFor:***) |
|
5333 |
(#( |
|
5334 |
#methodsFor: |
|
5335 |
#privateMethodsFor: |
|
5336 |
#publicMethodsFor: |
|
5337 |
#ignoredMethodsFor: |
|
5338 |
#protectedMethodsFor: |
|
5339 |
||
5340 |
#methodsFor:stamp: "/ Squeak support |
|
5341 |
#methodsFor "/ Dolphin support |
|
5342 |
#methods "/ STV support |
|
5343 |
) |
|
5344 |
includes:parseTree selector) ifTrue:[ |
|
9888 | 5345 |
[ |
5346 |
thisClass := parseTree receiver evaluate. |
|
5347 |
] on:Parser undefinedVariableError do:[:ex| |
|
5348 |
outcome := 'Cannot compare this change\\(compare requires class to be loaded).'. |
|
5349 |
isSame := nil. |
|
5350 |
]. |
|
5351 |
thisClass notNil ifTrue:[ |
|
5352 |
(thisClass isKindOf:UndefinedVariable) ifTrue:[ |
|
6357 | 5353 |
|thisName path| |
5354 |
||
5355 |
thisName := thisClass name. |
|
5356 |
path := thisName asCollectionOfSubstringsSeparatedByAll:'::'. |
|
5357 |
1 to:path size do:[:length | |
|
5358 |
|ownerName owner| |
|
5359 |
||
5360 |
ownerName := (path copyTo:length) asStringCollection asStringWith:'::'. |
|
6820
4e8815b9e661
Do not autoload class when comparing changes.
Stefan Vogel <sv@exept.de>
parents:
6682
diff
changeset
|
5361 |
owner := Smalltalk loadedClassNamed:ownerName. |
6357 | 5362 |
(owner notNil and:[owner isBehavior and:[owner isLoaded not]]) ifTrue:[ |
5363 |
self checkClassIsLoaded:owner. |
|
5364 |
]. |
|
5365 |
]. |
|
9888 | 5366 |
thisClass := parseTree receiver evaluate. |
6357 | 5367 |
]. |
5368 |
||
5369 |
thisClass isBehavior ifTrue:[ |
|
5370 |
parseTree selector == #methodsFor ifTrue:[ |
|
5371 |
cat := 'Dolphin methods'. |
|
5372 |
] ifFalse:[ |
|
5373 |
parseTree selector == #methods ifTrue:[ |
|
5374 |
cat := 'STV methods'. |
|
5375 |
] ifFalse:[ |
|
5376 |
cat := parseTree arg1 evaluate. |
|
5377 |
]. |
|
5378 |
]. |
|
5379 |
newSource := aStream nextChunk. |
|
5380 |
||
15016 | 5381 |
isSame := self |
5382 |
compareMethodSource:newSource |
|
5383 |
withVersionInClass:thisClass |
|
5384 |
into:[:outcomeResult :beepResult :oldSourceResult| |
|
5385 |
outcome := outcomeResult. |
|
5386 |
beep := beepResult. |
|
5387 |
oldSource := oldSourceResult. |
|
5388 |
]. |
|
5389 |
||
5390 |
isSame isNil ifTrue:[ |
|
5391 |
showDiff := false. |
|
5392 |
] ifFalse:[ |
|
5393 |
showDiff := isSame not. |
|
6357 | 5394 |
]. |
15016 | 5395 |
|
6357 | 5396 |
doShowResult ifTrue:[ |
5397 |
(showDiff and:[oldSource notNil and:[newSource notNil]]) ifTrue:[ |
|
8102 | 5398 |
d := DiffCodeView |
6639 | 5399 |
openOn:oldSource label:(resources string:'Current version (in image)') |
5400 |
and:newSource label:(resources string:'Change version'). |
|
6357 | 5401 |
d label:'method differences'. |
5402 |
] |
|
5403 |
] |
|
5404 |
] ifFalse:[ |
|
5405 |
beep := true. |
|
5406 |
outcome := 'Class does not exist.'. |
|
5407 |
isSame := nil. |
|
5408 |
] |
|
9888 | 5409 |
]] ifFalse:[ |
6357 | 5410 |
beep := true. |
5411 |
outcome := 'Not comparable.'. |
|
5412 |
isSame := nil. |
|
5413 |
] |
|
5414 |
] ifFalse:[ |
|
5415 |
beep := true. |
|
5416 |
outcome := 'Not comparable.'. |
|
5417 |
isSame := nil. |
|
5418 |
] |
|
255 | 5419 |
]. |
5420 |
aStream close. |
|
2835 | 5421 |
|
5422 |
doShowResult ifTrue:[ |
|
6357 | 5423 |
showDiff ifFalse:[ |
5424 |
outcome := (resources stringWithCRs:outcome). |
|
5425 |
beep ifTrue:[ |
|
5426 |
self warn:outcome. |
|
5427 |
] ifFalse:[ |
|
5428 |
self information:outcome. |
|
5429 |
] |
|
5430 |
]. |
|
255 | 5431 |
]. |
2835 | 5432 |
^ isSame. |
255 | 5433 |
|
9689
72819fbf329a
changed: #compareChange:showResult:
Claus Gittinger <cg@exept.de>
parents:
9621
diff
changeset
|
5434 |
"Created: / 24-11-1995 / 14:30:46 / cg" |
16372 | 5435 |
"Modified: / 01-05-2016 / 18:25:32 / cg" |
255 | 5436 |
! |
5437 |
||
7953 | 5438 |
compareCommentChange:parseTree |
5439 |
|thisClass| |
|
5440 |
||
9888 | 5441 |
[ |
5442 |
thisClass := parseTree receiver evaluate. |
|
5443 |
] on:Parser undefinedVariableError do:[:ex| ]. |
|
5444 |
||
7953 | 5445 |
thisClass isBehavior ifTrue:[ |
5446 |
(self checkClassIsLoaded:thisClass) ifTrue:[ |
|
5447 |
(thisClass comment = parseTree arg1 evaluate) ifTrue:[ |
|
5448 |
^ true -> 'Change has no effect\\(same comment)'. |
|
5449 |
] ifFalse:[ |
|
5450 |
^ false -> 'Comment is different'. |
|
5451 |
] |
|
5452 |
] ifFalse:[ |
|
5453 |
^ nil -> 'Cannot compare this change (compare requires class to be loaded).'. |
|
5454 |
] |
|
5455 |
]. |
|
5456 |
^ nil -> 'Cannot compare this change (class not present)'. |
|
5457 |
! |
|
5458 |
||
5459 |
compareInstanceVariableNamesChange:parseTree |
|
5460 |
|receiverExpression thisClass varsHere varsInChange | |
|
5461 |
||
5462 |
receiverExpression := parseTree receiver. |
|
5463 |
receiverExpression isMessage ifTrue:[ |
|
5464 |
receiverExpression selector == #class ifTrue:[ |
|
9888 | 5465 |
[ |
5466 |
thisClass := receiverExpression evaluate. |
|
5467 |
] on:Parser undefinedVariableError do:[:ex| |
|
5468 |
^ nil -> 'Class is not loaded'. |
|
5469 |
]. |
|
5470 |
||
7953 | 5471 |
varsHere := thisClass instanceVariableString asCollectionOfWords. |
5472 |
varsInChange := (parseTree arguments at:1) evaluate asCollectionOfWords. |
|
5473 |
varsHere = varsInChange ifTrue:[ |
|
5474 |
^ true -> 'Change has no effect\\(same definition)'. |
|
5475 |
] ifFalse:[ |
|
5476 |
^ false -> 'Class-instanceVariable definition is different'. |
|
5477 |
]. |
|
5478 |
]. |
|
5479 |
]. |
|
5480 |
^ nil -> 'Unhandled receiver' |
|
5481 |
! |
|
5482 |
||
15016 | 5483 |
compareMethodSource:newSource withVersionInClass:thisClass into:aThreeArgBlock |
5484 |
"returns true/false/nil if same,different,undecided; |
|
5485 |
also provides a message and a beep-boolean via the passed in block" |
|
5486 |
||
17579 | 5487 |
<ignore: RBReturnsBooleanAndOtherRule rationale: 'done by purpose' author: 'cg'> |
5488 |
||
15016 | 5489 |
|parser sel oldMethod oldSource outcome t1 t2 isLoaded| |
5490 |
||
5491 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
|
5492 |
do:[ |
|
5493 |
parser := Parser parseMethod:newSource in:thisClass. |
|
5494 |
]. |
|
5495 |
(parser isNil or:[parser == #Error]) ifTrue:[ |
|
5496 |
outcome := 'Change is unparsable (parse error).'. |
|
5497 |
aThreeArgBlock value:outcome value:true "beep" value:nil. |
|
5498 |
^ nil. |
|
5499 |
]. |
|
5500 |
||
5501 |
sel := parser selector. |
|
5502 |
oldMethod := thisClass compiledMethodAt:sel. |
|
5503 |
oldMethod isNil ifTrue:[ |
|
5504 |
(isLoaded := self checkClassIsLoaded:thisClass) ifFalse:[ |
|
5505 |
outcome := 'Cannot compare this change\\(compare requires class to be loaded).'. |
|
5506 |
] ifTrue:[ |
|
5507 |
outcome := 'Method does not exist.'. |
|
5508 |
]. |
|
5509 |
aThreeArgBlock value:outcome value:true "beep" value:nil. |
|
5510 |
^ nil. |
|
5511 |
]. |
|
5512 |
||
5513 |
oldSource := oldMethod source. |
|
5514 |
oldSource isNil ifTrue:[ |
|
5515 |
outcome := 'No source for compare.'. |
|
5516 |
aThreeArgBlock value:outcome value:true "beep" value:nil. |
|
5517 |
^ nil. |
|
5518 |
]. |
|
5519 |
(oldSource = newSource) ifTrue:[ |
|
5520 |
outcome := 'Same source'. |
|
5521 |
aThreeArgBlock value:outcome value:false "beep" value:oldSource. |
|
5522 |
^ true. |
|
5523 |
]. |
|
5524 |
||
5525 |
"/ |
|
5526 |
"/ compare for tabulator <-> space changes |
|
5527 |
"/ before showing diff ... |
|
5528 |
"/ |
|
5529 |
t1 := oldSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
5530 |
t2 := newSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
5531 |
t1 = t2 ifTrue:[ |
|
5532 |
outcome := 'Same source'. |
|
5533 |
aThreeArgBlock value:outcome value:false "beep" value:oldSource. |
|
5534 |
^ true. |
|
5535 |
]. |
|
5536 |
||
5537 |
"/ |
|
5538 |
"/ check if only historyLine diffs |
|
5539 |
"/ |
|
5540 |
(HistoryManager notNil |
|
5541 |
and:[HistoryManager isActive]) ifTrue:[ |
|
5542 |
(HistoryManager withoutHistoryLines:newSource) |
|
5543 |
= |
|
5544 |
(HistoryManager withoutHistoryLines:oldSource) |
|
5545 |
ifTrue:[ |
|
5546 |
outcome := 'Same source (history only)'. |
|
5547 |
aThreeArgBlock value:outcome value:false "beep" value:oldSource. |
|
5548 |
^ true. |
|
5549 |
] |
|
5550 |
]. |
|
5551 |
||
5552 |
outcome := 'Source changed.'. |
|
5553 |
aThreeArgBlock value:outcome value:false "beep" value:oldSource. |
|
5554 |
^ false. |
|
17579 | 5555 |
|
5556 |
"Modified: / 16-07-2017 / 13:32:05 / cg" |
|
15016 | 5557 |
! |
5558 |
||
7953 | 5559 |
comparePackageChange:parseTree |
9888 | 5560 |
|receiverExpression method thisClass| |
7953 | 5561 |
|
5562 |
receiverExpression := parseTree receiver. |
|
5563 |
receiverExpression isMessage ifTrue:[ |
|
5564 |
receiverExpression selector == #compiledMethodAt: ifTrue:[ |
|
9888 | 5565 |
[ |
5566 |
thisClass := receiverExpression receiver evaluate. |
|
5567 |
] on:Parser undefinedVariableError do:[:ex| ]. |
|
5568 |
(thisClass isBehavior |
|
7953 | 5569 |
and:[(method := receiverExpression evaluate) isMethod]) ifTrue:[ |
5570 |
method package = parseTree arg1 evaluate ifTrue:[ |
|
5571 |
^ true -> 'Change has no effect\\(same package)'. |
|
5572 |
] ifFalse:[ |
|
8000 | 5573 |
^ false -> ('Package is different (''<1p>'' vs. ''<2p>'')' expandMacrosWith:method package with:parseTree arg1 evaluate). |
7953 | 5574 |
] |
5575 |
] ifFalse:[ |
|
5576 |
^ nil -> 'There is no such method'. |
|
5577 |
] |
|
5578 |
] |
|
5579 |
]. |
|
5580 |
^ nil -> 'Unhandled receiver' |
|
5581 |
! |
|
5582 |
||
5583 |
compareRemoveSelectorChange:parseTree |
|
5584 |
|thisClass selector| |
|
5585 |
||
9888 | 5586 |
[ |
5587 |
thisClass := parseTree receiver evaluate. |
|
5588 |
] on:Parser undefinedVariableError do:[:ex| ]. |
|
5589 |
||
7953 | 5590 |
thisClass isBehavior ifTrue:[ |
5591 |
(self checkClassIsLoaded:thisClass) ifTrue:[ |
|
5592 |
selector := (parseTree arg1 evaluate). |
|
5593 |
(thisClass includesSelector:selector) ifTrue:[ |
|
8000 | 5594 |
^ false -> ('Change removes the #' , selector , ' method from ' , thisClass name). |
7953 | 5595 |
] ifFalse:[ |
8000 | 5596 |
^ true -> ('Change has no effect\\(there is no method for #' , selector , ' in ' , thisClass name , ')'). |
7953 | 5597 |
] |
5598 |
] ifFalse:[ |
|
5599 |
^ nil -> 'Cannot compare this change (compare requires class to be loaded).'. |
|
5600 |
] |
|
5601 |
]. |
|
5602 |
^ nil -> 'Cannot compare this change (class not present)'. |
|
5603 |
! |
|
5604 |
||
1359 | 5605 |
compressForClass:aClassNameOrNil |
6288 | 5606 |
"compress the change-set; |
1359 | 5607 |
this replaces multiple method-changes by the last (i.e. the most recent) change. |
5608 |
If the class argument is nil, compress for all classes. |
|
5609 |
otherwise, only changes for that class are compressed." |
|
5610 |
||
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5611 |
self |
6288 | 5612 |
compressForClass:aClassNameOrNil selector:nil |
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5613 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5614 |
"Modified: / 19.11.2001 / 22:04:12 / cg" |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5615 |
! |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5616 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5617 |
compressForClass:aClassNameOrNil selector:selectorToCompressOrNil |
6288 | 5618 |
"compress the change-set; |
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5619 |
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
|
5620 |
If the class argument is nil, compress for all classes. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5621 |
otherwise, only changes for that class are compressed." |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5622 |
|
6288 | 5623 |
|lbl aStream searchIndex anyMore deleteSet index |
7507 | 5624 |
str snapshotProto snapshotPrefix snapshotNameIndex| |
5625 |
||
5626 |
changeFileName notNil ifTrue:[ |
|
5627 |
aStream := changeFileName asFilename readStreamOrNil. |
|
5628 |
aStream isNil ifTrue:[^ self]. |
|
5629 |
]. |
|
1359 | 5630 |
|
4762 | 5631 |
lbl := 'compressing'. |
1359 | 5632 |
aClassNameOrNil isNil ifTrue:[ |
7507 | 5633 |
selectorToCompressOrNil notNil ifTrue:[ |
5634 |
lbl := lbl , ' for ' , selectorToCompressOrNil. |
|
5635 |
] |
|
1359 | 5636 |
] ifFalse:[ |
7507 | 5637 |
selectorToCompressOrNil isNil ifTrue:[ |
5638 |
lbl := lbl , ' for ' , aClassNameOrNil. |
|
5639 |
] ifFalse:[ |
|
5640 |
lbl := lbl , ' for ' , aClassNameOrNil , '>>' , selectorToCompressOrNil. |
|
5641 |
] |
|
1359 | 5642 |
]. |
6288 | 5643 |
lbl := lbl , '...'. |
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5644 |
self newLabel:lbl. |
1359 | 5645 |
|
5646 |
CompressSnapshotInfo == true ifTrue:[ |
|
7507 | 5647 |
" |
5648 |
get a prototype snapshot record (to be independent of |
|
5649 |
the actual format .. |
|
5650 |
" |
|
16877 | 5651 |
str := WriteStream on:''. |
7507 | 5652 |
Class addChangeRecordForSnapshot:'foo' to:str. |
5653 |
snapshotProto := str contents. |
|
5654 |
snapshotPrefix := snapshotProto copyTo:10. |
|
5655 |
snapshotNameIndex := snapshotProto findString:'foo'. |
|
1359 | 5656 |
]. |
5657 |
||
5658 |
self withExecuteCursorDo:[ |
|
7507 | 5659 |
|numChanges classes selectors types excla sawExcla |
5660 |
chunk aParseTree parseTreeChunk |
|
5661 |
thisClass thisSelector codeChunk codeParser |
|
5662 |
compressThis fileName| |
|
5663 |
||
5664 |
numChanges := self numberOfChanges. |
|
5665 |
classes := Array new:numChanges. |
|
5666 |
selectors := Array new:numChanges. |
|
5667 |
types := Array new:numChanges. |
|
5668 |
||
5669 |
"starting at the end, get the change class and change selector; |
|
5670 |
collect all in classes / selectors" |
|
5671 |
||
5672 |
aStream notNil ifTrue:[ |
|
5673 |
excla := aStream class chunkSeparator. |
|
5674 |
numChanges to:1 by:-1 do:[:changeNr | |
|
16372 | 5675 |
aStream position:((changeInfoList at:changeNr) position)-1. |
7507 | 5676 |
sawExcla := aStream peekFor:excla. |
5677 |
chunk := aStream nextChunk. |
|
5678 |
sawExcla ifTrue:[ |
|
5679 |
"optimize a bit if multiple methods for same category arrive" |
|
5680 |
(chunk = parseTreeChunk) ifFalse:[ |
|
8665 | 5681 |
aParseTree := self parseExpression:chunk. |
7507 | 5682 |
parseTreeChunk := chunk |
5683 |
]. |
|
5684 |
(aParseTree notNil |
|
5685 |
and:[(aParseTree ~~ #Error) |
|
5686 |
and:[aParseTree isMessage]]) ifTrue:[ |
|
5687 |
(#( |
|
5688 |
#methodsFor: |
|
5689 |
#privateMethodsFor: |
|
5690 |
#publicMethodsFor: |
|
5691 |
#ignoredMethodsFor: |
|
5692 |
#protectedMethodsFor: |
|
5693 |
#methodsFor:stamp: "/ Squeak support |
|
5694 |
#methodsFor "/ Dolphin support |
|
5695 |
#methods "/ STV support |
|
5696 |
) |
|
5697 |
includes:aParseTree selector) ifTrue:[ |
|
5698 |
codeChunk := aStream nextChunk. |
|
9543
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5699 |
[ |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5700 |
thisClass := aParseTree receiver evaluate. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5701 |
codeParser := Parser |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5702 |
parseMethodSpecification:codeChunk |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5703 |
in:thisClass |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5704 |
ignoreErrors:true |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5705 |
ignoreWarnings:true. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5706 |
(codeParser notNil and:[codeParser ~~ #Error]) ifTrue:[ |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5707 |
selectors at:changeNr put:(codeParser selector). |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5708 |
classes at:changeNr put:thisClass. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5709 |
types at:changeNr put:#methodsFor |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5710 |
] |
18133 | 5711 |
] on:ParseError do:[:ex| |
9543
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5712 |
"ignore chunk" |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5713 |
ex return. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5714 |
]. |
7507 | 5715 |
] |
5716 |
] |
|
5717 |
] ifFalse:[ |
|
8665 | 5718 |
aParseTree := self parseExpression:chunk. |
7507 | 5719 |
parseTreeChunk := chunk. |
5720 |
(aParseTree notNil |
|
5721 |
and:[(aParseTree ~~ #Error) |
|
5722 |
and:[aParseTree isMessage]]) ifTrue:[ |
|
5723 |
(aParseTree selector == #removeSelector:) ifTrue:[ |
|
9543
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5724 |
[ |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5725 |
thisClass := aParseTree receiver evaluate. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5726 |
selectors at:changeNr put:(aParseTree arg1 value). |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5727 |
classes at:changeNr put:thisClass. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5728 |
types at:changeNr put:#removeSelector |
18133 | 5729 |
] on:ParseError do:[:ex| |
9543
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5730 |
"ignore chunk" |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5731 |
ex return. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5732 |
]. |
7507 | 5733 |
] |
5734 |
] ifFalse:[ |
|
5735 |
CompressSnapshotInfo == true ifTrue:[ |
|
5736 |
(chunk startsWith:snapshotPrefix) ifTrue:[ |
|
13314 | 5737 |
str := chunk readStream position:snapshotNameIndex-1. |
7507 | 5738 |
fileName := str upTo:(Character space). |
5739 |
" |
|
5740 |
kludge to allow use of match-check below |
|
5741 |
" |
|
5742 |
selectors at:changeNr put:snapshotPrefix. |
|
5743 |
classes at:changeNr put:fileName. |
|
5744 |
] |
|
5745 |
] |
|
5746 |
] |
|
5747 |
]. |
|
5748 |
]. |
|
5749 |
aStream close. |
|
5750 |
] ifFalse:[ |
|
5751 |
numChanges to:1 by:-1 do:[:changeNr | |
|
5752 |
|change| |
|
5753 |
||
5754 |
classes at:changeNr put:(self classOfChange:changeNr ifAbsent:[:className| nil]). |
|
5755 |
selectors at:changeNr put:(self selectorOfMethodChange:changeNr). |
|
5756 |
]. |
|
5757 |
]. |
|
5758 |
||
5759 |
"for all changes, look for another class/selector occurrence later |
|
5760 |
in the list and, if there is one, add change number to the delete set" |
|
5761 |
||
5762 |
deleteSet := OrderedCollection new. |
|
5763 |
1 to:self numberOfChanges-1 do:[:changeNr | |
|
5764 |
thisClass := classes at:changeNr. |
|
5765 |
||
5766 |
compressThis := false. |
|
5767 |
aClassNameOrNil isNil ifTrue:[ |
|
5768 |
compressThis := true |
|
5769 |
] ifFalse:[ |
|
5770 |
"/ skipping unloaded/unknown classes |
|
5771 |
thisClass isBehavior ifTrue:[ |
|
5772 |
compressThis := aClassNameOrNil = thisClass theNonMetaclass name. |
|
5773 |
] |
|
5774 |
]. |
|
5775 |
compressThis ifTrue:[ |
|
5776 |
thisSelector := selectors at:changeNr. |
|
5777 |
compressThis := (selectorToCompressOrNil isNil or:[thisSelector == selectorToCompressOrNil]). |
|
5778 |
compressThis ifTrue:[ |
|
5779 |
searchIndex := changeNr. |
|
5780 |
anyMore := true. |
|
5781 |
[anyMore] whileTrue:[ |
|
5782 |
searchIndex := classes indexOf:thisClass startingAt:(searchIndex + 1). |
|
5783 |
(searchIndex ~~ 0) ifTrue:[ |
|
5784 |
((selectors at:searchIndex) == thisSelector) ifTrue:[ |
|
5785 |
thisClass notNil ifTrue:[ |
|
5786 |
deleteSet add:changeNr. |
|
5787 |
anyMore := false |
|
5788 |
] |
|
5789 |
] |
|
5790 |
] ifFalse:[ |
|
5791 |
anyMore := false |
|
5792 |
] |
|
5793 |
]. |
|
5794 |
]. |
|
5795 |
]. |
|
5796 |
]. |
|
5797 |
||
5798 |
"finally delete what has been found" |
|
5799 |
||
5800 |
(deleteSet size > 0) ifTrue:[ |
|
18059 | 5801 |
self unselect. |
7507 | 5802 |
index := deleteSet size. |
5803 |
[index > 0] whileTrue:[ |
|
5804 |
self silentDeleteChange:(deleteSet at:index). |
|
5805 |
index := index - 1 |
|
5806 |
]. |
|
18059 | 5807 |
self updateChangeList. |
7507 | 5808 |
" |
5809 |
scroll back a bit, if we are left way behind the list |
|
5810 |
" |
|
5811 |
changeListView firstLineShown > self numberOfChanges ifTrue:[ |
|
5812 |
changeListView makeLineVisible:self numberOfChanges |
|
5813 |
]. |
|
5814 |
self clearCodeView |
|
5815 |
] |
|
1359 | 5816 |
]. |
5817 |
self newLabel:''. |
|
5818 |
||
7507 | 5819 |
"Created: / 19-11-2001 / 22:03:42 / cg" |
16372 | 5820 |
"Modified: / 01-05-2016 / 19:23:54 / cg" |
1359 | 5821 |
! |
5822 |
||
255 | 5823 |
deleteChange:changeNr |
5824 |
"delete a change" |
|
5825 |
||
5826 |
self deleteChangesFrom:changeNr to:changeNr |
|
5827 |
! |
|
5828 |
||
5829 |
deleteChangesFrom:start to:stop |
|
5830 |
"delete a range of changes" |
|
5831 |
||
18059 | 5832 |
self unselect. |
255 | 5833 |
stop to:start by:-1 do:[:changeNr | |
18059 | 5834 |
self silentDeleteInternalChange:changeNr. |
255 | 5835 |
]. |
6255 | 5836 |
changeListView removeFromIndex:start toIndex:stop. |
744
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
5837 |
|
1070
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
5838 |
"/ changeListView contentsChanged. |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
5839 |
"/ changeListView redrawFromLine:start. |
255 | 5840 |
|
744
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
5841 |
"/ self setChangeList |
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
5842 |
|
1648 | 5843 |
"Modified: / 18.5.1998 / 14:22:27 / cg" |
255 | 5844 |
! |
5845 |
||
202 | 5846 |
makeChangeAPatch:changeNr |
5847 |
"append change to patchfile" |
|
5848 |
||
5849 |
self appendChange:changeNr toFile:'patches' |
|
5850 |
! |
|
5851 |
||
5852 |
makeChangePermanent:changeNr |
|
5853 |
"rewrite the source file where change changeNr lies" |
|
5854 |
||
5855 |
self notify:'this is not yet implemented' |
|
5856 |
! |
|
5857 |
||
73 | 5858 |
silentDeleteChange:changeNr |
5859 |
"delete a change do not update changeListView" |
|
57 | 5860 |
|
73 | 5861 |
anyChanges := true. |
16372 | 5862 |
changeInfoList removeIndex:changeNr. |
5863 |
"/ changeChunks removeIndex:changeNr. |
|
5864 |
"/ changePositions size >= changeNr ifTrue:[ changePositions removeIndex:changeNr ]. |
|
5865 |
"/ changeClassNames size >= changeNr ifTrue:[ changeClassNames removeIndex:changeNr ]. |
|
5866 |
"/ changeSelectors size >= changeNr ifTrue:[ changeSelectors removeIndex:changeNr ]. |
|
5867 |
"/ changeHeaderLines size >= changeNr ifTrue:[ changeHeaderLines removeIndex:changeNr ]. |
|
5868 |
"/ changeTimeStamps size >= changeNr ifTrue:[ changeTimeStamps removeIndex:changeNr ]. |
|
5869 |
"/ changeIsFollowupMethodChange size >= changeNr ifTrue:[ changeIsFollowupMethodChange removeIndex:changeNr ]. |
|
5870 |
||
5871 |
"Modified: / 01-05-2016 / 19:20:40 / cg" |
|
45 | 5872 |
! |
5873 |
||
202 | 5874 |
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
|
5875 |
"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
|
5876 |
Return the number of deleted changes." |
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5877 |
|
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5878 |
|thisClassName index numDeleted| |
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5879 |
|
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5880 |
numDeleted := 0. |
202 | 5881 |
index := stop. |
5882 |
[index >= start] whileTrue:[ |
|
6288 | 5883 |
thisClassName := self classNameOfChange:index. |
5884 |
thisClassName = aClassName ifTrue:[ |
|
5885 |
self silentDeleteChange:index. |
|
5886 |
numDeleted := numDeleted + 1. |
|
5887 |
]. |
|
5888 |
index := index - 1 |
|
1428
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5889 |
]. |
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5890 |
^ numDeleted |
51 | 5891 |
|
45 | 5892 |
! |
5893 |
||
3607 | 5894 |
silentDeleteChangesFor:aClassName selector:selector from:start to:stop |
5895 |
"delete changes for given class/selector in a range. |
|
5896 |
Return the number of deleted changes." |
|
5897 |
||
5898 |
|thisClassName index numDeleted| |
|
5899 |
||
5900 |
numDeleted := 0. |
|
5901 |
index := stop. |
|
5902 |
[index >= start] whileTrue:[ |
|
17600 | 5903 |
thisClassName := self realClassNameOfChange:index. |
5904 |
thisClassName = aClassName ifTrue:[ |
|
5905 |
(self selectorOfMethodChange:index) == selector ifTrue:[ |
|
5906 |
self silentDeleteChange:index. |
|
5907 |
numDeleted := numDeleted + 1. |
|
5908 |
] |
|
5909 |
]. |
|
5910 |
index := index - 1 |
|
3607 | 5911 |
]. |
5912 |
^ numDeleted |
|
5913 |
! |
|
5914 |
||
2511 | 5915 |
silentDeleteChangesForClassAndPrivateClasses:aClassName from:start to:stop |
5916 |
"delete changes for a given class and its private classes in a range. |
|
5917 |
Return the number of deleted changes." |
|
5918 |
||
5919 |
|thisClassName index numDeleted| |
|
5920 |
||
5921 |
numDeleted := 0. |
|
5922 |
index := stop. |
|
5923 |
[index >= start] whileTrue:[ |
|
6288 | 5924 |
thisClassName := self ownerClassNameOfChange:index. |
5925 |
thisClassName = aClassName ifTrue:[ |
|
5926 |
self silentDeleteChange:index. |
|
5927 |
numDeleted := numDeleted + 1. |
|
5928 |
]. |
|
5929 |
index := index - 1 |
|
2511 | 5930 |
]. |
5931 |
^ numDeleted |
|
5932 |
||
5933 |
! |
|
5934 |
||
12428 | 5935 |
silentDeleteChangesForNamespace:aNamespace from:start to:stop |
5936 |
"delete changes for a given namespace in a range. |
|
5937 |
Return the number of deleted changes." |
|
5938 |
||
5939 |
|thisNamespace index numDeleted| |
|
5940 |
||
5941 |
numDeleted := 0. |
|
5942 |
index := stop. |
|
5943 |
[index >= start] whileTrue:[ |
|
5944 |
thisNamespace := self namespaceOfChange:index. |
|
5945 |
thisNamespace = aNamespace ifTrue:[ |
|
5946 |
self silentDeleteChange:index. |
|
5947 |
numDeleted := numDeleted + 1. |
|
5948 |
]. |
|
5949 |
index := index - 1 |
|
5950 |
]. |
|
5951 |
^ numDeleted |
|
5952 |
! |
|
5953 |
||
18596 | 5954 |
silentDeleteCheckinInfosFor:aClassName from:start to:stop |
5955 |
"delete checkn infos for given class in a range. |
|
5956 |
Return the number of deleted changes." |
|
5957 |
||
5958 |
|thisClassName index numDeleted| |
|
5959 |
||
5960 |
numDeleted := 0. |
|
5961 |
index := stop. |
|
5962 |
[index >= start] whileTrue:[ |
|
5963 |
thisClassName := self realClassNameOfChange:index. |
|
5964 |
thisClassName = aClassName ifTrue:[ |
|
5965 |
(self changeIsCheckinInfo:index) ifTrue:[ |
|
5966 |
self silentDeleteChange:index. |
|
5967 |
numDeleted := numDeleted + 1. |
|
5968 |
] |
|
5969 |
]. |
|
5970 |
index := index - 1 |
|
5971 |
]. |
|
5972 |
^ numDeleted |
|
5973 |
||
5974 |
"Created: / 15-02-2019 / 12:23:17 / Claus Gittinger" |
|
5975 |
! |
|
5976 |
||
5977 |
silentDeleteClassDefinitionChangesFor:aClassName from:start to:stop |
|
5978 |
"delete class definition changes for given class in a range. |
|
5979 |
Return the number of deleted changes." |
|
5980 |
||
5981 |
|thisClassName index numDeleted| |
|
5982 |
||
5983 |
numDeleted := 0. |
|
5984 |
index := stop. |
|
5985 |
[index >= start] whileTrue:[ |
|
5986 |
thisClassName := self realClassNameOfChange:index. |
|
5987 |
thisClassName = aClassName ifTrue:[ |
|
5988 |
(self isClassDefinitionChange:index) ifTrue:[ |
|
5989 |
self silentDeleteChange:index. |
|
5990 |
numDeleted := numDeleted + 1. |
|
5991 |
] |
|
5992 |
]. |
|
5993 |
index := index - 1 |
|
5994 |
]. |
|
5995 |
^ numDeleted |
|
5996 |
||
5997 |
"Created: / 15-02-2019 / 12:12:19 / Claus Gittinger" |
|
5998 |
! |
|
5999 |
||
1070
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
6000 |
silentDeleteInternalChange:changeNr |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
6001 |
"delete a change do not update changeListView" |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
6002 |
|
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
6003 |
anyChanges := true. |
16372 | 6004 |
changeInfoList removeIndex:changeNr. |
6005 |
"/ changeChunks removeIndex:changeNr. |
|
6006 |
"/ changePositions size >= changeNr ifTrue:[changePositions removeIndex:changeNr]. |
|
6007 |
"/ changeClassNames size >= changeNr ifTrue:[changeClassNames removeIndex:changeNr]. |
|
6008 |
"/ changeSelectors size >= changeNr ifTrue:[ changeSelectors removeIndex:changeNr ]. |
|
6009 |
"/ changeTimeStamps size >= changeNr ifTrue:[changeTimeStamps removeIndex:changeNr]. |
|
6010 |
"/ changeIsFollowupMethodChange size >= changeNr ifTrue:[changeIsFollowupMethodChange removeIndex:changeNr]. |
|
6011 |
||
6012 |
"Created: / 07-03-1997 / 16:28:32 / cg" |
|
6013 |
"Modified: / 26-02-1998 / 18:20:48 / stefan" |
|
6014 |
"Modified: / 01-05-2016 / 19:20:59 / cg" |
|
4487 | 6015 |
! |
6016 |
||
18059 | 6017 |
silentDeleteMethodCategoryChangesFor:aClassName selector:selector from:start to:stop |
6018 |
"delete method category changes for given class/selector in a range. |
|
6019 |
Return the number of deleted changes." |
|
6020 |
||
6021 |
|thisClassName index numDeleted| |
|
6022 |
||
6023 |
numDeleted := 0. |
|
6024 |
index := stop. |
|
6025 |
[index >= start] whileTrue:[ |
|
6026 |
thisClassName := self realClassNameOfChange:index. |
|
6027 |
thisClassName = aClassName ifTrue:[ |
|
6028 |
(self selectorOfMethodCategoryChange:index) == selector ifTrue:[ |
|
6029 |
self silentDeleteChange:index. |
|
6030 |
numDeleted := numDeleted + 1. |
|
6031 |
] |
|
6032 |
]. |
|
6033 |
index := index - 1 |
|
6034 |
]. |
|
6035 |
^ numDeleted |
|
6036 |
! |
|
6037 |
||
6038 |
silentDeleteMethodChangesFor:aClassName selector:selector from:start to:stop |
|
6039 |
"delete method changes for given class/selector in a range. |
|
6040 |
Return the number of deleted changes." |
|
6041 |
||
6042 |
|thisClassName index numDeleted| |
|
6043 |
||
6044 |
numDeleted := 0. |
|
6045 |
index := stop. |
|
6046 |
[index >= start] whileTrue:[ |
|
6047 |
thisClassName := self realClassNameOfChange:index. |
|
6048 |
thisClassName = aClassName ifTrue:[ |
|
6049 |
(self selectorOfMethodChange:index) == selector ifTrue:[ |
|
6050 |
self silentDeleteChange:index. |
|
6051 |
numDeleted := numDeleted + 1. |
|
6052 |
] |
|
6053 |
]. |
|
6054 |
index := index - 1 |
|
6055 |
]. |
|
6056 |
^ numDeleted |
|
6057 |
! |
|
6058 |
||
4487 | 6059 |
updateDiffView |
6060 |
self withSelectedChangesDo:[:changeNr | |
|
6288 | 6061 |
self updateDiffViewFor:changeNr. |
6062 |
^ self. |
|
4487 | 6063 |
]. |
6064 |
||
6065 |
diffView text1:'' text2:'' |
|
6066 |
! |
|
6067 |
||
6068 |
updateDiffViewFor:changeNr |
|
6069 |
|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
|
6070 |
parser sel showDiff selector oldMethod i| |
4487 | 6071 |
|
6072 |
aStream := self streamForChange:changeNr. |
|
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
6073 |
aStream isNil ifTrue:[ |
6317 | 6074 |
^ self |
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
6075 |
]. |
4487 | 6076 |
|
6077 |
showDiff := false. |
|
6078 |
||
6079 |
(self changeIsFollowupMethodChange:changeNr) ifFalse:[ |
|
6317 | 6080 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
6081 |
chunk := aStream nextChunk. |
|
4487 | 6082 |
] ifTrue:[ |
16372 | 6083 |
chunk := self changeChunkAt:changeNr. |
6317 | 6084 |
sawExcla := true. |
4487 | 6085 |
]. |
6086 |
||
4857 | 6087 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
6088 |
do:[ |
|
8665 | 6089 |
parseTree := self parseExpression:chunk. |
6317 | 6090 |
(parseTree notNil and:[parseTree ~~ #Error and:[ parseTree isMessage ]]) ifTrue:[ |
6091 |
selector := parseTree selector. |
|
6092 |
] |
|
4857 | 6093 |
]. |
6094 |
||
6095 |
selector isNil ifTrue:[ |
|
6317 | 6096 |
newSource := chunk. |
6097 |
oldSource := 'Not comparable.'. |
|
4857 | 6098 |
] ifFalse:[ |
6317 | 6099 |
sawExcla ifFalse:[ |
6100 |
"/ not a method-change |
|
6101 |
newSource := chunk. |
|
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
6102 |
oldSource := self currentSourceForParseTree:parseTree. |
6317 | 6103 |
] ifTrue:[ |
6104 |
"/ a method-change |
|
6105 |
||
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6106 |
(self class methodDefinitionSelectors includes:selector) ifTrue:[ |
6317 | 6107 |
newSource := aStream nextChunk. |
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
6108 |
thisClass := self classFromEvaluatingTree:parseTree receiver. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
6109 |
"/ Error |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
6110 |
"/ handle:[ ] |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
6111 |
"/ do:[ |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
6112 |
"/ thisClass := parseTree receiver evaluate. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
6113 |
"/ ]. |
6378 | 6114 |
thisClass isBehavior ifFalse:[ |
6115 |
thisClass := self classOfChange:changeNr. |
|
6116 |
]. |
|
6317 | 6117 |
thisClass isBehavior ifTrue:[ |
6118 |
(thisClass isLoaded |
|
6119 |
or:[ autoloadAsRequired value |
|
6120 |
and:[self checkClassIsLoaded:thisClass]]) ifFalse:[ |
|
6121 |
oldSource := 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
6122 |
] ifTrue:[ |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6123 |
selector numArgs == 0 ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6124 |
cat := '* as yet uncategorized *'. |
6532 | 6125 |
cat := selector. |
6317 | 6126 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6127 |
cat := parseTree arg1 evaluate. |
6317 | 6128 |
]. |
6129 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
|
6130 |
do:[ |
|
7709 | 6131 |
parser := Parser new. |
6639 | 6132 |
Error catch:[ |
7709 | 6133 |
parser |
6134 |
parseMethod:newSource in:thisClass |
|
6135 |
ignoreErrors:true ignoreWarnings:true. |
|
6317 | 6136 |
] |
6137 |
]. |
|
7709 | 6138 |
sel := parser selector. |
6139 |
(sel notNil) ifTrue:[ |
|
6317 | 6140 |
oldMethod := thisClass compiledMethodAt:sel. |
6141 |
oldMethod notNil ifTrue:[ |
|
6142 |
(oldMethod category = cat) ifFalse:[ |
|
6447 | 6143 |
"/ Transcript showCR:'category changed.'. |
6317 | 6144 |
]. |
6145 |
oldSource := oldMethod source. |
|
6146 |
(oldSource = newSource) ifFalse:[ |
|
6147 |
oldSource isNil ifTrue:[ |
|
6148 |
oldSource := 'No source for compare.'. |
|
6149 |
] ifFalse:[ |
|
6150 |
"/ |
|
6151 |
"/ compare for tabulator <-> space changes |
|
6152 |
"/ before showing diff ... |
|
6153 |
"/ |
|
6154 |
oldSource := oldSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
6155 |
newSource := newSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
6156 |
oldSource = newSource ifFalse:[ |
|
6157 |
"/ |
|
6158 |
"/ check if only historyLine diffs |
|
6159 |
"/ |
|
6160 |
(HistoryManager notNil |
|
6161 |
and:[HistoryManager isActive]) ifTrue:[ |
|
6162 |
oldSource := oldSource asStringCollection asString. |
|
6163 |
newSource := newSource asStringCollection asString. |
|
6164 |
(HistoryManager withoutHistoryLines:oldSource) |
|
6165 |
= |
|
6166 |
(HistoryManager withoutHistoryLines:newSource) |
|
6167 |
ifTrue:[ |
|
6168 |
oldSource := (HistoryManager withoutHistoryLines:oldSource). |
|
6169 |
newSource := (HistoryManager withoutHistoryLines:newSource). |
|
6170 |
] |
|
6171 |
]. |
|
6172 |
] |
|
6173 |
] |
|
6174 |
] |
|
6175 |
] ifFalse:[ |
|
6176 |
oldSource := 'Method does not exist.'. |
|
6177 |
] |
|
6178 |
] ifFalse:[ |
|
6179 |
oldSource := 'Change is unparsable (parse error).'. |
|
6180 |
]. |
|
6181 |
]. |
|
6182 |
] ifFalse:[ |
|
6183 |
oldSource := 'Class does not exist.'. |
|
6184 |
] |
|
6185 |
] ifFalse:[ |
|
6186 |
newSource := chunk. "/ aStream contents. |
|
6187 |
oldSource := 'Not comparable.'. |
|
6188 |
] |
|
6189 |
] |
|
4487 | 6190 |
]. |
6191 |
aStream close. |
|
6192 |
||
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
6193 |
oldSource := oldSource ? ''. |
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
6194 |
newSource := newSource ? ''. |
8675
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6195 |
|
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6196 |
oldSource := oldSource asStringCollection asString. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6197 |
newSource := newSource asStringCollection asString. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6198 |
|
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6199 |
"/ unify cr, crlf and lf into lf |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6200 |
(oldSource includes:Character return) ifTrue: [ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6201 |
i := oldSource indexOf:Character return. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6202 |
(oldSource at:i+1) == Character nl ifTrue:[ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6203 |
"/ crnl endings |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6204 |
oldSource := oldSource copyReplaceString:(String crlf) withString:(String lf). |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6205 |
] ifFalse:[ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6206 |
"/ cr endings |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6207 |
oldSource := oldSource copyReplaceAll:Character return with:Character nl. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6208 |
]. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6209 |
]. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6210 |
|
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6211 |
"/ unify cr, crlf and lf into lf |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6212 |
(newSource includes:Character return) ifTrue: [ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6213 |
i := newSource indexOf:Character return. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6214 |
(newSource at:i+1) == Character nl ifTrue:[ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6215 |
"/ crnl endings |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6216 |
newSource := newSource copyReplaceString:(String crlf) withString:(String lf). |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6217 |
] ifFalse:[ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6218 |
"/ cr endings |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6219 |
newSource := newSource copyReplaceAll:Character return with:Character nl. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6220 |
]. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6221 |
]. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
6222 |
|
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
6223 |
(oldSource = newSource |
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
6224 |
or:[ oldSource asStringCollection withTabsExpanded = newSource asStringCollection withTabsExpanded]) ifTrue:[ |
6317 | 6225 |
self makeDiffViewInvisible |
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
6226 |
] ifFalse:[ |
6317 | 6227 |
self makeDiffViewVisible. |
6228 |
diffView text1:oldSource text2:newSource. |
|
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
6229 |
]. |
4487 | 6230 |
|
7709 | 6231 |
"Created: / 24-11-1995 / 14:30:46 / cg" |
16372 | 6232 |
"Modified: / 01-05-2016 / 18:26:01 / cg" |
202 | 6233 |
! ! |
0 | 6234 |
|
202 | 6235 |
!ChangesBrowser methodsFor:'termination'! |
51 | 6236 |
|
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6237 |
askIfChangesAreToBeWrittenBack |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6238 |
|action again| |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6239 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6240 |
anyChanges ifFalse:[^ self]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6241 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6242 |
again := true. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6243 |
[again] whileTrue:[ |
6357 | 6244 |
action := OptionBox |
6245 |
request:(resources stringWithCRs:'The modified changelist has not been written back to the change file.\\Write change file before closing ?') |
|
6246 |
label:'ChangesBrowser' |
|
6247 |
image:(WarningBox iconBitmap) |
|
6248 |
buttonLabels:(resources array:#('Cancel' 'Don''t Write' 'Write')) |
|
6249 |
values:#(#abort #ignore #save) |
|
6250 |
default:#save |
|
6251 |
onCancel:#abort. |
|
6252 |
||
6253 |
again := false. |
|
6254 |
action == #abort ifTrue:[AbortSignal raise. ^ self]. |
|
6255 |
action == #save ifTrue:[ |
|
6256 |
again := self writeBackChanges not |
|
6257 |
]. |
|
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6258 |
]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6259 |
! |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6260 |
|
1787 | 6261 |
closeRequest |
18159 | 6262 |
"window manager wants me to go away" |
1787 | 6263 |
|
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
6264 |
self askIfChangesAreToBeWrittenBack. |
1787 | 6265 |
super closeRequest |
18159 | 6266 |
|
6267 |
"Modified (comment): / 28-05-2018 / 09:49:47 / Claus Gittinger" |
|
1787 | 6268 |
! |
6269 |
||
202 | 6270 |
saveAndTerminate |
6271 |
"update the changes file and quit. |
|
17026 | 6272 |
Don't depend on this being sent, not all window managers |
202 | 6273 |
send it; instead, they simply destroy the view." |
28 | 6274 |
|
202 | 6275 |
anyChanges ifTrue:[ |
17026 | 6276 |
self writeBackChanges. |
0 | 6277 |
]. |
1787 | 6278 |
super saveAndTerminate |
6279 |
||
6280 |
"Modified: / 3.8.1998 / 19:54:00 / cg" |
|
0 | 6281 |
! ! |
6282 |
||
73 | 6283 |
!ChangesBrowser methodsFor:'user interaction'! |
51 | 6284 |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6285 |
askForSearch:msg initialAnswer:initial thenSearchUsing:searchBlock2 onCancel:cancelBlock |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6286 |
|searchString directionHolder searchBlock| |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6287 |
|
6288 | 6288 |
searchString := self |
15674 | 6289 |
askForSearchString:msg |
6290 |
initialAnswer:initial |
|
6291 |
directionInto:(directionHolder := ValueHolder new). |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6292 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6293 |
searchString isNil ifTrue:[ |
15674 | 6294 |
^ cancelBlock value |
6295 |
]. |
|
17382 | 6296 |
lastSearchString := searchString. |
6297 |
||
15674 | 6298 |
directionHolder value == #first ifTrue:[ |
6299 |
self findFirstForClass:searchString. |
|
6300 |
^ self. |
|
6301 |
]. |
|
6302 |
directionHolder value == #last ifTrue:[ |
|
6303 |
self findLastForClass:searchString. |
|
6304 |
^ self. |
|
6305 |
]. |
|
6306 |
||
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6307 |
searchBlock := [:changeNr | searchBlock2 value:searchString value:changeNr]. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6308 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6309 |
directionHolder value == #backward ifTrue:[ |
15674 | 6310 |
changeNrShown isNil ifTrue:[ |
6311 |
changeNrShown := self numberOfChanges. |
|
6312 |
]. |
|
6313 |
self findPreviousForWhich:searchBlock |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6314 |
] ifFalse:[ |
15674 | 6315 |
changeNrShown isNil ifTrue:[ |
6316 |
changeNrShown := 0. |
|
6317 |
]. |
|
6318 |
self findNextForWhich:searchBlock |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6319 |
]. |
17382 | 6320 |
|
6321 |
"Modified: / 10-02-2017 / 20:40:59 / cg" |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6322 |
! |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6323 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6324 |
askForSearchString:msg initialAnswer:initial directionInto:aValueHolder |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6325 |
"common code to open a search box" |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6326 |
|
17394 | 6327 |
|searchString direction choices current| |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6328 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6329 |
direction := #forward. |
17394 | 6330 |
choices := OrderedCollection new. |
6331 |
||
6332 |
changeNrShown notNil ifTrue:[ |
|
6333 |
current := self classNameOfChange:changeNrShown. |
|
6334 |
initial ~= current ifTrue:[ |
|
6335 |
(choices includes:current) ifFalse:[ |
|
6336 |
choices addFirst:current |
|
6337 |
]. |
|
6338 |
]. |
|
6339 |
]. |
|
6340 |
lastSearchString notNil ifTrue:[ |
|
6341 |
initial ~= lastSearchString ifTrue:[ |
|
6342 |
(choices includes:lastSearchString) ifFalse:[ |
|
6343 |
choices addFirst:lastSearchString |
|
6344 |
]. |
|
6345 |
]. |
|
6346 |
]. |
|
6347 |
||
15449 | 6348 |
"/ take a normal request box, but add an additional 'previous' button |
6349 |
Dialog modifyingBoxWith:[:box | |
|
15674 | 6350 |
|nextButton prevButton firstButton lastButton| |
15449 | 6351 |
|
13343 | 6352 |
nextButton := box okButton. |
15674 | 6353 |
|
6354 |
firstButton := Button label:(resources string:'First'). |
|
6355 |
firstButton action:[direction := #first. box okPressed.]. |
|
6356 |
box addButton:firstButton after:nextButton. |
|
6357 |
||
6358 |
lastButton := Button label:(resources string:'Last'). |
|
6359 |
lastButton action:[direction := #last. box okPressed.]. |
|
6360 |
box addButton:lastButton after:nextButton. |
|
6361 |
||
13343 | 6362 |
prevButton := Button label:(resources string:'Previous'). |
6363 |
prevButton action:[direction := #backward. box okPressed.]. |
|
6364 |
box addButton:prevButton after:nextButton. |
|
15674 | 6365 |
|
13343 | 6366 |
nextButton label:(resources string:'Next'). |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6367 |
] do:[ |
13343 | 6368 |
searchString := Dialog |
6369 |
request:msg |
|
17394 | 6370 |
list:choices |
13343 | 6371 |
initialAnswer:initial |
17394 | 6372 |
]. |
6373 |
||
6374 |
searchString isEmptyOrNil ifTrue:[ |
|
13343 | 6375 |
^ nil |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6376 |
]. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6377 |
aValueHolder value:direction. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6378 |
^ searchString |
15449 | 6379 |
|
6380 |
" |
|
6381 |
self new askForSearchString:'foo' initialAnswer:'bla' directionInto:(false asValue) |
|
6382 |
" |
|
17394 | 6383 |
|
6384 |
"Modified: / 12-02-2017 / 11:18:11 / cg" |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6385 |
! |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6386 |
|
221 | 6387 |
autoUpdate:aBoolean |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
6388 |
"enabled/disable automatic update from the change-file (for monitoring)" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
6389 |
|
6216 | 6390 |
autoUpdate value:aBoolean |
221 | 6391 |
|
6392 |
"Created: 3.12.1995 / 14:14:24 / cg" |
|
6393 |
"Modified: 3.12.1995 / 14:20:45 / cg" |
|
6394 |
! |
|
6395 |
||
6216 | 6396 |
autoloadAsRequired:aBoolean |
6397 |
"enabled/disable automatic load of unloaded classes" |
|
6398 |
||
6399 |
autoloadAsRequired value:aBoolean |
|
6400 |
! |
|
6401 |
||
3211 | 6402 |
changeSelection:lineNrCollection |
0 | 6403 |
"show a change in the codeView" |
6404 |
||
11048 | 6405 |
|chunk lineNr lineNumbers| |
3211 | 6406 |
|
6407 |
lineNrCollection isInteger ifTrue:[ |
|
11048 | 6408 |
lineNr := lineNrCollection. |
6409 |
lineNumbers := Array with:lineNr. |
|
3211 | 6410 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6411 |
changeListView multipleSelectOk ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6412 |
lineNrCollection size == 1 ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6413 |
lineNr := lineNrCollection first. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6414 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6415 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6416 |
lineNr := lineNrCollection |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6417 |
]. |
11048 | 6418 |
lineNumbers := lineNrCollection. |
6419 |
]. |
|
6420 |
||
6421 |
self changeListSelectionHolder value:lineNumbers. |
|
16467 | 6422 |
|
2293 | 6423 |
lineNr isNil ifTrue:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6424 |
codeView contents:nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6425 |
codeView initializeDoITAction. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6426 |
changeNrShown := nil. |
16467 | 6427 |
infoHolder value:nil. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6428 |
^ self |
2293 | 6429 |
]. |
6430 |
||
16467 | 6431 |
changeNrShown := lineNr. |
6432 |
self sensor |
|
6433 |
enqueueMessage:#updateSourceCodeAfterChangedSelection for:self arguments:nil; |
|
6434 |
enqueueMessage:#updateInfoAfterChangedSelection for:self arguments:nil. |
|
6435 |
^ self. |
|
6436 |
||
3211 | 6437 |
"/ display the changes code |
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
6438 |
chunk := self sourceOfChange:lineNr. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
6439 |
chunk isNil ifTrue:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6440 |
codeView initializeDoITAction. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6441 |
^ self |
2044 | 6442 |
]. |
8391 | 6443 |
|
0 | 6444 |
codeView contents:chunk. |
13 | 6445 |
codeView acceptAction:[:theCode | self doApply "noChangesAllowed"]. |
2043
66b5276b2760
set self in changesBrowsers doIt.
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
6446 |
codeView doItAction:[:theCode | |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6447 |
|clsName cls| |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6448 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6449 |
clsName := self classNameOfChange:lineNr. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6450 |
clsName notNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6451 |
clsName := clsName asSymbolIfInterned. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6452 |
clsName notNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6453 |
cls := Smalltalk at:clsName ifAbsent:nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6454 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6455 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6456 |
Compiler |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6457 |
evaluate:theCode |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6458 |
in:nil |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6459 |
receiver:cls |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6460 |
notifying:self |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6461 |
logged:true |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6462 |
ifFail:nil |
2043
66b5276b2760
set self in changesBrowsers doIt.
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
6463 |
]. |
15 | 6464 |
changeNrShown := lineNr. |
0 | 6465 |
|
4487 | 6466 |
self showingDiffs value ifTrue:[ |
8391 | 6467 |
self withWaitCursorDo:[ |
6468 |
AbortOperationRequest catch:[ |
|
6469 |
self updateDiffViewFor:changeNrShown. |
|
6470 |
] |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6471 |
] |
4487 | 6472 |
]. |
6473 |
||
11048 | 6474 |
"Modified: / 03-01-2012 / 15:30:23 / cg" |
51 | 6475 |
! |
6476 |
||
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6477 |
classOfChange:changeNr |
3806
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
6478 |
^ self |
6386 | 6479 |
classOfChange:changeNr |
6480 |
ifAbsent:[:className | |
|
6481 |
|msg| |
|
6482 |
||
6483 |
className isNil ifTrue:[ |
|
6484 |
msg := 'Could not extract classname from change'. |
|
6485 |
] ifFalse:[ |
|
6486 |
msg := 'Class not found: ''' , className , ''''. |
|
6487 |
]. |
|
8320
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6488 |
Transcript showCR:msg. |
6386 | 6489 |
"/ self warn:msg. |
6490 |
nil |
|
6491 |
] |
|
3806
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
6492 |
! |
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
6493 |
|
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
6494 |
classOfChange:changeNr ifAbsent:exceptionBlock |
18059 | 6495 |
"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
|
6496 |
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
|
6497 |
|
8272
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
6498 |
|className cls isMeta nameSpaceForApply path ownerName owner| |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6499 |
|
5014 | 6500 |
className := self realClassNameOfChange:changeNr. |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6501 |
className isNil ifTrue:[ |
18059 | 6502 |
^ exceptionBlock valueWithOptionalArgument:nil |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6503 |
]. |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6504 |
|
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6505 |
isMeta := false. |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6506 |
(className endsWith:' class') ifTrue:[ |
12704
6f20f7d39e75
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12656
diff
changeset
|
6507 |
className := className copyButLast:6. |
6378 | 6508 |
isMeta := true. |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6509 |
]. |
3472 | 6510 |
|
8272
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
6511 |
autoloadAsRequired value ifTrue:[ |
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
6512 |
path := className asCollectionOfSubstringsSeparatedByAll:'::'. |
8320
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6513 |
path size >= 2 ifTrue:[ |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6514 |
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
|
6515 |
"/ 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
|
6516 |
"/ Transcript showCR:'loading owner'. |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6517 |
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
|
6518 |
owner := Smalltalk classNamed:ownerName. |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6519 |
owner notNil ifTrue:[ |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6520 |
owner autoload. |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6521 |
]. |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6522 |
]. |
8272
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
6523 |
]. |
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
6524 |
]. |
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
6525 |
|
7620
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6526 |
nameSpaceForApply := self nameSpaceForApply. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6527 |
autoloadAsRequired value ifTrue:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6528 |
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
|
6529 |
] ifFalse:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6530 |
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
|
6531 |
]. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6532 |
(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
|
6533 |
"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
|
6534 |
autoloadAsRequired value ifTrue:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6535 |
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
|
6536 |
] ifFalse:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6537 |
cls := Smalltalk loadedClassNamed:className |
6378 | 6538 |
]. |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6539 |
]. |
7620
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6540 |
|
6378 | 6541 |
cls isNil ifTrue:[ |
18059 | 6542 |
^ exceptionBlock valueWithOptionalArgument:className |
6378 | 6543 |
]. |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6544 |
isMeta ifTrue:[ |
6378 | 6545 |
cls := cls class |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6546 |
]. |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6547 |
^ cls |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6548 |
! |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6549 |
|
1471 | 6550 |
doubleClickOnChange:lineNr |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
6551 |
"action performed when a change-list entry is doubleClicked" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
6552 |
|
1471 | 6553 |
self doBrowse |
6554 |
||
6555 |
"Created: / 6.2.1998 / 13:08:49 / cg" |
|
6556 |
! |
|
6557 |
||
202 | 6558 |
noChangesAllowed |
6559 |
"show a warning that changes cannot be changed" |
|
93 | 6560 |
|
3211 | 6561 |
self warn:'Changes are not allowed to be changed.' |
0 | 6562 |
! |
6563 |
||
202 | 6564 |
saveClass:aClassName from:startNr |
6565 |
"user wants changes from current to end to be appended to a file" |
|
51 | 6566 |
|
202 | 6567 |
|changeNr fileName| |
51 | 6568 |
|
202 | 6569 |
changeNr := changeListView selection. |
6570 |
changeNr notNil ifTrue:[ |
|
9604 | 6571 |
fileName := Dialog |
6572 |
requestFileNameForSave:(resources string:'Append changes for class to:') |
|
6573 |
default:(lastSaveFileName ? '') |
|
6574 |
ok:(resources string:'Append') |
|
6575 |
abort:(resources string:'Abort') |
|
6576 |
pattern:'*.chg'. |
|
6577 |
||
6578 |
fileName notNil ifTrue:[ |
|
6579 |
lastSaveFileName := fileName. |
|
11685 | 6580 |
self withWriteCursorDo:[ |
9604 | 6581 |
startNr to:(self numberOfChanges) do:[:changeNr | |
6582 |
|thisClassName| |
|
6583 |
||
6584 |
thisClassName := self classNameOfChange:changeNr. |
|
6585 |
thisClassName = aClassName ifTrue:[ |
|
6586 |
self setSingleSelection:changeNr. |
|
6587 |
(self appendChange:changeNr toFile:fileName) ifFalse:[ |
|
6588 |
^ self |
|
6589 |
] |
|
6590 |
] |
|
6591 |
] |
|
6592 |
] |
|
6593 |
]. |
|
202 | 6594 |
] |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
6595 |
|
11685 | 6596 |
"Modified: / 27-07-2012 / 09:46:04 / cg" |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
6597 |
! |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
6598 |
|
11477 | 6599 |
selectionChanged |
12946 | 6600 |
self halt:'should not be here' |
11048 | 6601 |
|
6602 |
"Created: / 03-01-2012 / 15:26:36 / cg" |
|
16467 | 6603 |
! |
6604 |
||
6605 |
updateInfoAfterChangedSelection |
|
6606 |
"update the info label" |
|
6607 |
||
17172 | 6608 |
|selection lineNr selectorOrNil className nonMetaClassName metaClassName |
16476 | 6609 |
nClassChanges nMethodChanges uniqueSelectors |
17172 | 6610 |
lastLineNr firstLineNr |
6611 |
countForClassBeforeCurrent countForClassAfterLast countForClassAndSelectorAfterLast |
|
18186 | 6612 |
moreInfo countInfo selectorInfo| |
16467 | 6613 |
|
6614 |
selection := lineNr := changeListView selection. |
|
6615 |
selection isNumber ifFalse:[ |
|
6616 |
lineNr := nil. |
|
6617 |
selection notEmptyOrNil ifTrue:[ |
|
6618 |
lineNr := selection first |
|
6619 |
]. |
|
6620 |
]. |
|
6621 |
||
6622 |
lineNr isNil ifTrue:[ |
|
6623 |
infoHolder value:nil. |
|
6624 |
^ self |
|
6625 |
]. |
|
6626 |
||
6627 |
"/ |
|
6628 |
"/ now, this info is computed so fast, |
|
6629 |
"/ we can do it each time the selection changes |
|
6630 |
"/ (can we?) |
|
6631 |
className := self realClassNameOfChange:lineNr. |
|
16478 | 6632 |
className isNil ifTrue:[ |
6633 |
infoHolder value:nil. |
|
6634 |
^ self |
|
6635 |
]. |
|
17172 | 6636 |
selectorOrNil := self selectorOfMethodChange:lineNr. |
16478 | 6637 |
|
16476 | 6638 |
nonMetaClassName := (className endsWith:' class') |
6639 |
ifTrue:[ className copyButLast:' class' size ] |
|
6640 |
ifFalse:[ className ]. |
|
6641 |
metaClassName := nonMetaClassName,' class'. |
|
6642 |
||
16467 | 6643 |
nClassChanges := nMethodChanges := 0. |
6644 |
uniqueSelectors := Set new. |
|
16476 | 6645 |
lastLineNr := firstLineNr := nil. |
17172 | 6646 |
countForClassAfterLast := 0. |
6647 |
countForClassBeforeCurrent := 0. |
|
6648 |
countForClassAndSelectorAfterLast := 0. |
|
16467 | 6649 |
|
6650 |
"/ count them all |
|
6651 |
1 to:changeInfoList size do:[:i | |
|
16476 | 6652 |
|sel nameOfChange| |
17420 | 6653 |
|
6654 |
changeInfoList at:i. |
|
16476 | 6655 |
nameOfChange := self realClassNameOfChange:i. |
6656 |
((nameOfChange = nonMetaClassName) or:[nameOfChange = metaClassName]) ifTrue:[ |
|
17172 | 6657 |
sel := self selectorOfMethodChange:i. |
6658 |
||
16467 | 6659 |
lastLineNr := i. |
16476 | 6660 |
firstLineNr := firstLineNr ? i. |
17172 | 6661 |
i > lineNr ifTrue:[ |
6662 |
countForClassAfterLast := countForClassAfterLast + 1. |
|
6663 |
(nameOfChange = className |
|
6664 |
and:[ selectorOrNil notNil |
|
6665 |
and:[sel == selectorOrNil]]) ifTrue:[ |
|
6666 |
countForClassAndSelectorAfterLast := countForClassAndSelectorAfterLast + 1. |
|
16476 | 6667 |
]. |
17172 | 6668 |
] ifFalse:[ |
6669 |
i < lineNr ifTrue:[ |
|
6670 |
countForClassBeforeCurrent := countForClassBeforeCurrent + 1 |
|
6671 |
] |
|
6672 |
]. |
|
16467 | 6673 |
nClassChanges := nClassChanges + 1. |
17172 | 6674 |
sel notNil ifTrue:[ |
16467 | 6675 |
uniqueSelectors add:sel. |
6676 |
nMethodChanges := nMethodChanges + 1. |
|
6677 |
]. |
|
6678 |
]. |
|
6679 |
]. |
|
6680 |
lastLineNr == lineNr ifTrue:[ |
|
16476 | 6681 |
firstLineNr == lineNr ifTrue:[ |
6682 |
moreInfo := resources string:'. This is the only one for this class '. |
|
6683 |
] ifFalse:[ |
|
6684 |
moreInfo := resources string:'. This is the last for this class '. |
|
6685 |
] |
|
16467 | 6686 |
] ifFalse:[ |
16476 | 6687 |
firstLineNr == lineNr ifTrue:[ |
6688 |
moreInfo := resources string:'. This is the first for this class'. |
|
6689 |
]. |
|
17172 | 6690 |
countForClassAfterLast > 0 ifTrue:[ |
6691 |
moreInfo := (moreInfo ? ''),(resources string:'. %1 more for this class' with:countForClassAfterLast). |
|
6692 |
countForClassAndSelectorAfterLast > 0 ifTrue:[ |
|
17419 | 6693 |
moreInfo := moreInfo,(resources string:', %1 for selector' with:countForClassAndSelectorAfterLast). |
17172 | 6694 |
]. |
16467 | 6695 |
]. |
6696 |
]. |
|
18186 | 6697 |
|
6698 |
countInfo := resources string:'%1 changes. %2 for %3 ' |
|
6699 |
with:(changeInfoList size) |
|
6700 |
with:nClassChanges |
|
6701 |
with:className. |
|
6702 |
||
17381 | 6703 |
uniqueSelectors size == 1 ifTrue:[ |
6704 |
nMethodChanges == 1 ifTrue:[ |
|
18186 | 6705 |
selectorInfo := (resources string:'(1 for #''%1'')' |
6706 |
with:uniqueSelectors first) allBold |
|
17381 | 6707 |
] ifFalse:[ |
18186 | 6708 |
selectorInfo := (resources string:'(%1 methods / for #''%2'')' |
6709 |
with:nMethodChanges |
|
6710 |
with:uniqueSelectors first) allBold |
|
6711 |
]. |
|
18110 | 6712 |
] ifFalse:[ |
18186 | 6713 |
(nMethodChanges == 0 and:[uniqueSelectors isEmptyOrNil]) ifTrue:[ |
6714 |
selectorInfo := resources string:'(0 methods)' |
|
6715 |
] ifFalse:[ |
|
6716 |
selectorInfo := (resources string:'(%1 methods / %5 selectors)' |
|
6717 |
with:nMethodChanges |
|
6718 |
with:uniqueSelectors size) allBold |
|
6719 |
]. |
|
6720 |
]. |
|
6721 |
infoHolder value:(countInfo,selectorInfo,moreInfo). |
|
17381 | 6722 |
|
17420 | 6723 |
"Modified: / 19-02-2017 / 13:37:19 / cg" |
18186 | 6724 |
"Modified: / 08-06-2018 / 12:09:44 / Claus Gittinger" |
16467 | 6725 |
! |
6726 |
||
6727 |
updateSourceCodeAfterChangedSelection |
|
6728 |
"show a change in the codeView" |
|
6729 |
||
6730 |
|selection lineNr chunk| |
|
6731 |
||
6732 |
selection := lineNr := changeListView selection. |
|
6733 |
selection isNumber ifFalse:[ |
|
6734 |
lineNr := nil. |
|
6735 |
selection notEmptyOrNil ifTrue:[ |
|
6736 |
lineNr := selection first |
|
6737 |
]. |
|
6738 |
]. |
|
6739 |
||
6740 |
lineNr isNil ifTrue:[ |
|
6741 |
^ self |
|
6742 |
]. |
|
6743 |
||
6744 |
"/ display the changes code |
|
6745 |
chunk := self sourceOfChange:lineNr. |
|
6746 |
chunk isNil ifTrue:[ |
|
6747 |
codeView initializeDoITAction. |
|
6748 |
^ self |
|
6749 |
]. |
|
6750 |
||
6751 |
codeView contents:chunk. |
|
6752 |
codeView acceptAction:[:theCode | self doApply "noChangesAllowed"]. |
|
6753 |
codeView doItAction:[:theCode | |
|
6754 |
|clsName cls| |
|
6755 |
||
6756 |
clsName := self classNameOfChange:lineNr. |
|
6757 |
clsName notNil ifTrue:[ |
|
6758 |
clsName := clsName asSymbolIfInterned. |
|
6759 |
clsName notNil ifTrue:[ |
|
6760 |
cls := Smalltalk at:clsName ifAbsent:nil. |
|
6761 |
] |
|
6762 |
]. |
|
6763 |
Compiler |
|
6764 |
evaluate:theCode |
|
6765 |
in:nil |
|
6766 |
receiver:cls |
|
6767 |
notifying:self |
|
6768 |
logged:true |
|
6769 |
ifFail:nil |
|
6770 |
]. |
|
6771 |
||
6772 |
||
6773 |
changeNrShown := lineNr. |
|
6774 |
||
6775 |
self showingDiffs value ifTrue:[ |
|
6776 |
self withWaitCursorDo:[ |
|
6777 |
AbortOperationRequest catch:[ |
|
6778 |
self updateDiffViewFor:changeNrShown. |
|
6779 |
] |
|
6780 |
] |
|
6781 |
]. |
|
202 | 6782 |
! ! |
0 | 6783 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6784 |
!ChangesBrowser::ChangeFileReader methodsFor:'accessing'! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6785 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6786 |
autoCompare:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6787 |
autoCompare := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6788 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6789 |
|
7620
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6790 |
autoloadAsRequired |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6791 |
^ autoloadAsRequired |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6792 |
! |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6793 |
|
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6794 |
autoloadAsRequired:something |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6795 |
autoloadAsRequired := something. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6796 |
! |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6797 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6798 |
browser:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6799 |
browser := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6800 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6801 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6802 |
changeChunks |
18054 | 6803 |
self breakPoint:#cg. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6804 |
^ changeChunks |
16372 | 6805 |
|
6806 |
"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
|
6807 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6808 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6809 |
changeClassNames |
18054 | 6810 |
self breakPoint:#cg. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6811 |
^ changeClassNames |
16372 | 6812 |
|
6813 |
"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
|
6814 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6815 |
|
6516
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6816 |
changeFileName |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6817 |
^ changeFileName |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6818 |
! |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6819 |
|
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6820 |
changeFileName:something |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6821 |
changeFileName := something. |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6822 |
! |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6823 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6824 |
changeHeaderLines |
18054 | 6825 |
self breakPoint:#cg. |
16372 | 6826 |
^ changeHeaderLines |
6827 |
||
6828 |
"Modified: / 01-05-2016 / 19:10:41 / cg" |
|
6829 |
! |
|
6830 |
||
6831 |
changeInfo |
|
6832 |
^ changeInfo |
|
6833 |
||
6834 |
"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
|
6835 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6836 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6837 |
changeIsFollowupMethodChange |
18054 | 6838 |
self breakPoint:#cg. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6839 |
^ changeIsFollowupMethodChange |
16372 | 6840 |
|
6841 |
"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
|
6842 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6843 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6844 |
changePositions |
18054 | 6845 |
self breakPoint:#cg. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6846 |
^ changePositions |
16372 | 6847 |
|
6848 |
"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
|
6849 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6850 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6851 |
changeTimeStamps |
18054 | 6852 |
self breakPoint:#cg. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6853 |
^ changeTimeStamps |
16372 | 6854 |
|
6855 |
"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
|
6856 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6857 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6858 |
enforcedNameSpace:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6859 |
enforcedNameSpace := something. |
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 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6862 |
inStream:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6863 |
inStream := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6864 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6865 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6866 |
noColoring:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6867 |
noColoring := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6868 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6869 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6870 |
tabSpec:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6871 |
tabSpec := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6872 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6873 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6874 |
thisIsAClassSource |
7360 | 6875 |
^ thisIsAClassSource ? false |
6876 |
||
6877 |
"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
|
6878 |
! ! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6879 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6880 |
!ChangesBrowser::ChangeFileReader methodsFor:'private'! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6881 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6882 |
contractClass:className selector:selector to:maxLen |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6883 |
"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
|
6884 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6885 |
|s l| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6886 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6887 |
s := className , ' ', selector. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6888 |
s size > maxLen ifTrue:[ |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6889 |
l := maxLen - 1 - selector size max:20. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6890 |
s := (className contractTo:l) , ' ' , selector. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6891 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6892 |
s size > maxLen ifTrue:[ |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6893 |
l := maxLen - 1 - className size max:20. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6894 |
s := className , ' ', (selector contractTo:l). |
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 |
s size > maxLen ifTrue:[ |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6897 |
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
|
6898 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6899 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6900 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6901 |
^ s |
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 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6904 |
extractClassAndClassNameFromParseTree:rec |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6905 |
|isUnaryMessage className changeClass| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6906 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6907 |
isUnaryMessage := rec isUnaryMessage. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6908 |
|
9019 | 6909 |
Error |
6910 |
handle:[:ex | ^ '?' -> nil] |
|
6843 | 6911 |
do:[ |
9019 | 6912 |
isUnaryMessage ifTrue:[ |
6913 |
className := rec receiver name. |
|
6914 |
] ifFalse:[ |
|
6915 |
className := rec name. |
|
6916 |
]. |
|
6843 | 6917 |
]. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6918 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6919 |
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
|
6920 |
autoloadAsRequired value ifTrue:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6921 |
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
|
6922 |
] ifFalse:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6923 |
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
|
6924 |
]. |
6512
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 |
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
|
6927 |
autoloadAsRequired value ifTrue:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6928 |
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
|
6929 |
] ifFalse:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6930 |
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
|
6931 |
]. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6932 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6933 |
isUnaryMessage ifTrue:[ |
6843 | 6934 |
changeClass notNil ifTrue:[ |
6935 |
changeClass := changeClass class. |
|
6936 |
]. |
|
6937 |
className := className , ' class'. |
|
6512
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 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6940 |
^ className -> changeClass |
6843 | 6941 |
|
6942 |
"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
|
6943 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6944 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6945 |
nameSpaceForApply |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6946 |
^ browser nameSpaceForApply |
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 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6949 |
!ChangesBrowser::ChangeFileReader methodsFor:'reading'! |
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 |
addHeaderLineForChangeType:changeType changeString:changeString changeDelta:changeDelta timeStampInfo:timeStampInfo |
16372 | 6952 |
changeHeaderLines add:(self headerLineForChangeType:changeType changeString:changeString changeDelta:changeDelta timeStampInfo:timeStampInfo) |
6953 |
||
6954 |
"Modified: / 01-05-2016 / 19:07:49 / cg" |
|
6955 |
! |
|
6956 |
||
18059 | 6957 |
colorizeAsCommentChange:changeType |
6958 |
|c| |
|
6959 |
||
6960 |
NoColoring ~~ true ifTrue:[ |
|
6961 |
c := changeType allItalic. |
|
6962 |
"/ changeString := changeString allItalic. |
|
6963 |
c emphasisAllAdd:(#color -> UserPreferences current commentColor). |
|
6964 |
^ c |
|
6965 |
]. |
|
6966 |
^ changeType |
|
6967 |
! |
|
6968 |
||
16372 | 6969 |
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
|
6970 |
|entry| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6971 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6972 |
entry := MultiColListEntry new. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6973 |
entry tabulatorSpecification:tabSpec. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6974 |
entry colAt:1 put:changeDelta. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6975 |
entry colAt:2 put:changeString. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6976 |
entry colAt:3 put:changeType. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6977 |
timeStampInfo notNil ifTrue:[ |
12599
827681c8f7d4
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
6978 |
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
|
6979 |
]. |
16372 | 6980 |
^ entry |
6981 |
||
6982 |
"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
|
6983 |
! |
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 |
processChunk |
16372 | 6986 |
|info| |
6987 |
||
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6988 |
(chunkText startsWith:'''---- timestamp ') ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6989 |
timeStampInfo := (chunkText copyFrom:16 to:(chunkText size - 6)) withoutSpaces. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6990 |
^ self. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6991 |
]. |
11234 | 6992 |
(chunkText asLowercase startsWith:'''---- encoding: ') ifTrue:[ |
6993 |
^ self. |
|
6994 |
]. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6995 |
|
16372 | 6996 |
changeInfo add:(info := |
6997 |
ChangesBrowser::ChangeInfo new |
|
6998 |
position:chunkPosition chunk:chunkText className:nil selector:nil headerLine:nil |
|
6999 |
timestamp:timeStampInfo isFollowupChange:false). |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7000 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7001 |
headerLine := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7002 |
changeDelta := ' '. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7003 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7004 |
sawExcla ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7005 |
self processNonMethodChunk |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7006 |
] ifTrue:[ |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
7007 |
self processMethodChunkIfNone: |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
7008 |
[ |
16372 | 7009 |
changeInfo removeLast. |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
7010 |
] |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7011 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7012 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7013 |
changeString notNil ifTrue:[ |
16372 | 7014 |
"/ self addHeaderLineForChangeType:changeType changeString:changeString changeDelta:changeDelta timeStampInfo:timeStampInfo. |
7015 |
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
|
7016 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7017 |
headerLine notNil ifTrue:[ |
17723 | 7018 |
changeHeaderLines add:headerLine. |
16372 | 7019 |
info headerLine:headerLine. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7020 |
] |
16372 | 7021 |
]. |
7022 |
||
7023 |
"Modified: / 01-05-2016 / 19:13:59 / cg" |
|
17723 | 7024 |
"Modified: / 27-10-2017 / 14:34:51 / stefan" |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7025 |
! |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7026 |
|
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
7027 |
processMethodChunkIfNone:emptyBlock |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7028 |
"sawExcla" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7029 |
|
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
7030 |
|askedForEditingClassSource changeClass category anyMethod |
15012 | 7031 |
sel p rec clsName done first text methodPos |
16372 | 7032 |
singleJunkOnly methodChunks classCategoryChunks methodCategoryChunks singleInfo methodSelector nameAndClass |
7033 |
info| |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7034 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7035 |
singleJunkOnly := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7036 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7037 |
classCategoryChunks := methodCategoryChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7038 |
singleInfo := false. |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
7039 |
anyMethod := false. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7040 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7041 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7042 |
method definitions actually consist of |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7043 |
two (or more) chunks; skip next chunk(s) |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7044 |
up to an empty one. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7045 |
The system only writes one chunk, |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7046 |
and we cannot handle more in this ChangesBrowser .... |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7047 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7048 |
clsName := nil. |
8665 | 7049 |
|
18596 | 7050 |
(chunkText includesString:'§') ifTrue:[ |
18054 | 7051 |
self halt:'should no longer happen' |
7052 |
]. |
|
17094 | 7053 |
|
8665 | 7054 |
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
|
7055 |
(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
|
7056 |
rec := p receiver. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7057 |
sel := p selector. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7058 |
(ChangesBrowser methodDefinitionSelectors includes:sel) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7059 |
methodChunks := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7060 |
nameAndClass := self extractClassAndClassNameFromParseTree:rec. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7061 |
clsName := nameAndClass key. changeClass := nameAndClass value. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7062 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7063 |
sel == #categoriesForClass ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7064 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7065 |
classCategoryChunks := true. |
18059 | 7066 |
changeType := self colorizeAsCommentChange:'(class category change)'. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7067 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7068 |
sel == #categoriesFor: ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7069 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7070 |
methodCategoryChunks := true. |
18059 | 7071 |
changeType := self colorizeAsCommentChange:'(category change)'. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7072 |
methodSelector := (p args at:1) evaluate. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7073 |
] ifFalse:[ |
6532 | 7074 |
(sel numArgs == 0) ifTrue:[ |
7075 |
category := '* As yet uncategorized *'. |
|
7076 |
category := sel. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7077 |
] ifFalse:[ |
6532 | 7078 |
category := (p args at:1) evaluate. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7079 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7080 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7081 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7082 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7083 |
sel == #'methodsFor:stamp:' ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7084 |
"/ Squeak timeStamp |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7085 |
timeStampInfo := (p args at:2) evaluate. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7086 |
singleInfo := true |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7087 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7088 |
sel == #'commentStamp:prior:' ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7089 |
singleJunkOnly := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7090 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7091 |
] |
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 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7094 |
sel == #reorganize ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7095 |
singleJunkOnly := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7096 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7097 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7098 |
]. |
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 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7101 |
done := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7102 |
first := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7103 |
[done] whileFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7104 |
changeDelta := ' '. |
13314 | 7105 |
methodPos := inStream position + 1. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7106 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7107 |
text := inStream nextChunk. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7108 |
done := text isEmptyOrNil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7109 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7110 |
done ifFalse:[ |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
7111 |
anyMethod := true. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7112 |
first ifFalse:[ |
16372 | 7113 |
info := ChangesBrowser::ChangeInfo new |
7114 |
position:methodPos chunk:chunkText className:clsName |
|
7115 |
selector:nil headerLine:nil timestamp:timeStampInfo isFollowupChange:true. |
|
7116 |
changeInfo add:info. |
|
7117 |
||
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7118 |
askedForEditingClassSource ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7119 |
thisIsAClassSource := (changeFileName asFilename hasSuffix:'st'). |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7120 |
askedForEditingClassSource := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7121 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7122 |
] ifTrue:[ |
16372 | 7123 |
changeInfo last className:clsName |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7124 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7125 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7126 |
first := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7127 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7128 |
(classCategoryChunks or:[methodCategoryChunks]) ifTrue:[ |
6639 | 7129 |
text := text firstLine. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7130 |
classCategoryChunks ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7131 |
changeClass isNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7132 |
changeDelta := '?'. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7133 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7134 |
changeClass category = text ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7135 |
changeDelta := '='. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7136 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7137 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7138 |
changeString := clsName , ' category: ' , text storeString. |
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 |
changeString := '(' , clsName , ' compiledMethodAt:' , methodSelector storeString , ') category: ' , text storeString. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7141 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7142 |
] ifFalse:[ |
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 |
try to find the selector |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7145 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7146 |
methodSelector := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7147 |
clsName notNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7148 |
methodChunks ifTrue:[ |
17094 | 7149 |
p := Parser for:(ReadStream on:text) in:nil. |
7150 |
p ignoreErrors:true. |
|
7151 |
p ignoreWarnings:true. |
|
7152 |
p parserFlags allowDollarInIdentifier:true. |
|
7153 |
p parserFlags allowParagraphInIdentifier:true. |
|
7154 |
p parseMethodSpec. |
|
7155 |
methodSelector := p selector. |
|
7156 |
"/ p := Parser |
|
7157 |
"/ parseMethodSpecification:text |
|
7158 |
"/ in:nil |
|
7159 |
"/ ignoreErrors:true |
|
7160 |
"/ ignoreWarnings:true. |
|
7161 |
"/ (p notNil and:[p ~~ #Error]) ifTrue:[ |
|
7162 |
"/ methodSelector := p selector. |
|
7163 |
"/ ] |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7164 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7165 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7166 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7167 |
methodSelector isNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7168 |
changeString := (chunkText contractTo:maxLen). |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7169 |
changeType := '(change)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7170 |
headerLine := chunkText , ' (change)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7171 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7172 |
changeString := self contractClass:clsName selector:methodSelector to:maxLen. |
18059 | 7173 |
changeType := ('{ ' , category , ' }'). |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7174 |
headerLine := clsName , ' ' , methodSelector , ' ' , '(change category: ''' , category , ''')'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7175 |
]. |
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 |
autoCompare value ifTrue:[ |
17047 | 7178 |
changeDelta := ChangeDeltaInformation |
7179 |
changeDeltaFor:text changeClass:changeClass selector:methodSelector. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7180 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7181 |
]. |
17047 | 7182 |
changeInfo last |
7183 |
headerLine:(self headerLineForChangeType:changeType |
|
7184 |
changeString:changeString |
|
7185 |
changeDelta:changeDelta |
|
7186 |
timeStampInfo:timeStampInfo). |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7187 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7188 |
changeString := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7189 |
headerLine := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7190 |
singleJunkOnly ifTrue:[done := true] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7191 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7192 |
singleInfo ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7193 |
timeStampInfo := nil |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7194 |
]. |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
7195 |
anyMethod ifFalse:[ |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
7196 |
emptyBlock value |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
7197 |
]. |
16372 | 7198 |
|
17094 | 7199 |
"Modified: / 21-11-2016 / 23:32:29 / cg" |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7200 |
! |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7201 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7202 |
processNonMethodChunk |
18059 | 7203 |
|s changeClass sel cls parseTree rec clsName ownerTree ownerName |
7204 |
m nameAndClass args instVarsArg classVarsArg categoryArg |
|
18490 | 7205 |
lastInfo newCategory newPackage| |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7206 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7207 |
(chunkText startsWith:'''---- snap') ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7208 |
self processSnapshotChunk. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7209 |
^ self |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7210 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7211 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7212 |
headerLine := chunkText , ' (doIt)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7213 |
|
18490 | 7214 |
changeString := (chunkText contractTo:maxLen) withoutSeparators. |
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 |
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
|
7218 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7219 |
((chunkText startsWith:'''---- file') |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7220 |
or:[(chunkText startsWith:'''---- check')]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7221 |
changeType := ''. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7222 |
timeStampInfo := nil. |
18490 | 7223 |
changeString := changeString withColor:Color grey. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7224 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7225 |
changeType := '(doIt)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7226 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7227 |
|
18059 | 7228 |
parseTree := browser parseExpression:fullChunkText inNameSpace:Smalltalk. |
7229 |
(parseTree notNil and:[parseTree ~~ #Error]) ifTrue:[ |
|
7230 |
parseTree isMessage ifTrue:[ |
|
7231 |
sel := parseTree selector. |
|
7232 |
rec := parseTree receiver. |
|
7233 |
args := parseTree args. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7234 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7235 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7236 |
sel := nil. |
18123 | 7237 |
Error handle:[:ex | |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7238 |
changeType := '(???)'. |
18123 | 7239 |
] do:[ |
7240 |
(Scanner new scanTokens:fullChunkText) size == 0 ifTrue:[ |
|
7241 |
"/ a comment only |
|
7242 |
changeType := self colorizeAsCommentChange:'(comment)'. |
|
7243 |
] ifFalse:[ |
|
7244 |
changeType := '(???)'. |
|
7245 |
] |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7246 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7247 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7248 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7249 |
(sel == #comment:) ifTrue:[ |
18059 | 7250 |
changeType := self colorizeAsCommentChange:'(comment)'. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7251 |
clsName := rec name. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7252 |
changeClass := (self nameSpaceForApply) classNamed:clsName. |
16372 | 7253 |
(changeInfo last) className:clsName. |
18059 | 7254 |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7255 |
autoCompare value ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7256 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7257 |
changeDelta := '?' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7258 |
] ifFalse:[ |
15087 | 7259 |
(changeClass comment = (args at:1) evaluate) ifTrue:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7260 |
changeDelta := '='. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7261 |
] |
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 |
]. |
15087 | 7264 |
"/ sel := nil. |
7265 |
^ self. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7266 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7267 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7268 |
(sel == #removeSelector:) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7269 |
nameAndClass := self extractClassAndClassNameFromParseTree:rec. |
18059 | 7270 |
clsName := nameAndClass key. |
7271 |
changeClass := nameAndClass value. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7272 |
|
15087 | 7273 |
sel := (args at:1) evaluate. |
16372 | 7274 |
(changeInfo last) className:clsName. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7275 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7276 |
autoCompare value ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7277 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7278 |
changeDelta := '?' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7279 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7280 |
(changeClass includesSelector:sel asSymbol) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7281 |
changeDelta := '-'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7282 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7283 |
changeDelta := '='. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7284 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7285 |
] |
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 |
changeType := '(remove)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7288 |
changeString := self contractClass:clsName selector:sel to:maxLen. |
15087 | 7289 |
"/ sel := nil. |
7290 |
^ self. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7291 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7292 |
|
18059 | 7293 |
(parseTree notNil |
7294 |
and:[parseTree ~~ #Error |
|
7295 |
and:[parseTree isMessage |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7296 |
and:[rec isMessage |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7297 |
and:[rec selector == #compiledMethodAt:]]]]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7298 |
nameAndClass := self extractClassAndClassNameFromParseTree:rec receiver. |
18059 | 7299 |
clsName := nameAndClass key. |
7300 |
changeClass := nameAndClass value. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7301 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7302 |
(sel == #category:) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7303 |
sel := (rec args at:1) evaluate. |
18059 | 7304 |
changeType := self colorizeAsCommentChange:'(category change)'. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7305 |
changeString := self contractClass:clsName selector:sel to:maxLen. |
18059 | 7306 |
newCategory := (args at:1) evaluate. |
7307 |
||
7308 |
"/ make it a category change |
|
7309 |
lastInfo := changeInfo last. |
|
7310 |
lastInfo className:clsName. |
|
7311 |
lastInfo selector:sel. |
|
7312 |
lastInfo categoryIfCategoryChange:newCategory. |
|
7313 |
||
15012 | 7314 |
autoCompare value ifTrue:[ |
7315 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
|
7316 |
changeDelta := '?' |
|
7317 |
] ifFalse:[ |
|
7318 |
m := changeClass compiledMethodAt:sel asSymbol. |
|
18059 | 7319 |
m isNil ifTrue:[ |
7320 |
"/ mhm - the method does not (no longer=) exist |
|
7321 |
changeDelta := '?' |
|
7322 |
] ifFalse:[ |
|
7323 |
m category = newCategory ifTrue:[ |
|
15012 | 7324 |
changeDelta := '='. |
7325 |
] |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7326 |
] |
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 |
]. |
15087 | 7329 |
^ self. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7330 |
]. |
18059 | 7331 |
|
18490 | 7332 |
(sel == #package:) ifTrue:[ |
7333 |
sel := (rec args at:1) evaluate. |
|
7334 |
changeType := self colorizeAsCommentChange:'(package change)'. |
|
7335 |
changeString := self contractClass:clsName selector:sel to:maxLen. |
|
7336 |
newPackage := (args at:1) evaluate. |
|
7337 |
||
7338 |
"/ make it a category change |
|
7339 |
lastInfo := changeInfo last. |
|
7340 |
lastInfo className:clsName. |
|
7341 |
lastInfo selector:sel. |
|
7342 |
"/ lastInfo packageIfPackageChange:newPackage. |
|
7343 |
||
7344 |
autoCompare value ifTrue:[ |
|
7345 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
|
7346 |
changeDelta := '?' |
|
7347 |
] ifFalse:[ |
|
7348 |
m := changeClass compiledMethodAt:sel asSymbol. |
|
7349 |
m isNil ifTrue:[ |
|
7350 |
"/ mhm - the method does not (no longer=) exist |
|
7351 |
changeDelta := '?' |
|
7352 |
] ifFalse:[ |
|
7353 |
m package = newPackage ifTrue:[ |
|
7354 |
changeDelta := '='. |
|
7355 |
] |
|
7356 |
] |
|
7357 |
] |
|
7358 |
]. |
|
7359 |
^ self. |
|
7360 |
]. |
|
7361 |
||
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7362 |
(sel == #privacy:) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7363 |
sel := (rec args at:1) evaluate. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7364 |
changeType := '(privacy change)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7365 |
changeString := self contractClass:clsName selector:sel to:maxLen. |
16372 | 7366 |
(changeInfo last) className:clsName. |
18059 | 7367 |
|
15012 | 7368 |
autoCompare value ifTrue:[ |
7369 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
|
7370 |
changeDelta := '?' |
|
7371 |
] ifFalse:[ |
|
7372 |
changeDelta := ' ' |
|
7373 |
] |
|
7374 |
]. |
|
15087 | 7375 |
^ self. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7376 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7377 |
sel := nil. |
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 |
(Class definitionSelectors includes:sel) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7381 |
changeType := '(class definition)'. |
15087 | 7382 |
clsName := (args at:1) evaluate. |
16372 | 7383 |
(changeInfo last) className:clsName. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7384 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7385 |
"/ is it a private-class ? |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7386 |
('*privateIn:' match:sel) ifTrue:[ |
15087 | 7387 |
ownerTree := args last. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7388 |
ownerName := ownerTree name asString. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7389 |
clsName := ownerName , '::' , clsName |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7390 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7391 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7392 |
changeString := clsName. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7393 |
NoColoring ~~ true ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7394 |
changeType := changeType allBold. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7395 |
changeString := changeString allBold. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7396 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7397 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7398 |
autoCompare value ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7399 |
cls := (self nameSpaceForApply) at:clsName asSymbol ifAbsent:nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7400 |
cls isNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7401 |
changeDelta := '+'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7402 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7403 |
(cls definitionSelector = sel |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7404 |
or:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7405 |
"/ could be an ST/V, VAge or Dolphin definition |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7406 |
cls definitionSelector = (sel , 'category:') |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7407 |
]) |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7408 |
ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7409 |
((cls superclass isNil |
18059 | 7410 |
and:[rec isLiteral |
7411 |
and:[rec evaluate isNil]]) |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7412 |
or:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7413 |
cls superclass notNil |
18059 | 7414 |
and:[rec isLiteral not |
7415 |
and:[cls superclass name = rec name]] |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7416 |
]) ifTrue:[ |
15087 | 7417 |
(sel == #'variableByteSubclass:classVariableNames:poolDictionaries:category:') |
7418 |
ifTrue:[ |
|
7419 |
"/ VSE definition message |
|
7420 |
instVarsArg := ''. |
|
7421 |
classVarsArg := (args at:2) evaluate. |
|
7422 |
categoryArg := (args at:4) evaluate. |
|
7423 |
] ifFalse:[ |
|
7424 |
instVarsArg := (args at:2) evaluate. |
|
7425 |
classVarsArg := (args at:3) evaluate. |
|
7426 |
categoryArg := (args at:5) evaluate. |
|
7427 |
]. |
|
7428 |
cls instanceVariableString asCollectionOfWords = instVarsArg asCollectionOfWords ifTrue:[ |
|
7429 |
cls classVariableString asCollectionOfWords = classVarsArg asCollectionOfWords ifTrue:[ |
|
7430 |
cls definitionSelector = (sel , 'category:') |
|
7431 |
ifTrue:[ |
|
7432 |
"/ ST/V, VAge or Dolphin definition |
|
7433 |
changeDelta := '='. |
|
7434 |
] ifFalse:[ |
|
7435 |
cls category = categoryArg ifTrue:[ |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7436 |
changeDelta := '='. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7437 |
] ifFalse:[ |
18059 | 7438 |
changeType := self colorizeAsCommentChange:'(class category change)'. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7439 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7440 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7441 |
] |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7442 |
] |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7443 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7444 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7445 |
] |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7446 |
]. |
15087 | 7447 |
"/ sel := nil. |
7448 |
^ self. |
|
7449 |
]. |
|
7450 |
||
7451 |
(#( |
|
7452 |
#'primitiveDefinitions:' |
|
7453 |
#'primitiveFunctions:' |
|
7454 |
#'primitiveVariables:' |
|
7455 |
) includes:sel) ifTrue:[ |
|
7456 |
changeType := '(class definition)'. |
|
7457 |
clsName := rec name. |
|
7458 |
^ self. |
|
7459 |
]. |
|
7460 |
||
7461 |
((sel == #instanceVariableNames:) |
|
7462 |
and:[rec isMessage |
|
7463 |
and:[rec selector == #class]]) ifTrue:[ |
|
7464 |
clsName := rec receiver name. |
|
7465 |
changeClass := (self nameSpaceForApply) classNamed:clsName. |
|
7466 |
changeType := '(class definition)'. |
|
16372 | 7467 |
(changeInfo last) className:clsName. |
15087 | 7468 |
|
7469 |
autoCompare value ifTrue:[ |
|
7470 |
changeClass isNil ifTrue:[ |
|
7471 |
changeDelta := '?'. |
|
7472 |
] ifFalse:[ |
|
18059 | 7473 |
s := (args at:1) evaluate. |
15087 | 7474 |
s = changeClass class instanceVariableString ifTrue:[ |
7475 |
changeDelta := '='. |
|
7476 |
] |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7477 |
] |
15087 | 7478 |
]. |
7479 |
^ self. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7480 |
]. |
9548 | 7481 |
|
16372 | 7482 |
"Modified: / 01-05-2016 / 19:19:54 / cg" |
18490 | 7483 |
"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
|
7484 |
! |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7485 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7486 |
processSnapshotChunk |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7487 |
changeType := ''. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7488 |
headerLine := chunkText. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7489 |
changeString := (chunkText contractTo:maxLen) withoutSeparators. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7490 |
timeStampInfo := nil. |
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 |
readChangesFile |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7494 |
"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
|
7495 |
and a list of chunk-positions (changePositions). |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7496 |
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
|
7497 |
the cols are: |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7498 |
1 delta (only if comparing) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7499 |
'+' -> new method (w.r.t. current state) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7500 |
'-' -> removed method (w.r.t. current state) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7501 |
'?' -> class does not exist currently |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7502 |
'=' -> 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
|
7503 |
'~' -> 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
|
7504 |
2 class/selector |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7505 |
3 type of change |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7506 |
doit |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7507 |
method |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7508 |
category change |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7509 |
4 timestamp |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7510 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7511 |
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
|
7512 |
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
|
7513 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7514 |
|excla| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7515 |
|
16372 | 7516 |
changeInfo := OrderedCollection new. |
7517 |
||
7518 |
"/ changeChunks := OrderedCollection new. |
|
7519 |
"/ changeClassNames := OrderedCollection new. |
|
7520 |
"/ changeHeaderLines := OrderedCollection new. |
|
7521 |
"/ changePositions := OrderedCollection new. |
|
7522 |
"/ changeTimeStamps := OrderedCollection new. |
|
7523 |
"/ changeIsFollowupMethodChange := OrderedCollection new. |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7524 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7525 |
excla := inStream class chunkSeparator. |
9515 | 7526 |
maxLen := 100. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7527 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7528 |
[inStream atEnd] whileFalse:[ |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7529 |
" |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7530 |
get a chunk (separated by excla) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7531 |
" |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7532 |
inStream skipSeparators. |
13314 | 7533 |
chunkPosition := inStream position + 1. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7534 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7535 |
sawExcla := inStream peekFor:excla. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7536 |
chunkText := fullChunkText := inStream nextChunk. |
7619
95943c1bc289
Ignore empty chunks when reading from changes file
Stefan Vogel <sv@exept.de>
parents:
7618
diff
changeset
|
7537 |
chunkText notEmptyOrNil ifTrue:[ |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7538 |
self processChunk. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7539 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7540 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7541 |
|
9515 | 7542 |
"Modified: / 27-08-1995 / 23:06:55 / claus" |
16372 | 7543 |
"Modified: / 01-05-2016 / 18:33:36 / cg" |
7544 |
! ! |
|
7545 |
||
18059 | 7546 |
!ChangesBrowser::ChangeInfo class methodsFor:'documentation'! |
7547 |
||
7548 |
documentation |
|
7549 |
" |
|
7550 |
documentation to be added. |
|
7551 |
||
7552 |
[author:] |
|
7553 |
cg |
|
7554 |
||
7555 |
[instance variables:] |
|
7556 |
||
7557 |
[class variables:] |
|
7558 |
||
7559 |
[see also:] |
|
7560 |
||
7561 |
" |
|
7562 |
! ! |
|
7563 |
||
16372 | 7564 |
!ChangesBrowser::ChangeInfo methodsFor:'accessing'! |
7565 |
||
18059 | 7566 |
categoryIfCategoryChange |
7567 |
^ categoryIfCategoryChange |
|
7568 |
! |
|
7569 |
||
7570 |
categoryIfCategoryChange:something |
|
7571 |
categoryIfCategoryChange := something. |
|
7572 |
! |
|
7573 |
||
16372 | 7574 |
chunk |
7575 |
^ chunk |
|
7576 |
! |
|
7577 |
||
7578 |
className |
|
7579 |
^ className |
|
7580 |
! |
|
7581 |
||
7582 |
className:something |
|
7583 |
className := something. |
|
7584 |
! |
|
7585 |
||
7586 |
headerLine |
|
7587 |
^ headerLine |
|
7588 |
! |
|
7589 |
||
7590 |
headerLine:something |
|
7591 |
headerLine := something. |
|
7592 |
! |
|
7593 |
||
7594 |
isFollowupChange |
|
7595 |
^ isFollowupChange |
|
7596 |
! |
|
7597 |
||
18059 | 7598 |
isMethodCategoryChange |
7599 |
^ categoryIfCategoryChange notNil |
|
7600 |
! |
|
7601 |
||
16372 | 7602 |
position |
7603 |
^ position |
|
7604 |
! |
|
7605 |
||
7606 |
position:positionArg chunk:chunkArg className:classNameArg selector:selectorArg headerLine:headerLineArg |
|
7607 |
timestamp:timestampArg isFollowupChange:isFollowupChangeArg |
|
7608 |
||
7609 |
position := positionArg. |
|
7610 |
chunk := chunkArg. |
|
7611 |
className := classNameArg. |
|
7612 |
selector := selectorArg. |
|
7613 |
headerLine := headerLineArg. |
|
7614 |
timestamp := timestampArg. |
|
7615 |
isFollowupChange := isFollowupChangeArg. |
|
7616 |
||
7617 |
"Created: / 01-05-2016 / 19:01:03 / cg" |
|
7618 |
! |
|
7619 |
||
7620 |
selector |
|
7621 |
^ selector |
|
7622 |
! |
|
7623 |
||
7624 |
selector:something |
|
7625 |
selector := something. |
|
7626 |
! |
|
7627 |
||
7628 |
timestamp |
|
7629 |
^ timestamp |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7630 |
! ! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7631 |
|
761 | 7632 |
!ChangesBrowser class methodsFor:'documentation'! |
202 | 7633 |
|
7634 |
version |
|
15683 | 7635 |
^ '$Header$' |
8978 | 7636 |
! |
7637 |
||
7638 |
version_CVS |
|
15683 | 7639 |
^ '$Header$' |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
7640 |
! ! |
12428 | 7641 |