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