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