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