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