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