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