author | Stefan Vogel <sv@exept.de> |
Tue, 22 May 2018 18:28:55 +0200 | |
changeset 18140 | 1e791dffc7c1 |
parent 17989 | fe5233911e1b |
child 18253 | 7902bd5cd26e |
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 |
223 |
label: 'Change' |
|
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 |
) |
|
548 |
! ! |
|
549 |
||
15017 | 550 |
!ChangeSetBrowser methodsFor:'aspects'! |
551 |
||
552 |
canDeleteChanges |
|
553 |
"makes the delete buttons in the toolbar visible" |
|
554 |
||
555 |
^ false. |
|
556 |
! ! |
|
557 |
||
6297 | 558 |
!ChangeSetBrowser methodsFor:'initialization & release'! |
30 | 559 |
|
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
560 |
askIfChangesAreToBeWrittenBack |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
561 |
|action| |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
562 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
563 |
anyChanges ifFalse:[^ self]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
564 |
|
16751 | 565 |
action := OptionBox |
6644 | 566 |
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
|
567 |
label:'ChangesBrowser' |
16751 | 568 |
image:(WarningBox iconBitmap) |
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
569 |
buttonLabels:(resources array:#('Cancel' 'Don''t Update' 'Update')) |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
570 |
values:#(#abort #ignore #save) |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
571 |
default:#save |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
572 |
onCancel:#abort. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
573 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
574 |
action == #abort ifTrue:[^ self]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
575 |
action == #save ifTrue:[ |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
576 |
self saveBackChanges |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
577 |
]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
578 |
! |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
579 |
|
224 | 580 |
changeListMenu |
3203 | 581 |
<resource: #programMenu > |
582 |
||
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
583 |
|items m| |
30 | 584 |
|
3203 | 585 |
items := #( |
586 |
('Apply' doApply) |
|
587 |
('Apply to End' doApplyRest) |
|
15188 | 588 |
('Apply all changes' doApplyAll) |
3203 | 589 |
('-' ) |
590 |
('Delete' doDelete) |
|
591 |
('Delete to End' doDeleteRest) |
|
592 |
('Delete for Class to End' doDeleteClassRest) |
|
15188 | 593 |
('Delete all for Class' doDeleteClassAll) |
3203 | 594 |
('-' ) |
4316 | 595 |
"/ ('Compress' doCompress) |
3203 | 596 |
('Compare with Current' doCompare) |
597 |
('-' ) |
|
598 |
('Make Change a Patch' doMakePatch) |
|
599 |
('-' ) |
|
600 |
('Saveback ChangeSet' doSaveBack) |
|
601 |
('-' ) |
|
602 |
('Update' doUpdate) |
|
603 |
). |
|
224 | 604 |
|
14904 | 605 |
self device ctrlDown ifTrue:[ |
4316 | 606 |
items := #( |
607 |
('Inspect Change' doInspectChange) |
|
608 |
). |
|
609 |
]. |
|
610 |
||
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
611 |
m := PopUpMenu |
3203 | 612 |
itemList:items |
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
613 |
resources:resources. |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
614 |
|
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
615 |
readOnly == true ifTrue:[ |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
616 |
m disableAll:#(doDelete doDeleteRest doDeleteClassRest doDeleteClassAll |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
617 |
doDeleteClassAndPrivateClassesAll doCompress |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
618 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
619 |
doWriteBack doSaveBack doUpdate |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
620 |
doApplyAll doApplyRest) |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
621 |
]. |
3228 | 622 |
|
623 |
self hasSelection ifTrue:[ |
|
624 |
m disable:#doApplyAll |
|
625 |
]. |
|
626 |
||
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
627 |
^ m |
224 | 628 |
|
629 |
"Created: 3.12.1995 / 18:06:35 / cg" |
|
630 |
"Modified: 3.12.1995 / 18:13:06 / cg" |
|
4942 | 631 |
! |
632 |
||
633 |
showingDiffsDefault |
|
16751 | 634 |
^ "false" super showingDiffsDefault |
30 | 635 |
! ! |
636 |
||
3857 | 637 |
!ChangeSetBrowser methodsFor:'menu aspects'! |
638 |
||
639 |
hasNotUndoableChangeSelected |
|
640 |
^ (self hasUndoableMethodChangeSelected |
|
641 |
or:[self hasUndoableRemoveMethodChangeSelected]) not |
|
642 |
! |
|
643 |
||
644 |
hasUndoableMethodChangeSelected |
|
645 |
|nr chg| |
|
646 |
||
647 |
self hasSingleSelection ifTrue:[ |
|
648 |
nr := self theSingleSelection. |
|
649 |
nr notNil ifTrue:[ |
|
650 |
chg := changeSet at:nr. |
|
651 |
chg isMethodChange ifTrue:[ |
|
652 |
chg isMethodRemoveChange ifFalse:[ |
|
653 |
chg previousVersion notNil ifTrue:[ |
|
654 |
^ true |
|
655 |
] |
|
656 |
] |
|
657 |
] |
|
658 |
] |
|
659 |
]. |
|
660 |
^ false |
|
661 |
! |
|
662 |
||
663 |
hasUndoableRemoveMethodChangeSelected |
|
664 |
|nr chg| |
|
665 |
||
666 |
self hasSingleSelection ifTrue:[ |
|
667 |
nr := self theSingleSelection. |
|
668 |
nr notNil ifTrue:[ |
|
669 |
chg := changeSet at:nr. |
|
670 |
chg isMethodRemoveChange ifTrue:[ |
|
671 |
chg previousVersion notNil ifTrue:[ |
|
672 |
^ true |
|
673 |
] |
|
674 |
] |
|
675 |
] |
|
676 |
]. |
|
677 |
^ false |
|
678 |
! ! |
|
679 |
||
2862
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
680 |
!ChangeSetBrowser methodsFor:'private'! |
1474 | 681 |
|
682 |
applyChange:changeNr |
|
683 |
"fileIn a change" |
|
684 |
||
4990 | 685 |
|nm applyAction aborted| |
1474 | 686 |
|
687 |
nm := self classNameOfChange:changeNr. |
|
688 |
nm notNil ifTrue:[ |
|
689 |
|cls| |
|
690 |
||
17989 | 691 |
cls := Smalltalk classNamed:nm. |
1474 | 692 |
cls notNil ifTrue:[ |
17989 | 693 |
cls autoload. |
1474 | 694 |
] |
695 |
]. |
|
696 |
||
697 |
changeNrProcessed := changeNr. |
|
4990 | 698 |
aborted := false. |
1474 | 699 |
|
700 |
applyAction := [ |
|
8300 | 701 |
"/ AbortOperationRequest handle:[:ex | |
702 |
"/ ^ false. |
|
703 |
"/ ] do:[ |
|
12655 | 704 |
ParseError handle:[:ex | |
705 |
ex signal == UndefinedSuperclassError ifTrue:[ |
|
4279
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
706 |
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
|
707 |
] ifFalse:[ |
9716 | 708 |
codeView error:(ex description) position:(ex startPosition) to:(ex endPosition) from:(ex parser). |
709 |
ex mayProceed ifTrue:[ex proceed]. |
|
4279
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
710 |
] |
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
711 |
] do:[ |
7701 | 712 |
|nameSpace change package| |
4483 | 713 |
|
7701 | 714 |
change := changeSet at:changeNr. |
4483 | 715 |
nameSpace := self nameSpaceForApply. |
8300 | 716 |
change isDoIt ifTrue:[ |
717 |
package := enforcedPackage ? Class packageQuerySignal query. |
|
718 |
] ifFalse:[ |
|
719 |
package := enforcedPackage ? change package ? Class packageQuerySignal query. |
|
720 |
]. |
|
7701 | 721 |
|
722 |
Class packageQuerySignal answer:package |
|
4483 | 723 |
do:[ |
9716 | 724 |
"/ Class nameSpaceQuerySignal answer:nameSpace |
725 |
"/ do:[ |
|
7701 | 726 |
self applyPossiblyModifiedChange:change. |
9716 | 727 |
"/ ] |
4483 | 728 |
] |
8300 | 729 |
"/ ] |
1474 | 730 |
]. |
731 |
changeNrProcessed := nil. |
|
732 |
]. |
|
733 |
||
734 |
"/ |
|
17027 | 735 |
"/ if I am showing the changes file, don't update it |
1474 | 736 |
"/ |
737 |
changeFileName = ObjectMemory nameForChanges ifTrue:[ |
|
738 |
Class withoutUpdatingChangesDo:applyAction |
|
739 |
] ifFalse:[ |
|
740 |
applyAction value |
|
741 |
]. |
|
4990 | 742 |
^ aborted not |
1474 | 743 |
|
7701 | 744 |
"Created: / 07-02-1998 / 19:32:35 / cg" |
9716 | 745 |
"Modified: / 29-01-2011 / 11:46:44 / cg" |
17989 | 746 |
"Modified: / 15-02-2018 / 19:01:50 / stefan" |
2862
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
747 |
! |
30 | 748 |
|
6603 | 749 |
applyPossiblyModifiedChange:aChange |
9717
c15333c458fd
changed: #applyPossiblyModifiedChange:
Claus Gittinger <cg@exept.de>
parents:
9716
diff
changeset
|
750 |
|ns superClass superClassName savedClassName| |
6603 | 751 |
|
6683 | 752 |
aChange isClassDefinitionChange ifTrue:[ |
753 |
superClassName := aChange superClassName. |
|
754 |
superClassName notNil ifTrue:[ |
|
755 |
superClassName := superClassName asSymbol. |
|
756 |
applyInOriginalNameSpace value ifFalse:[ |
|
757 |
ns := Class nameSpaceQuerySignal query. |
|
758 |
superClass := ns at:superClassName. |
|
759 |
(superClass isNil and:[ superClass ~~ Smalltalk ]) ifTrue:[ |
|
760 |
superClass := Smalltalk at:superClassName. |
|
761 |
]. |
|
762 |
] ifTrue:[ |
|
6603 | 763 |
superClass := Smalltalk at:superClassName. |
764 |
]. |
|
7700 | 765 |
|
6603 | 766 |
superClass isNil ifTrue:[ |
7700 | 767 |
|guess idx baseName nsName dontShowAgain| |
768 |
||
6760 | 769 |
idx := superClassName lastIndexOf:$:. |
770 |
baseName := superClassName copyFrom:idx+1. |
|
7700 | 771 |
nsName := superClassName copyTo:idx-2. |
6760 | 772 |
guess := Smalltalk classNamed:baseName. |
773 |
guess isNil ifTrue:[ |
|
15529 | 774 |
enforcedNameSpace notNil ifTrue:[ |
775 |
guess := enforcedNameSpace classNamed:baseName |
|
776 |
]. |
|
777 |
guess isNil ifTrue:[ |
|
778 |
guess := SystemBrowser classesWithNameSimilarTo:baseName. |
|
779 |
guess notEmptyOrNil ifTrue:[ guess := guess first ] ifFalse:[ guess := nil ]. |
|
780 |
]. |
|
6760 | 781 |
]. |
7700 | 782 |
|
6683 | 783 |
superClass := Dialog |
7700 | 784 |
requestClass:'No superclass: ', superClassName allBold , ' enter a replacement:' |
785 |
initialAnswer:(guess ? superClassName). |
|
786 |
||
8300 | 787 |
superClass isNil ifTrue:[AbortOperationRequest raise. ^ self ]. |
6603 | 788 |
]. |
6683 | 789 |
|
6603 | 790 |
superClass notNil ifTrue:[ |
791 |
aChange superClassName:superClass name. |
|
6683 | 792 |
]. |
6603 | 793 |
]. |
794 |
]. |
|
9717
c15333c458fd
changed: #applyPossiblyModifiedChange:
Claus Gittinger <cg@exept.de>
parents:
9716
diff
changeset
|
795 |
(enforcedNameSpace notNil and:[(savedClassName := aChange className) notNil]) ifTrue:[ |
8870 | 796 |
[ |
9717
c15333c458fd
changed: #applyPossiblyModifiedChange:
Claus Gittinger <cg@exept.de>
parents:
9716
diff
changeset
|
797 |
|
c15333c458fd
changed: #applyPossiblyModifiedChange:
Claus Gittinger <cg@exept.de>
parents:
9716
diff
changeset
|
798 |
Error ignoreIn:[ aChange class:(enforcedNameSpace classNamed:savedClassName) ]. |
c15333c458fd
changed: #applyPossiblyModifiedChange:
Claus Gittinger <cg@exept.de>
parents:
9716
diff
changeset
|
799 |
aChange className:(enforcedNameSpace name,'::',savedClassName). |
15530 | 800 |
"/ Class nameSpaceQuerySignal answer:enforcedNameSpace do:[ |
801 |
aChange apply. |
|
802 |
"/ ]. |
|
8870 | 803 |
] ensure:[ |
9717
c15333c458fd
changed: #applyPossiblyModifiedChange:
Claus Gittinger <cg@exept.de>
parents:
9716
diff
changeset
|
804 |
aChange className:savedClassName |
8870 | 805 |
]. |
806 |
] ifFalse:[ |
|
807 |
aChange apply. |
|
808 |
]. |
|
7700 | 809 |
|
9717
c15333c458fd
changed: #applyPossiblyModifiedChange:
Claus Gittinger <cg@exept.de>
parents:
9716
diff
changeset
|
810 |
"Modified: / 29-01-2011 / 12:30:35 / cg" |
6603 | 811 |
! |
812 |
||
1470 | 813 |
changeIsFollowupMethodChange:changeNr |
814 |
^ false |
|
815 |
||
816 |
"Created: / 6.2.1998 / 13:04:59 / cg" |
|
1474 | 817 |
"Modified: / 7.2.1998 / 19:28:52 / cg" |
1470 | 818 |
! |
819 |
||
30 | 820 |
changeSet:aChangeSet |
6964 | 821 |
changeFileName := nil. |
30 | 822 |
originalChangeSet := aChangeSet. |
823 |
changeSet := OrderedCollection new. |
|
106 | 824 |
originalChangeSet notNil ifTrue:[ |
6964 | 825 |
originalChangeSet do:[:aChange | |
826 |
changeSet add:aChange |
|
827 |
]. |
|
30 | 828 |
]. |
829 |
! |
|
830 |
||
222 | 831 |
checkIfFileHasChanged |
832 |
Processor removeTimedBlock:checkBlock. |
|
833 |
changeSet size ~= originalChangeSet size ifTrue:[ |
|
834 |
self newLabel:'(outdated)'. |
|
3203 | 835 |
autoUpdate value ifTrue:[ |
222 | 836 |
self doUpdate |
837 |
] |
|
838 |
] ifFalse:[ |
|
5178 | 839 |
"/ self newLabel:'' |
222 | 840 |
]. |
841 |
Processor addTimedBlock:checkBlock afterSeconds:5. |
|
842 |
||
843 |
"Created: 3.12.1995 / 13:52:30 / cg" |
|
844 |
"Modified: 3.12.1995 / 14:15:06 / cg" |
|
845 |
! |
|
846 |
||
1470 | 847 |
fullClassNameOfChange:nr |
4992 | 848 |
^ (changeSet at:nr) fullClassName |
1470 | 849 |
|
850 |
"Created: / 6.2.1998 / 13:02:25 / cg" |
|
851 |
"Modified: / 6.2.1998 / 13:07:02 / cg" |
|
852 |
! |
|
853 |
||
3203 | 854 |
isChangeSetBrowser |
855 |
^ true |
|
856 |
! |
|
857 |
||
224 | 858 |
numberOfChanges |
859 |
^ changeSet size |
|
860 |
||
861 |
"Created: 3.12.1995 / 18:15:56 / cg" |
|
862 |
! |
|
863 |
||
222 | 864 |
queryCloseText |
865 |
^ 'Quit without updating changeSet ?' |
|
866 |
! |
|
867 |
||
45 | 868 |
readChangesFileInBackground:dummy |
30 | 869 |
"read the changeSet, create a list of header-lines" |
870 |
||
12600
29a26b712ceb
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
9782
diff
changeset
|
871 |
self withCursor:(Cursor read) do:[ |
16388 | 872 |
changeInfoList := OrderedCollection new. |
873 |
||
3673 | 874 |
changeSet size == 0 ifTrue:[ |
875 |
changeFileName notNil ifTrue:[ |
|
876 |
changeSet := self class readXMLChangesFromFile:changeFileName inBackground:false. |
|
877 |
]. |
|
15013 | 878 |
changeSet size == 0 ifTrue:[ ^ nil ]. |
3673 | 879 |
]. |
880 |
||
15013 | 881 |
"/ tabSpec := TabulatorSpecification new. |
882 |
"/ tabSpec unit:#inch. |
|
883 |
"/ tabSpec positions:#(-1 0 5 8.5 ). |
|
884 |
"/ " +/- cls>>sel type info" |
|
885 |
"/ tabSpec align: #(#left #left #left #left). |
|
30 | 886 |
|
15013 | 887 |
changeSet do:[:aChange | |
16388 | 888 |
|info changeSource entry time |
889 |
changeDelta changeClass changeClassName changeSelector| |
|
15013 | 890 |
|
891 |
changeSource := aChange source "printString". |
|
16388 | 892 |
changeClassName := aChange className. |
15013 | 893 |
|
16388 | 894 |
aChange isMethodCodeChange ifTrue:[ |
895 |
changeClass := aChange changeClass. |
|
896 |
changeSelector := aChange selector. |
|
15013 | 897 |
changeDelta := ChangeDeltaInformation |
898 |
changeDeltaFor:changeSource |
|
16388 | 899 |
changeClass:changeClass |
900 |
selector:changeSelector. |
|
15013 | 901 |
] ifFalse:[ |
902 |
changeDelta := ' '. |
|
903 |
]. |
|
904 |
||
3673 | 905 |
"/ changeHeaderLines add:(aChange printString) |
906 |
entry := MultiColListEntry new. |
|
907 |
entry tabulatorSpecification:tabSpec. |
|
15013 | 908 |
entry colAt:1 put:changeDelta. |
3673 | 909 |
entry colAt:2 put:aChange printString. |
910 |
entry colAt:3 put:''. "/ changeType. |
|
911 |
||
912 |
(aChange respondsTo:#timeOfChangeIfKnown) ifTrue:[ |
|
16388 | 913 |
(time := aChange timeOfChangeIfKnown) notNil ifTrue:[ |
914 |
entry colAt:4 put:(self timeStampPrintStringOf:time). |
|
3673 | 915 |
] |
916 |
]. |
|
16388 | 917 |
info := ChangesBrowser::ChangeInfo new |
918 |
position:nil |
|
919 |
chunk:changeSource |
|
920 |
className:changeClassName |
|
921 |
selector:changeSelector |
|
922 |
headerLine:entry |
|
923 |
timestamp:time |
|
924 |
isFollowupChange:false. |
|
925 |
changeInfoList add:info. |
|
926 |
||
3673 | 927 |
]. |
928 |
anyChanges := false |
|
224 | 929 |
]. |
930 |
||
931 |
"Created: 3.12.1995 / 18:02:39 / cg" |
|
30 | 932 |
! |
933 |
||
3364 | 934 |
realClassNameOfChange:nr |
15530 | 935 |
^ (changeSet at:nr) fullClassName "/ className. |
3364 | 936 |
|
937 |
"Created: / 5.11.2001 / 18:10:38 / cg" |
|
938 |
! |
|
939 |
||
30 | 940 |
saveBackChanges |
941 |
"save back the change set" |
|
942 |
||
943 |
[originalChangeSet isEmpty] whileFalse:[ |
|
45 | 944 |
originalChangeSet removeLast |
30 | 945 |
]. |
946 |
changeSet do:[:aChange | |
|
45 | 947 |
originalChangeSet add:aChange |
30 | 948 |
] |
949 |
! |
|
950 |
||
1470 | 951 |
selectorOfMethodChange:changeNr |
952 |
^ (changeSet at:changeNr) selector |
|
953 |
||
954 |
"Created: / 6.2.1998 / 13:28:20 / cg" |
|
955 |
"Modified: / 6.2.1998 / 13:29:59 / cg" |
|
956 |
! |
|
957 |
||
30 | 958 |
silentDeleteChange:changeNr |
959 |
"delete a change do not update changeListView" |
|
960 |
||
1474 | 961 |
changeSet removeIndex:changeNr. |
962 |
super silentDeleteChange:changeNr. |
|
963 |
||
964 |
"Created: / 3.12.1995 / 18:14:17 / cg" |
|
965 |
"Modified: / 7.2.1998 / 19:57:57 / cg" |
|
966 |
! |
|
224 | 967 |
|
1474 | 968 |
silentDeleteInternalChange:changeNr |
969 |
"delete a change do not update changeListView" |
|
970 |
||
971 |
changeSet removeIndex:changeNr. |
|
972 |
super silentDeleteInternalChange:changeNr. |
|
973 |
||
974 |
"Modified: / 7.2.1998 / 19:44:45 / cg" |
|
975 |
"Created: / 7.2.1998 / 19:58:02 / cg" |
|
222 | 976 |
! |
977 |
||
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
978 |
sourceOfChange:changeNr |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
979 |
"answer a changes source" |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
980 |
|
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
981 |
|change| |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
982 |
|
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
983 |
change := changeSet at:changeNr. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
984 |
change isNil ifTrue:[^nil]. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
985 |
^ change source |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
986 |
|
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
987 |
"Modified: / 7.2.1998 / 19:52:44 / cg" |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
988 |
! |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
989 |
|
222 | 990 |
streamForChange:changeNr |
991 |
"answer a stream for change" |
|
992 |
||
4990 | 993 |
|change str source| |
222 | 994 |
|
995 |
change := changeSet at:changeNr. |
|
996 |
change isNil ifTrue:[^nil]. |
|
14981 | 997 |
change isMethodDefinitionChange ifTrue:[ |
4430
665173b18b94
oops - streamforchange was wrong (exclas)
Claus Gittinger <cg@exept.de>
parents:
4316
diff
changeset
|
998 |
str := WriteStream on:''. |
665173b18b94
oops - streamforchange was wrong (exclas)
Claus Gittinger <cg@exept.de>
parents:
4316
diff
changeset
|
999 |
str nextPutChunkSeparator. |
14970 | 1000 |
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
|
1001 |
str nextPutChunkSeparator. |
665173b18b94
oops - streamforchange was wrong (exclas)
Claus Gittinger <cg@exept.de>
parents:
4316
diff
changeset
|
1002 |
str cr. |
665173b18b94
oops - streamforchange was wrong (exclas)
Claus Gittinger <cg@exept.de>
parents:
4316
diff
changeset
|
1003 |
str nextPutAllAsChunk:change source. |
665173b18b94
oops - streamforchange was wrong (exclas)
Claus Gittinger <cg@exept.de>
parents:
4316
diff
changeset
|
1004 |
str nextPutChunkSeparator. |
665173b18b94
oops - streamforchange was wrong (exclas)
Claus Gittinger <cg@exept.de>
parents:
4316
diff
changeset
|
1005 |
str space. |
665173b18b94
oops - streamforchange was wrong (exclas)
Claus Gittinger <cg@exept.de>
parents:
4316
diff
changeset
|
1006 |
str nextPutChunkSeparator. |
665173b18b94
oops - streamforchange was wrong (exclas)
Claus Gittinger <cg@exept.de>
parents:
4316
diff
changeset
|
1007 |
str cr. |
4990 | 1008 |
source := str contents |
1009 |
] ifFalse:[ |
|
1010 |
source := change source |
|
1474 | 1011 |
]. |
4990 | 1012 |
^ ReadStream on:source |
1474 | 1013 |
|
1014 |
"Modified: / 7.2.1998 / 19:52:44 / cg" |
|
30 | 1015 |
! ! |
1016 |
||
1017 |
!ChangeSetBrowser methodsFor:'user actions'! |
|
1018 |
||
15017 | 1019 |
compareChange:changeNr showResult:doShowResult |
1020 |
|change isSame outcome beep oldSource newSource showDiff d| |
|
1021 |
||
1022 |
change := changeSet at:changeNr. |
|
1023 |
change isMethodCodeChange ifTrue:[ |
|
1024 |
newSource := change source. |
|
1025 |
||
1026 |
isSame := self |
|
1027 |
compareMethodSource:newSource |
|
1028 |
withVersionInClass:change changeClass |
|
1029 |
into:[:outcomeResult :beepResult :oldSourceResult | |
|
1030 |
outcome := outcomeResult. |
|
1031 |
beep := beepResult. |
|
1032 |
oldSource := oldSourceResult. |
|
1033 |
]. |
|
1034 |
||
1035 |
isSame isNil ifTrue:[ |
|
1036 |
showDiff := false. |
|
1037 |
] ifFalse:[ |
|
1038 |
showDiff := isSame not. |
|
1039 |
]. |
|
1040 |
||
1041 |
doShowResult ifTrue:[ |
|
1042 |
(showDiff and:[oldSource notNil and:[newSource notNil]]) ifTrue:[ |
|
1043 |
d := DiffCodeView |
|
1044 |
openOn:oldSource label:(resources string:'Current version (in image)') |
|
1045 |
and:newSource label:(resources string:'Change version'). |
|
1046 |
d label:'method differences'. |
|
1047 |
] |
|
1048 |
]. |
|
1049 |
] ifFalse:[ |
|
1050 |
super compareChange:changeNr showResult:doShowResult |
|
1051 |
]. |
|
1052 |
! |
|
1053 |
||
4316 | 1054 |
doInspectChange |
1055 |
self withSelectedChangesDo:[:changeNr | |
|
1056 |
(changeSet at:changeNr) inspect |
|
1057 |
]. |
|
1058 |
! |
|
1059 |
||
30 | 1060 |
doSaveBack |
1061 |
anyChanges ifTrue:[ |
|
45 | 1062 |
self saveBackChanges. |
1063 |
self doUpdate |
|
30 | 1064 |
] |
222 | 1065 |
! |
1066 |
||
1067 |
doUpdate |
|
1068 |
changeSet := OrderedCollection new. |
|
1069 |
originalChangeSet notNil ifTrue:[ |
|
1070 |
originalChangeSet do:[:aChange | |
|
1071 |
changeSet add:aChange |
|
1072 |
]. |
|
1073 |
]. |
|
1074 |
super doUpdate |
|
1075 |
||
1076 |
"Created: 3.12.1995 / 13:54:14 / cg" |
|
4942 | 1077 |
! |
1078 |
||
1079 |
updateDiffViewFor:changeNr |
|
1080 |
|change class selector oldMethod newSource oldSource| |
|
1081 |
||
1082 |
change := changeSet at:changeNr. |
|
8870 | 1083 |
(change isMethodChange and:[change isMethodCodeChange]) ifTrue:[ |
4942 | 1084 |
newSource := change source. |
8870 | 1085 |
enforcedNameSpace notNil ifTrue:[ |
1086 |
class := enforcedNameSpace classNamed:change className. |
|
1087 |
] ifFalse:[ |
|
1088 |
class := change changeClass. |
|
1089 |
]. |
|
4942 | 1090 |
class notNil ifTrue:[ |
1091 |
selector := change changeSelector. |
|
1092 |
selector notNil ifTrue:[ |
|
1093 |
oldMethod := class compiledMethodAt:selector. |
|
1094 |
oldMethod notNil ifTrue:[ |
|
1095 |
oldSource := oldMethod source. |
|
1096 |
diffView text1:(oldSource ? '') text2:(newSource ? ''). |
|
1097 |
^ self. |
|
1098 |
] |
|
1099 |
]. |
|
1100 |
] |
|
1101 |
]. |
|
1102 |
||
1103 |
super updateDiffViewFor:changeNr. |
|
30 | 1104 |
! ! |
222 | 1105 |
|
1106 |
!ChangeSetBrowser class methodsFor:'documentation'! |
|
1107 |
||
1108 |
version |
|
16388 | 1109 |
^ '$Header$' |
8869 | 1110 |
! |
1111 |
||
1112 |
version_CVS |
|
16388 | 1113 |
^ '$Header$' |
222 | 1114 |
! ! |
12600
29a26b712ceb
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
9782
diff
changeset
|
1115 |