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