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