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