author | Claus Gittinger <cg@exept.de> |
Mon, 20 Jan 2020 21:02:47 +0100 | |
changeset 19422 | c6ca1c3e0fd7 |
parent 18959 | f93490ea4c60 |
permissions | -rw-r--r-- |
30 | 1 |
" |
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
45 | 3 |
All Rights Reserved |
30 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
2862
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
12 |
"{ Package: 'stx:libtool' }" |
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
13 |
|
15188 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
30 | 16 |
ChangesBrowser subclass:#ChangeSetBrowser |
1470 | 17 |
instanceVariableNames:'changeSet originalChangeSet' |
18836 | 18 |
classVariableNames:'ReplacementClasses' |
1470 | 19 |
poolDictionaries:'' |
20 |
category:'Interface-Browsers' |
|
30 | 21 |
! |
22 |
||
23 |
!ChangeSetBrowser class methodsFor:'documentation'! |
|
24 |
||
25 |
copyright |
|
26 |
" |
|
27 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
45 | 28 |
All Rights Reserved |
30 | 29 |
|
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
! |
|
38 |
||
39 |
documentation |
|
40 |
" |
|
41 |
like a changesBrowser, but manipulates the per-project change-lists. |
|
5703 | 42 |
|
43 |
This is operating on changes as a list of Change-instances |
|
44 |
as opposed to the ChangesBrowser which is doing it completely non-object oriented, |
|
45 |
as a list of text-chunks. |
|
46 |
||
47 |
ChangeSetBrowser is going to completely replace the ChangesBrowser class in the near |
|
48 |
future. |
|
30 | 49 |
" |
50 |
! ! |
|
51 |
||
52 |
!ChangeSetBrowser class methodsFor:'instance creation'! |
|
53 |
||
2862
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
54 |
open |
9782 | 55 |
"open a changes browser on the current change set" |
2862
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
56 |
|
3898 | 57 |
^ self openOn:(ChangeSet current) |
58 |
||
59 |
" |
|
60 |
ChangeSetBrowser open |
|
61 |
" |
|
9782 | 62 |
|
63 |
"Modified: / 17-02-2011 / 10:29:26 / cg" |
|
2862
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
64 |
! |
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
65 |
|
40 | 66 |
openOn:aChangeSet |
9782 | 67 |
"open a changes browser on a given change set" |
30 | 68 |
|
45 | 69 |
^ ((self new label:'ChangeSet Browser') changeSet:aChangeSet) open |
9782 | 70 |
|
71 |
"Modified: / 17-02-2011 / 10:29:35 / cg" |
|
4232 | 72 |
! |
73 |
||
18833 | 74 |
openOnFile:fileNameOrString |
75 |
"open a changes browser on a file (or cypress folder)" |
|
76 |
||
77 |
|fileName changeSet| |
|
9782 | 78 |
|
18833 | 79 |
fileName := fileNameOrString asFilename. |
80 |
||
81 |
fileName isDirectory ifTrue:[ |
|
82 |
(fileName hasSuffix:'package') ifTrue:[ |
|
83 |
Smalltalk loadPackage:'stx:goodies/cypress'. |
|
84 |
changeSet := (CypressPackage fromDirectory:fileName) asChangeSet. |
|
18839 | 85 |
] ifFalse:[ |
86 |
(fileName hasSuffix:'class') ifTrue:[ |
|
87 |
Smalltalk loadPackage:'stx:goodies/cypress'. |
|
88 |
changeSet := (CypressClass fromDirectory:fileName) asChangeSet. |
|
89 |
]. |
|
18833 | 90 |
]. |
91 |
] ifFalse:[ |
|
92 |
changeSet := ChangeSet fromFile:fileName. |
|
93 |
]. |
|
4232 | 94 |
^ self openOn:changeSet |
8869 | 95 |
|
96 |
" |
|
12622 | 97 |
self openOnFile:'st.chg' |
8869 | 98 |
self openOnFile:'c:\Users\cg\work\stx\goodies\soap\spray5.2\Steve Waring\Spray WebServices\Spray\Auth\SWT Spray Auth Tests.pac' |
99 |
ChangeSet fromFile:'c:\Users\cg\work\stx\goodies\soap\spray5.2\Steve Waring\Spray WebServices\Spray\Auth\SWT Spray Auth Tests.pac' |
|
100 |
" |
|
9782 | 101 |
|
102 |
"Modified: / 17-02-2011 / 10:29:50 / cg" |
|
18839 | 103 |
"Modified: / 23-06-2019 / 21:44:19 / Claus Gittinger" |
30 | 104 |
! ! |
105 |
||
1470 | 106 |
!ChangeSetBrowser class methodsFor:'defaults'! |
107 |
||
108 |
defaultLabel |
|
5527 | 109 |
^ self classResources string:'ChangeSet Browser' |
1470 | 110 |
|
111 |
"Created: / 6.2.1998 / 13:25:47 / cg" |
|
112 |
! ! |
|
113 |
||
3203 | 114 |
!ChangeSetBrowser class methodsFor:'menu specs'! |
115 |
||
116 |
menuSpec |
|
117 |
"This resource specification was automatically generated |
|
118 |
by the MenuEditor of ST/X." |
|
119 |
||
120 |
"Do not manually edit this!! If it is corrupted, |
|
121 |
the MenuEditor may not be able to read the specification." |
|
122 |
||
123 |
" |
|
124 |
MenuEditor new openOnClass:ChangeSetBrowser andSelector:#menuSpec |
|
125 |
(Menu new fromLiteralArrayEncoding:(ChangeSetBrowser menuSpec)) startUp |
|
126 |
" |
|
127 |
||
128 |
<resource: #menu> |
|
129 |
||
130 |
^ |
|
6766 | 131 |
#(Menu |
132 |
( |
|
133 |
(MenuItem |
|
134 |
label: 'File' |
|
135 |
translateLabel: true |
|
136 |
submenu: |
|
137 |
(Menu |
|
138 |
( |
|
139 |
(MenuItem |
|
140 |
label: 'Compress' |
|
141 |
itemValue: doCompress |
|
142 |
translateLabel: true |
|
143 |
isVisible: notEditingClassSourceAndNotReadOnly |
|
3203 | 144 |
) |
6766 | 145 |
(MenuItem |
146 |
enabled: hasSelection |
|
147 |
label: 'Compress for Class' |
|
148 |
itemValue: doCompressClass |
|
149 |
translateLabel: true |
|
150 |
isVisible: notEditingClassSourceAndNotReadOnly |
|
3203 | 151 |
) |
6766 | 152 |
(MenuItem |
153 |
label: 'Compare and Compress' |
|
154 |
itemValue: doCompareAndCompress |
|
155 |
translateLabel: true |
|
156 |
isVisible: notEditingClassSourceAndNotReadOnly |
|
3203 | 157 |
) |
6766 | 158 |
(MenuItem |
159 |
label: '-' |
|
160 |
isVisible: notEditingClassSourceAndNotReadOnly |
|
3203 | 161 |
) |
6766 | 162 |
(MenuItem |
163 |
enabled: hasSelection |
|
164 |
label: 'Fileout && Delete all Changes for Class' |
|
165 |
itemValue: doFileoutAndDeleteClassAll |
|
166 |
translateLabel: true |
|
167 |
isVisible: notEditingClassSourceAndNotReadOnly |
|
3203 | 168 |
) |
6766 | 169 |
(MenuItem |
170 |
enabled: hasSelection |
|
171 |
label: 'CheckIn && Delete all Changes for Class' |
|
172 |
itemValue: doCheckinAndDeleteClassAll |
|
173 |
translateLabel: true |
|
174 |
isVisible: notEditingClassSourceAndNotReadOnly |
|
3203 | 175 |
) |
6766 | 176 |
(MenuItem |
177 |
label: '-' |
|
178 |
isVisible: notEditingClassSourceAndNotReadOnly |
|
3203 | 179 |
) |
6766 | 180 |
(MenuItem |
181 |
enabled: hasSelection |
|
15017 | 182 |
label: 'Save In...' |
6766 | 183 |
itemValue: doSave |
184 |
translateLabel: true |
|
3203 | 185 |
) |
6766 | 186 |
(MenuItem |
187 |
enabled: hasSelection |
|
15017 | 188 |
label: 'Save to End In...' |
6766 | 189 |
itemValue: doSaveRest |
190 |
translateLabel: true |
|
3203 | 191 |
) |
6766 | 192 |
(MenuItem |
193 |
enabled: hasSelection |
|
15017 | 194 |
label: 'Save for Class to End In...' |
6766 | 195 |
itemValue: doSaveClassRest |
196 |
translateLabel: true |
|
3203 | 197 |
) |
6766 | 198 |
(MenuItem |
199 |
enabled: hasSelection |
|
15188 | 200 |
label: 'Save all for Class In...' |
6766 | 201 |
itemValue: doSaveClassAll |
202 |
translateLabel: true |
|
3203 | 203 |
) |
6766 | 204 |
(MenuItem |
205 |
label: '-' |
|
3203 | 206 |
) |
6766 | 207 |
(MenuItem |
208 |
label: 'Saveback ChangeSet' |
|
209 |
itemValue: doSaveBack |
|
210 |
translateLabel: true |
|
211 |
isVisible: notReadOnly |
|
3203 | 212 |
) |
6766 | 213 |
(MenuItem |
214 |
label: '-' |
|
215 |
isVisible: notReadOnly |
|
3203 | 216 |
) |
6766 | 217 |
(MenuItem |
218 |
label: 'Update' |
|
219 |
itemValue: doUpdate |
|
220 |
translateLabel: true |
|
221 |
isVisible: notReadOnly |
|
3203 | 222 |
) |
6766 | 223 |
(MenuItem |
224 |
label: '-' |
|
225 |
isVisible: notReadOnly |
|
3203 | 226 |
) |
6766 | 227 |
(MenuItem |
228 |
label: 'Exit' |
|
229 |
itemValue: menuExit |
|
230 |
translateLabel: true |
|
3203 | 231 |
) |
232 |
) |
|
233 |
nil |
|
234 |
nil |
|
235 |
) |
|
236 |
) |
|
6766 | 237 |
(MenuItem |
18253 | 238 |
label: 'Change_subst' |
6766 | 239 |
translateLabel: true |
240 |
submenu: |
|
241 |
(Menu |
|
242 |
( |
|
243 |
(MenuItem |
|
244 |
label: 'Undo (undelete Method)' |
|
245 |
itemValue: doUndoRemoveMethod |
|
246 |
translateLabel: true |
|
247 |
isVisible: hasUndoableRemoveMethodChangeSelected |
|
3857 | 248 |
) |
6766 | 249 |
(MenuItem |
250 |
label: 'Undo (previous Version)' |
|
251 |
itemValue: doUndoMethodChange |
|
252 |
translateLabel: true |
|
253 |
isVisible: hasUndoableMethodChangeSelected |
|
3857 | 254 |
) |
6766 | 255 |
(MenuItem |
256 |
enabled: false |
|
257 |
label: 'Undo' |
|
258 |
itemValue: doUndoMethodChange |
|
259 |
translateLabel: true |
|
260 |
isVisible: hasNotUndoableChangeSelected |
|
3857 | 261 |
) |
6766 | 262 |
(MenuItem |
263 |
label: '-' |
|
3857 | 264 |
) |
6766 | 265 |
(MenuItem |
266 |
enabled: hasSelection |
|
267 |
label: 'Apply' |
|
268 |
itemValue: doApply |
|
269 |
translateLabel: true |
|
3554 | 270 |
) |
6766 | 271 |
(MenuItem |
272 |
enabled: hasSelection |
|
273 |
label: 'Apply to End' |
|
274 |
itemValue: doApplyRest |
|
275 |
translateLabel: true |
|
3554 | 276 |
) |
6766 | 277 |
(MenuItem |
278 |
enabled: hasSelection |
|
279 |
label: 'Apply for Class to End' |
|
280 |
itemValue: doApplyClassRest |
|
281 |
translateLabel: true |
|
3554 | 282 |
) |
6766 | 283 |
(MenuItem |
284 |
enabled: hasNoSelection |
|
285 |
label: 'Apply All' |
|
286 |
itemValue: doApplyAll |
|
287 |
translateLabel: true |
|
3554 | 288 |
) |
6766 | 289 |
(MenuItem |
290 |
label: '-' |
|
3554 | 291 |
) |
6766 | 292 |
(MenuItem |
293 |
enabled: hasSelection |
|
294 |
label: 'Delete' |
|
295 |
itemValue: doDelete |
|
296 |
translateLabel: true |
|
297 |
isVisible: notReadOnly |
|
3554 | 298 |
) |
6766 | 299 |
(MenuItem |
300 |
enabled: hasSelection |
|
301 |
label: 'Delete to End' |
|
302 |
itemValue: doDeleteRest |
|
303 |
translateLabel: true |
|
304 |
isVisible: notReadOnly |
|
3554 | 305 |
) |
6766 | 306 |
(MenuItem |
307 |
enabled: hasSelection |
|
308 |
label: 'Delete for Class to End' |
|
309 |
itemValue: doDeleteClassRest |
|
310 |
translateLabel: true |
|
311 |
isVisible: notReadOnly |
|
3554 | 312 |
) |
6766 | 313 |
(MenuItem |
314 |
enabled: hasSelection |
|
315 |
label: 'Delete for Class from Begin' |
|
316 |
itemValue: doDeleteClassFromBeginning |
|
317 |
translateLabel: true |
|
318 |
isVisible: notReadOnly |
|
3554 | 319 |
) |
6766 | 320 |
(MenuItem |
321 |
enabled: hasSelection |
|
15188 | 322 |
label: 'Delete all for Class' |
6766 | 323 |
itemValue: doDeleteClassAll |
324 |
translateLabel: true |
|
325 |
isVisible: notReadOnly |
|
3554 | 326 |
) |
6766 | 327 |
(MenuItem |
328 |
enabled: hasSelection |
|
15188 | 329 |
label: 'Delete all for Class && its Private Classes' |
6766 | 330 |
itemValue: doDeleteClassAndPrivateClassesAll |
331 |
translateLabel: true |
|
332 |
isVisible: notReadOnly |
|
3554 | 333 |
) |
6766 | 334 |
(MenuItem |
335 |
label: '-' |
|
336 |
isVisible: notReadOnly |
|
3554 | 337 |
) |
6766 | 338 |
(MenuItem |
339 |
enabled: hasSelection |
|
340 |
label: 'Compare with Current' |
|
341 |
itemValue: doCompare |
|
342 |
translateLabel: true |
|
3554 | 343 |
) |
6766 | 344 |
(MenuItem |
345 |
enabled: hasSelection |
|
346 |
label: 'Browse' |
|
347 |
itemValue: doBrowse |
|
348 |
translateLabel: true |
|
3554 | 349 |
) |
6766 | 350 |
(MenuItem |
351 |
label: '-' |
|
3554 | 352 |
) |
6766 | 353 |
(MenuItem |
354 |
enabled: hasSelection |
|
355 |
label: 'Make Change a Patch' |
|
356 |
itemValue: doMakePatch |
|
357 |
translateLabel: true |
|
3554 | 358 |
) |
359 |
) |
|
360 |
nil |
|
361 |
nil |
|
362 |
) |
|
363 |
) |
|
6766 | 364 |
(MenuItem |
365 |
label: 'Search' |
|
366 |
translateLabel: true |
|
367 |
submenu: |
|
368 |
(Menu |
|
369 |
( |
|
370 |
(MenuItem |
|
371 |
label: 'Class...' |
|
372 |
itemValue: findClass |
|
373 |
translateLabel: true |
|
3203 | 374 |
) |
6766 | 375 |
(MenuItem |
376 |
enabled: hasSelection |
|
377 |
label: 'Previous for Class' |
|
378 |
itemValue: findPreviousForClass |
|
379 |
translateLabel: true |
|
3203 | 380 |
) |
6766 | 381 |
(MenuItem |
382 |
enabled: hasSelection |
|
383 |
label: 'Next for Class' |
|
384 |
itemValue: findNextForClass |
|
385 |
translateLabel: true |
|
3203 | 386 |
) |
6766 | 387 |
(MenuItem |
388 |
label: '-' |
|
3203 | 389 |
) |
6766 | 390 |
(MenuItem |
391 |
label: 'Selector...' |
|
392 |
itemValue: findSelector |
|
393 |
translateLabel: true |
|
3203 | 394 |
) |
6766 | 395 |
(MenuItem |
396 |
enabled: hasSelection |
|
397 |
label: 'Previous for Selector' |
|
398 |
itemValue: findPreviousForSelector |
|
399 |
translateLabel: true |
|
400 |
) |
|
401 |
(MenuItem |
|
402 |
enabled: hasSelection |
|
403 |
label: 'Next for Selector' |
|
404 |
itemValue: findNextForSelector |
|
405 |
translateLabel: true |
|
3203 | 406 |
) |
6766 | 407 |
(MenuItem |
408 |
label: '-' |
|
3203 | 409 |
) |
6766 | 410 |
(MenuItem |
411 |
label: 'String...' |
|
412 |
itemValue: findString |
|
413 |
translateLabel: true |
|
3203 | 414 |
) |
6766 | 415 |
(MenuItem |
416 |
enabled: hasSelection |
|
417 |
label: 'Previous with String' |
|
418 |
itemValue: findPreviousForString |
|
419 |
translateLabel: true |
|
3203 | 420 |
) |
6766 | 421 |
(MenuItem |
422 |
enabled: hasSelection |
|
423 |
label: 'Next with String' |
|
424 |
itemValue: findNextForString |
|
425 |
translateLabel: true |
|
3203 | 426 |
) |
6766 | 427 |
(MenuItem |
428 |
label: '-' |
|
3203 | 429 |
) |
6766 | 430 |
(MenuItem |
431 |
enabled: hasSelection |
|
432 |
label: 'Previous Snapshot' |
|
433 |
itemValue: findPreviousSnapshot |
|
434 |
translateLabel: true |
|
3203 | 435 |
) |
6766 | 436 |
(MenuItem |
437 |
enabled: hasSelection |
|
438 |
label: 'Next Snapshot' |
|
439 |
itemValue: findNextSnapshot |
|
440 |
translateLabel: true |
|
3203 | 441 |
) |
6766 | 442 |
(MenuItem |
443 |
label: '-' |
|
444 |
) |
|
445 |
(MenuItem |
|
446 |
label: 'Next Difference' |
|
447 |
itemValue: findNextDifference |
|
448 |
translateLabel: true |
|
3203 | 449 |
) |
450 |
) |
|
451 |
nil |
|
452 |
nil |
|
453 |
) |
|
454 |
) |
|
6766 | 455 |
(MenuItem |
456 |
label: 'Browse' |
|
457 |
translateLabel: true |
|
458 |
submenu: |
|
459 |
(Menu |
|
460 |
( |
|
461 |
(MenuItem |
|
462 |
enabled: hasSingleSelection |
|
463 |
label: 'Class' |
|
464 |
itemValue: doBrowse |
|
465 |
translateLabel: true |
|
3203 | 466 |
) |
6766 | 467 |
(MenuItem |
468 |
label: '-' |
|
3203 | 469 |
) |
6766 | 470 |
(MenuItem |
471 |
label: 'Senders...' |
|
472 |
itemValue: doBrowseSenders |
|
473 |
translateLabel: true |
|
3203 | 474 |
) |
6766 | 475 |
(MenuItem |
476 |
label: 'Implementors...' |
|
477 |
itemValue: doBrowseImplementors |
|
478 |
translateLabel: true |
|
3203 | 479 |
) |
480 |
) |
|
481 |
nil |
|
482 |
nil |
|
483 |
) |
|
484 |
) |
|
6766 | 485 |
(MenuItem |
486 |
label: 'Settings' |
|
487 |
translateLabel: true |
|
488 |
submenu: |
|
489 |
(Menu |
|
490 |
( |
|
491 |
(MenuItem |
|
492 |
label: 'Auto Compare' |
|
493 |
translateLabel: true |
|
494 |
indication: autoCompare |
|
3203 | 495 |
) |
6766 | 496 |
(MenuItem |
497 |
label: 'Auto Update' |
|
498 |
translateLabel: true |
|
499 |
isVisible: notReadOnly |
|
500 |
indication: autoUpdate |
|
3203 | 501 |
) |
18833 | 502 |
(MenuItem |
503 |
label: 'Autoload As Required' |
|
504 |
indication: autoloadAsRequired |
|
505 |
) |
|
6766 | 506 |
(MenuItem |
507 |
label: '-' |
|
3203 | 508 |
) |
6766 | 509 |
(MenuItem |
15017 | 510 |
label: 'Add Applies to ChangeSet' |
6766 | 511 |
translateLabel: true |
512 |
indication: updateChangeSet |
|
4483 | 513 |
) |
6766 | 514 |
(MenuItem |
515 |
label: 'Apply in Original NameSpace' |
|
516 |
translateLabel: true |
|
517 |
indication: applyInOriginalNameSpace |
|
3203 | 518 |
) |
6766 | 519 |
(MenuItem |
520 |
label: '-' |
|
4279
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
521 |
) |
6766 | 522 |
(MenuItem |
523 |
label: 'Apply into Package...' |
|
524 |
itemValue: setEnforcedPackage |
|
525 |
translateLabel: true |
|
4483 | 526 |
) |
6766 | 527 |
(MenuItem |
528 |
label: 'Apply in NameSpace...' |
|
529 |
itemValue: setEnforcedNameSpace |
|
530 |
translateLabel: true |
|
4279
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
531 |
) |
3203 | 532 |
) |
533 |
nil |
|
534 |
nil |
|
535 |
) |
|
536 |
) |
|
6766 | 537 |
(MenuItem |
538 |
label: 'Help' |
|
539 |
translateLabel: true |
|
540 |
startGroup: right |
|
541 |
submenu: |
|
542 |
(Menu |
|
543 |
( |
|
544 |
(MenuItem |
|
545 |
label: 'ChangesBrowser Documentation' |
|
546 |
itemValue: openHTMLDocument: |
|
547 |
translateLabel: true |
|
548 |
argument: 'tools/cbrowser/TOP.html' |
|
3203 | 549 |
) |
6766 | 550 |
(MenuItem |
551 |
label: '-' |
|
3205 | 552 |
) |
6766 | 553 |
(MenuItem |
554 |
label: 'About ChangesBrowser...' |
|
555 |
itemValue: openAboutThisApplication |
|
556 |
translateLabel: true |
|
3205 | 557 |
) |
3203 | 558 |
) |
559 |
nil |
|
560 |
nil |
|
561 |
) |
|
562 |
) |
|
563 |
) |
|
564 |
nil |
|
565 |
nil |
|
566 |
) |
|
18253 | 567 |
|
18833 | 568 |
"Modified: / 23-06-2019 / 13:31:14 / Claus Gittinger" |
3203 | 569 |
! ! |
570 |
||
15017 | 571 |
!ChangeSetBrowser methodsFor:'aspects'! |
572 |
||
573 |
canDeleteChanges |
|
574 |
"makes the delete buttons in the toolbar visible" |
|
575 |
||
576 |
^ false. |
|
577 |
! ! |
|
578 |
||
6297 | 579 |
!ChangeSetBrowser methodsFor:'initialization & release'! |
30 | 580 |
|
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
581 |
askIfChangesAreToBeWrittenBack |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
582 |
|action| |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
583 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
584 |
anyChanges ifFalse:[^ self]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
585 |
|
16751 | 586 |
action := OptionBox |
6644 | 587 |
request:(resources string:'The modified changeSet has not been saved.\\Update the changeSet before closing ?') withCRs |
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
588 |
label:'ChangesBrowser' |
16751 | 589 |
image:(WarningBox iconBitmap) |
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
590 |
buttonLabels:(resources array:#('Cancel' 'Don''t Update' 'Update')) |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
591 |
values:#(#abort #ignore #save) |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
592 |
default:#save |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
593 |
onCancel:#abort. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
594 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
595 |
action == #abort ifTrue:[^ self]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
596 |
action == #save ifTrue:[ |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
597 |
self saveBackChanges |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
598 |
]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
599 |
! |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
600 |
|
224 | 601 |
changeListMenu |
3203 | 602 |
<resource: #programMenu > |
603 |
||
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
604 |
|items m| |
30 | 605 |
|
3203 | 606 |
items := #( |
607 |
('Apply' doApply) |
|
608 |
('Apply to End' doApplyRest) |
|
15188 | 609 |
('Apply all changes' doApplyAll) |
3203 | 610 |
('-' ) |
611 |
('Delete' doDelete) |
|
612 |
('Delete to End' doDeleteRest) |
|
613 |
('Delete for Class to End' doDeleteClassRest) |
|
15188 | 614 |
('Delete all for Class' doDeleteClassAll) |
3203 | 615 |
('-' ) |
4316 | 616 |
"/ ('Compress' doCompress) |
3203 | 617 |
('Compare with Current' doCompare) |
618 |
('-' ) |
|
619 |
('Make Change a Patch' doMakePatch) |
|
620 |
('-' ) |
|
621 |
('Saveback ChangeSet' doSaveBack) |
|
622 |
('-' ) |
|
623 |
('Update' doUpdate) |
|
624 |
). |
|
224 | 625 |
|
14904 | 626 |
self device ctrlDown ifTrue:[ |
4316 | 627 |
items := #( |
628 |
('Inspect Change' doInspectChange) |
|
629 |
). |
|
630 |
]. |
|
631 |
||
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
632 |
m := PopUpMenu |
3203 | 633 |
itemList:items |
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
634 |
resources:resources. |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
635 |
|
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
636 |
readOnly == true ifTrue:[ |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
637 |
m disableAll:#(doDelete doDeleteRest doDeleteClassRest doDeleteClassAll |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
638 |
doDeleteClassAndPrivateClassesAll doCompress |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
639 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
640 |
doWriteBack doSaveBack doUpdate |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
641 |
doApplyAll doApplyRest) |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
642 |
]. |
3228 | 643 |
|
644 |
self hasSelection ifTrue:[ |
|
645 |
m disable:#doApplyAll |
|
646 |
]. |
|
647 |
||
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
648 |
^ m |
224 | 649 |
|
650 |
"Created: 3.12.1995 / 18:06:35 / cg" |
|
651 |
"Modified: 3.12.1995 / 18:13:06 / cg" |
|
30 | 652 |
! ! |
653 |
||
3857 | 654 |
!ChangeSetBrowser methodsFor:'menu aspects'! |
655 |
||
656 |
hasNotUndoableChangeSelected |
|
657 |
^ (self hasUndoableMethodChangeSelected |
|
658 |
or:[self hasUndoableRemoveMethodChangeSelected]) not |
|
659 |
! |
|
660 |
||
661 |
hasUndoableMethodChangeSelected |
|
662 |
|nr chg| |
|
663 |
||
664 |
self hasSingleSelection ifTrue:[ |
|
665 |
nr := self theSingleSelection. |
|
666 |
nr notNil ifTrue:[ |
|
667 |
chg := changeSet at:nr. |
|
668 |
chg isMethodChange ifTrue:[ |
|
669 |
chg isMethodRemoveChange ifFalse:[ |
|
670 |
chg previousVersion notNil ifTrue:[ |
|
671 |
^ true |
|
672 |
] |
|
673 |
] |
|
674 |
] |
|
675 |
] |
|
676 |
]. |
|
677 |
^ false |
|
678 |
! |
|
679 |
||
680 |
hasUndoableRemoveMethodChangeSelected |
|
681 |
|nr chg| |
|
682 |
||
683 |
self hasSingleSelection ifTrue:[ |
|
684 |
nr := self theSingleSelection. |
|
685 |
nr notNil ifTrue:[ |
|
686 |
chg := changeSet at:nr. |
|
687 |
chg isMethodRemoveChange ifTrue:[ |
|
688 |
chg previousVersion notNil ifTrue:[ |
|
689 |
^ true |
|
690 |
] |
|
691 |
] |
|
692 |
] |
|
693 |
]. |
|
694 |
^ false |
|
695 |
! ! |
|
696 |
||
2862
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
697 |
!ChangeSetBrowser methodsFor:'private'! |
1474 | 698 |
|
699 |
applyChange:changeNr |
|
700 |
"fileIn a change" |
|
701 |
||
4990 | 702 |
|nm applyAction aborted| |
1474 | 703 |
|
704 |
nm := self classNameOfChange:changeNr. |
|
705 |
nm notNil ifTrue:[ |
|
706 |
|cls| |
|
707 |
||
17989 | 708 |
cls := Smalltalk classNamed:nm. |
1474 | 709 |
cls notNil ifTrue:[ |
17989 | 710 |
cls autoload. |
1474 | 711 |
] |
712 |
]. |
|
713 |
||
714 |
changeNrProcessed := changeNr. |
|
4990 | 715 |
aborted := false. |
1474 | 716 |
|
717 |
applyAction := [ |
|
8300 | 718 |
"/ AbortOperationRequest handle:[:ex | |
719 |
"/ ^ false. |
|
720 |
"/ ] do:[ |
|
12655 | 721 |
ParseError handle:[:ex | |
18358 | 722 |
ex creator == UndefinedSuperclassError ifTrue:[ |
4279
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
723 |
codeView error:(ex errorString) position:1 to:nil from:nil |
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
724 |
] ifFalse:[ |
9716 | 725 |
codeView error:(ex description) position:(ex startPosition) to:(ex endPosition) from:(ex parser). |
726 |
ex mayProceed ifTrue:[ex proceed]. |
|
4279
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
727 |
] |
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
728 |
] do:[ |
7701 | 729 |
|nameSpace change package| |
4483 | 730 |
|
7701 | 731 |
change := changeSet at:changeNr. |
4483 | 732 |
nameSpace := self nameSpaceForApply. |
8300 | 733 |
change isDoIt ifTrue:[ |
734 |
package := enforcedPackage ? Class packageQuerySignal query. |
|
735 |
] ifFalse:[ |
|
736 |
package := enforcedPackage ? change package ? Class packageQuerySignal query. |
|
737 |
]. |
|
7701 | 738 |
|
739 |
Class packageQuerySignal answer:package |
|
4483 | 740 |
do:[ |
9716 | 741 |
"/ Class nameSpaceQuerySignal answer:nameSpace |
742 |
"/ do:[ |
|
7701 | 743 |
self applyPossiblyModifiedChange:change. |
9716 | 744 |
"/ ] |
4483 | 745 |
] |
8300 | 746 |
"/ ] |
1474 | 747 |
]. |
748 |
changeNrProcessed := nil. |
|
749 |
]. |
|
750 |
||
751 |
"/ |
|
17027 | 752 |
"/ if I am showing the changes file, don't update it |
1474 | 753 |
"/ |
754 |
changeFileName = ObjectMemory nameForChanges ifTrue:[ |
|
755 |
Class withoutUpdatingChangesDo:applyAction |
|
756 |
] ifFalse:[ |
|
757 |
applyAction value |
|
758 |
]. |
|
4990 | 759 |
^ aborted not |
1474 | 760 |
|
7701 | 761 |
"Created: / 07-02-1998 / 19:32:35 / cg" |
9716 | 762 |
"Modified: / 29-01-2011 / 11:46:44 / cg" |
17989 | 763 |
"Modified: / 15-02-2018 / 19:01:50 / stefan" |
18358 | 764 |
"Modified: / 27-08-2018 / 10:51:12 / Claus Gittinger" |
2862
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
765 |
! |
30 | 766 |
|
6603 | 767 |
applyPossiblyModifiedChange:aChange |
9717
c15333c458fd
changed: #applyPossiblyModifiedChange:
Claus Gittinger <cg@exept.de>
parents:
9716
diff
changeset
|
768 |
|ns superClass superClassName savedClassName| |
6603 | 769 |
|
6683 | 770 |
aChange isClassDefinitionChange ifTrue:[ |
771 |
superClassName := aChange superClassName. |
|
18831 | 772 |
(superClassName notNil and:[superClassName ~= 'nil']) ifTrue:[ |
6683 | 773 |
superClassName := superClassName asSymbol. |
774 |
applyInOriginalNameSpace value ifFalse:[ |
|
775 |
ns := Class nameSpaceQuerySignal query. |
|
776 |
superClass := ns at:superClassName. |
|
777 |
(superClass isNil and:[ superClass ~~ Smalltalk ]) ifTrue:[ |
|
778 |
superClass := Smalltalk at:superClassName. |
|
779 |
]. |
|
780 |
] ifTrue:[ |
|
6603 | 781 |
superClass := Smalltalk at:superClassName. |
782 |
]. |
|
7700 | 783 |
|
6603 | 784 |
superClass isNil ifTrue:[ |
18836 | 785 |
|guess idx baseName nsName dontShowAgain alwaysUseThisHolder| |
786 |
||
787 |
(ReplacementClasses notNil |
|
788 |
and:[(superClass := ReplacementClasses at:superClassName ifAbsent:nil) notNil]) |
|
789 |
ifTrue:[ |
|
790 |
] ifFalse:[ |
|
791 |
idx := superClassName lastIndexOf:$:. |
|
792 |
baseName := superClassName copyFrom:idx+1. |
|
793 |
nsName := superClassName copyTo:idx-2. |
|
794 |
guess := Smalltalk classNamed:baseName. |
|
795 |
guess isNil ifTrue:[ |
|
796 |
enforcedNameSpace notNil ifTrue:[ |
|
797 |
guess := enforcedNameSpace classNamed:baseName |
|
798 |
]. |
|
799 |
guess isNil ifTrue:[ |
|
800 |
guess := SystemBrowser classesWithNameSimilarTo:baseName. |
|
801 |
guess notEmptyOrNil ifTrue:[ guess := guess first ] ifFalse:[ guess := nil ]. |
|
802 |
]. |
|
803 |
]. |
|
804 |
alwaysUseThisHolder := false asValue. |
|
805 |
Dialog |
|
806 |
modifyingBoxWith:[:box | |
|
807 |
|b| |
|
7700 | 808 |
|
18836 | 809 |
b := Button |
810 |
label:'Create Dummy' |
|
811 |
action:[ |
|
812 |
|newClass| |
|
813 |
newClass := Object subclass:(superClassName asSymbol) |
|
814 |
instanceVariableNames:'' |
|
815 |
classVariableNames:'' |
|
816 |
poolDictionaries:'' |
|
817 |
category:'* dummy *'. |
|
818 |
box okPressed. |
|
819 |
newClass. |
|
820 |
]. |
|
821 |
box addButton:b after:nil. |
|
822 |
box verticalPanel add:(CheckBox |
|
823 |
label:('Always use this for %1' bindWith:superClassName) |
|
824 |
model:alwaysUseThisHolder). |
|
825 |
box forceResize. |
|
826 |
] |
|
827 |
do:[ |
|
828 |
superClass := Dialog |
|
829 |
requestClass:'No superclass: ', superClassName allBold , ' enter a replacement:' |
|
830 |
initialAnswer:(guess ? superClassName). |
|
831 |
]. |
|
832 |
||
833 |
superClass isNil ifTrue:[AbortOperationRequest raise. ^ self ]. |
|
834 |
alwaysUseThisHolder value ifTrue:[ |
|
835 |
ReplacementClasses isNil ifTrue:[ |
|
836 |
ReplacementClasses := Dictionary new. |
|
837 |
]. |
|
838 |
ReplacementClasses at:superClassName put:superClass. |
|
839 |
] |
|
6760 | 840 |
]. |
6603 | 841 |
]. |
6683 | 842 |
|
6603 | 843 |
superClass notNil ifTrue:[ |
844 |
aChange superClassName:superClass name. |
|
6683 | 845 |
]. |
6603 | 846 |
]. |
847 |
]. |
|
9717
c15333c458fd
changed: #applyPossiblyModifiedChange:
Claus Gittinger <cg@exept.de>
parents:
9716
diff
changeset
|
848 |
(enforcedNameSpace notNil and:[(savedClassName := aChange className) notNil]) ifTrue:[ |
8870 | 849 |
[ |
9717
c15333c458fd
changed: #applyPossiblyModifiedChange:
Claus Gittinger <cg@exept.de>
parents:
9716
diff
changeset
|
850 |
|
c15333c458fd
changed: #applyPossiblyModifiedChange:
Claus Gittinger <cg@exept.de>
parents:
9716
diff
changeset
|
851 |
Error ignoreIn:[ aChange class:(enforcedNameSpace classNamed:savedClassName) ]. |
c15333c458fd
changed: #applyPossiblyModifiedChange:
Claus Gittinger <cg@exept.de>
parents:
9716
diff
changeset
|
852 |
aChange className:(enforcedNameSpace name,'::',savedClassName). |
15530 | 853 |
"/ Class nameSpaceQuerySignal answer:enforcedNameSpace do:[ |
854 |
aChange apply. |
|
855 |
"/ ]. |
|
8870 | 856 |
] ensure:[ |
9717
c15333c458fd
changed: #applyPossiblyModifiedChange:
Claus Gittinger <cg@exept.de>
parents:
9716
diff
changeset
|
857 |
aChange className:savedClassName |
8870 | 858 |
]. |
859 |
] ifFalse:[ |
|
860 |
aChange apply. |
|
861 |
]. |
|
7700 | 862 |
|
9717
c15333c458fd
changed: #applyPossiblyModifiedChange:
Claus Gittinger <cg@exept.de>
parents:
9716
diff
changeset
|
863 |
"Modified: / 29-01-2011 / 12:30:35 / cg" |
18836 | 864 |
"Modified: / 23-06-2019 / 13:58:06 / Claus Gittinger" |
6603 | 865 |
! |
866 |
||
1470 | 867 |
changeIsFollowupMethodChange:changeNr |
868 |
^ false |
|
869 |
||
870 |
"Created: / 6.2.1998 / 13:04:59 / cg" |
|
1474 | 871 |
"Modified: / 7.2.1998 / 19:28:52 / cg" |
1470 | 872 |
! |
873 |
||
30 | 874 |
changeSet:aChangeSet |
6964 | 875 |
changeFileName := nil. |
30 | 876 |
originalChangeSet := aChangeSet. |
877 |
changeSet := OrderedCollection new. |
|
106 | 878 |
originalChangeSet notNil ifTrue:[ |
6964 | 879 |
originalChangeSet do:[:aChange | |
880 |
changeSet add:aChange |
|
881 |
]. |
|
30 | 882 |
]. |
883 |
! |
|
884 |
||
222 | 885 |
checkIfFileHasChanged |
886 |
Processor removeTimedBlock:checkBlock. |
|
887 |
changeSet size ~= originalChangeSet size ifTrue:[ |
|
888 |
self newLabel:'(outdated)'. |
|
3203 | 889 |
autoUpdate value ifTrue:[ |
222 | 890 |
self doUpdate |
891 |
] |
|
892 |
] ifFalse:[ |
|
5178 | 893 |
"/ self newLabel:'' |
222 | 894 |
]. |
895 |
Processor addTimedBlock:checkBlock afterSeconds:5. |
|
896 |
||
897 |
"Created: 3.12.1995 / 13:52:30 / cg" |
|
898 |
"Modified: 3.12.1995 / 14:15:06 / cg" |
|
899 |
! |
|
900 |
||
1470 | 901 |
fullClassNameOfChange:nr |
4992 | 902 |
^ (changeSet at:nr) fullClassName |
1470 | 903 |
|
904 |
"Created: / 6.2.1998 / 13:02:25 / cg" |
|
905 |
"Modified: / 6.2.1998 / 13:07:02 / cg" |
|
906 |
! |
|
907 |
||
3203 | 908 |
isChangeSetBrowser |
909 |
^ true |
|
910 |
! |
|
911 |
||
224 | 912 |
numberOfChanges |
913 |
^ changeSet size |
|
914 |
||
915 |
"Created: 3.12.1995 / 18:15:56 / cg" |
|
916 |
! |
|
917 |
||
222 | 918 |
queryCloseText |
919 |
^ 'Quit without updating changeSet ?' |
|
920 |
! |
|
921 |
||
45 | 922 |
readChangesFileInBackground:dummy |
30 | 923 |
"read the changeSet, create a list of header-lines" |
924 |
||
12600
29a26b712ceb
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
9782
diff
changeset
|
925 |
self withCursor:(Cursor read) do:[ |
16388 | 926 |
changeInfoList := OrderedCollection new. |
927 |
||
3673 | 928 |
changeSet size == 0 ifTrue:[ |
929 |
changeFileName notNil ifTrue:[ |
|
930 |
changeSet := self class readXMLChangesFromFile:changeFileName inBackground:false. |
|
931 |
]. |
|
15013 | 932 |
changeSet size == 0 ifTrue:[ ^ nil ]. |
3673 | 933 |
]. |
934 |
||
15013 | 935 |
"/ tabSpec := TabulatorSpecification new. |
936 |
"/ tabSpec unit:#inch. |
|
937 |
"/ tabSpec positions:#(-1 0 5 8.5 ). |
|
938 |
"/ " +/- cls>>sel type info" |
|
939 |
"/ tabSpec align: #(#left #left #left #left). |
|
30 | 940 |
|
15013 | 941 |
changeSet do:[:aChange | |
16388 | 942 |
|info changeSource entry time |
18836 | 943 |
changeDelta changeClass changeClassName changeSelector isMeta| |
15013 | 944 |
|
945 |
changeSource := aChange source "printString". |
|
16388 | 946 |
changeClassName := aChange className. |
15013 | 947 |
|
16388 | 948 |
aChange isMethodCodeChange ifTrue:[ |
949 |
changeClass := aChange changeClass. |
|
18836 | 950 |
changeClass isNil ifTrue:[ |
951 |
enforcedNameSpace notNil ifTrue:[ |
|
952 |
(isMeta := (changeClassName endsWith:' class')) ifTrue:[ |
|
953 |
changeClassName := changeClassName withoutSuffix:' class' |
|
954 |
]. |
|
955 |
(enforcedNameSpace at:changeClassName) notNil ifTrue:[ |
|
956 |
aChange nameSpace:enforcedNameSpace. |
|
957 |
changeClass := aChange changeClass. |
|
958 |
]. |
|
959 |
] |
|
960 |
]. |
|
16388 | 961 |
changeSelector := aChange selector. |
15013 | 962 |
changeDelta := ChangeDeltaInformation |
963 |
changeDeltaFor:changeSource |
|
16388 | 964 |
changeClass:changeClass |
965 |
selector:changeSelector. |
|
15013 | 966 |
] ifFalse:[ |
967 |
changeDelta := ' '. |
|
968 |
]. |
|
969 |
||
3673 | 970 |
"/ changeHeaderLines add:(aChange printString) |
971 |
entry := MultiColListEntry new. |
|
972 |
entry tabulatorSpecification:tabSpec. |
|
15013 | 973 |
entry colAt:1 put:changeDelta. |
3673 | 974 |
entry colAt:2 put:aChange printString. |
975 |
entry colAt:3 put:''. "/ changeType. |
|
976 |
||
977 |
(aChange respondsTo:#timeOfChangeIfKnown) ifTrue:[ |
|
16388 | 978 |
(time := aChange timeOfChangeIfKnown) notNil ifTrue:[ |
979 |
entry colAt:4 put:(self timeStampPrintStringOf:time). |
|
3673 | 980 |
] |
981 |
]. |
|
16388 | 982 |
info := ChangesBrowser::ChangeInfo new |
983 |
position:nil |
|
984 |
chunk:changeSource |
|
985 |
className:changeClassName |
|
986 |
selector:changeSelector |
|
987 |
headerLine:entry |
|
988 |
timestamp:time |
|
989 |
isFollowupChange:false. |
|
990 |
changeInfoList add:info. |
|
991 |
||
3673 | 992 |
]. |
993 |
anyChanges := false |
|
224 | 994 |
]. |
995 |
||
18836 | 996 |
"Created: / 03-12-1995 / 18:02:39 / cg" |
997 |
"Modified: / 23-06-2019 / 17:09:35 / Claus Gittinger" |
|
30 | 998 |
! |
999 |
||
3364 | 1000 |
realClassNameOfChange:nr |
15530 | 1001 |
^ (changeSet at:nr) fullClassName "/ className. |
3364 | 1002 |
|
1003 |
"Created: / 5.11.2001 / 18:10:38 / cg" |
|
1004 |
! |
|
1005 |
||
30 | 1006 |
saveBackChanges |
1007 |
"save back the change set" |
|
1008 |
||
1009 |
[originalChangeSet isEmpty] whileFalse:[ |
|
45 | 1010 |
originalChangeSet removeLast |
30 | 1011 |
]. |
1012 |
changeSet do:[:aChange | |
|
45 | 1013 |
originalChangeSet add:aChange |
30 | 1014 |
] |
1015 |
! |
|
1016 |
||
1470 | 1017 |
selectorOfMethodChange:changeNr |
1018 |
^ (changeSet at:changeNr) selector |
|
1019 |
||
1020 |
"Created: / 6.2.1998 / 13:28:20 / cg" |
|
1021 |
"Modified: / 6.2.1998 / 13:29:59 / cg" |
|
1022 |
! |
|
1023 |
||
30 | 1024 |
silentDeleteChange:changeNr |
1025 |
"delete a change do not update changeListView" |
|
1026 |
||
1474 | 1027 |
changeSet removeIndex:changeNr. |
1028 |
super silentDeleteChange:changeNr. |
|
1029 |
||
1030 |
"Created: / 3.12.1995 / 18:14:17 / cg" |
|
1031 |
"Modified: / 7.2.1998 / 19:57:57 / cg" |
|
1032 |
! |
|
224 | 1033 |
|
1474 | 1034 |
silentDeleteInternalChange:changeNr |
1035 |
"delete a change do not update changeListView" |
|
1036 |
||
1037 |
changeSet removeIndex:changeNr. |
|
1038 |
super silentDeleteInternalChange:changeNr. |
|
1039 |
||
1040 |
"Modified: / 7.2.1998 / 19:44:45 / cg" |
|
1041 |
"Created: / 7.2.1998 / 19:58:02 / cg" |
|
222 | 1042 |
! |
1043 |
||
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
1044 |
sourceOfChange:changeNr |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
1045 |
"answer a changes source" |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
1046 |
|
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
1047 |
|change| |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
1048 |
|
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
1049 |
change := changeSet at:changeNr. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
1050 |
change isNil ifTrue:[^nil]. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
1051 |
^ change source |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
1052 |
|
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
1053 |
"Modified: / 7.2.1998 / 19:52:44 / cg" |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
1054 |
! |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
1055 |
|
222 | 1056 |
streamForChange:changeNr |
1057 |
"answer a stream for change" |
|
1058 |
||
4990 | 1059 |
|change str source| |
222 | 1060 |
|
1061 |
change := changeSet at:changeNr. |
|
1062 |
change isNil ifTrue:[^nil]. |
|
14981 | 1063 |
change isMethodDefinitionChange ifTrue:[ |
4430
665173b18b94
oops - streamforchange was wrong (exclas)
Claus Gittinger <cg@exept.de>
parents:
4316
diff
changeset
|
1064 |
str := WriteStream on:''. |
665173b18b94
oops - streamforchange was wrong (exclas)
Claus Gittinger <cg@exept.de>
parents:
4316
diff
changeset
|
1065 |
str nextPutChunkSeparator. |
14970 | 1066 |
str nextPutAll:(change className , ' methodsFor:''' , (change methodCategory ? '*** not categorized ***') , ''''). |
4430
665173b18b94
oops - streamforchange was wrong (exclas)
Claus Gittinger <cg@exept.de>
parents:
4316
diff
changeset
|
1067 |
str nextPutChunkSeparator. |
665173b18b94
oops - streamforchange was wrong (exclas)
Claus Gittinger <cg@exept.de>
parents:
4316
diff
changeset
|
1068 |
str cr. |
665173b18b94
oops - streamforchange was wrong (exclas)
Claus Gittinger <cg@exept.de>
parents:
4316
diff
changeset
|
1069 |
str nextPutAllAsChunk:change source. |
665173b18b94
oops - streamforchange was wrong (exclas)
Claus Gittinger <cg@exept.de>
parents:
4316
diff
changeset
|
1070 |
str nextPutChunkSeparator. |
665173b18b94
oops - streamforchange was wrong (exclas)
Claus Gittinger <cg@exept.de>
parents:
4316
diff
changeset
|
1071 |
str space. |
665173b18b94
oops - streamforchange was wrong (exclas)
Claus Gittinger <cg@exept.de>
parents:
4316
diff
changeset
|
1072 |
str nextPutChunkSeparator. |
665173b18b94
oops - streamforchange was wrong (exclas)
Claus Gittinger <cg@exept.de>
parents:
4316
diff
changeset
|
1073 |
str cr. |
4990 | 1074 |
source := str contents |
1075 |
] ifFalse:[ |
|
1076 |
source := change source |
|
1474 | 1077 |
]. |
4990 | 1078 |
^ ReadStream on:source |
1474 | 1079 |
|
1080 |
"Modified: / 7.2.1998 / 19:52:44 / cg" |
|
30 | 1081 |
! ! |
1082 |
||
1083 |
!ChangeSetBrowser methodsFor:'user actions'! |
|
1084 |
||
15017 | 1085 |
compareChange:changeNr showResult:doShowResult |
1086 |
|change isSame outcome beep oldSource newSource showDiff d| |
|
1087 |
||
1088 |
change := changeSet at:changeNr. |
|
1089 |
change isMethodCodeChange ifTrue:[ |
|
1090 |
newSource := change source. |
|
1091 |
||
1092 |
isSame := self |
|
1093 |
compareMethodSource:newSource |
|
1094 |
withVersionInClass:change changeClass |
|
1095 |
into:[:outcomeResult :beepResult :oldSourceResult | |
|
1096 |
outcome := outcomeResult. |
|
1097 |
beep := beepResult. |
|
1098 |
oldSource := oldSourceResult. |
|
1099 |
]. |
|
1100 |
||
1101 |
isSame isNil ifTrue:[ |
|
1102 |
showDiff := false. |
|
1103 |
] ifFalse:[ |
|
1104 |
showDiff := isSame not. |
|
1105 |
]. |
|
1106 |
||
1107 |
doShowResult ifTrue:[ |
|
1108 |
(showDiff and:[oldSource notNil and:[newSource notNil]]) ifTrue:[ |
|
1109 |
d := DiffCodeView |
|
1110 |
openOn:oldSource label:(resources string:'Current version (in image)') |
|
1111 |
and:newSource label:(resources string:'Change version'). |
|
1112 |
d label:'method differences'. |
|
1113 |
] |
|
1114 |
]. |
|
1115 |
] ifFalse:[ |
|
1116 |
super compareChange:changeNr showResult:doShowResult |
|
1117 |
]. |
|
1118 |
! |
|
1119 |
||
4316 | 1120 |
doInspectChange |
1121 |
self withSelectedChangesDo:[:changeNr | |
|
1122 |
(changeSet at:changeNr) inspect |
|
1123 |
]. |
|
1124 |
! |
|
1125 |
||
30 | 1126 |
doSaveBack |
1127 |
anyChanges ifTrue:[ |
|
45 | 1128 |
self saveBackChanges. |
1129 |
self doUpdate |
|
30 | 1130 |
] |
222 | 1131 |
! |
1132 |
||
1133 |
doUpdate |
|
1134 |
changeSet := OrderedCollection new. |
|
1135 |
originalChangeSet notNil ifTrue:[ |
|
1136 |
originalChangeSet do:[:aChange | |
|
1137 |
changeSet add:aChange |
|
1138 |
]. |
|
1139 |
]. |
|
1140 |
super doUpdate |
|
1141 |
||
1142 |
"Created: 3.12.1995 / 13:54:14 / cg" |
|
4942 | 1143 |
! |
1144 |
||
1145 |
updateDiffViewFor:changeNr |
|
1146 |
|change class selector oldMethod newSource oldSource| |
|
1147 |
||
1148 |
change := changeSet at:changeNr. |
|
8870 | 1149 |
(change isMethodChange and:[change isMethodCodeChange]) ifTrue:[ |
4942 | 1150 |
newSource := change source. |
8870 | 1151 |
enforcedNameSpace notNil ifTrue:[ |
1152 |
class := enforcedNameSpace classNamed:change className. |
|
1153 |
] ifFalse:[ |
|
1154 |
class := change changeClass. |
|
1155 |
]. |
|
4942 | 1156 |
class notNil ifTrue:[ |
1157 |
selector := change changeSelector. |
|
1158 |
selector notNil ifTrue:[ |
|
1159 |
oldMethod := class compiledMethodAt:selector. |
|
1160 |
oldMethod notNil ifTrue:[ |
|
1161 |
oldSource := oldMethod source. |
|
1162 |
diffView text1:(oldSource ? '') text2:(newSource ? ''). |
|
1163 |
^ self. |
|
1164 |
] |
|
1165 |
]. |
|
1166 |
] |
|
1167 |
]. |
|
1168 |
||
1169 |
super updateDiffViewFor:changeNr. |
|
30 | 1170 |
! ! |
222 | 1171 |
|
1172 |
!ChangeSetBrowser class methodsFor:'documentation'! |
|
1173 |
||
1174 |
version |
|
16388 | 1175 |
^ '$Header$' |
8869 | 1176 |
! |
1177 |
||
1178 |
version_CVS |
|
16388 | 1179 |
^ '$Header$' |
222 | 1180 |
! ! |
12600
29a26b712ceb
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
9782
diff
changeset
|
1181 |