author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Sun, 05 Feb 2012 01:49:41 +0000 | |
branch | jv |
changeset 12144 | 18c25ec50d96 |
parent 12123 | 4bde08cebd48 |
child 12179 | 47f98e7d6de1 |
permissions | -rw-r--r-- |
10019 | 1 |
"{ Package: 'stx:libtool' }" |
2 |
||
3 |
"{ NameSpace: Tools }" |
|
4 |
||
5 |
SmalltalkDiffTool subclass:#SmalltalkMergeTool |
|
6 |
instanceVariableNames:'resolvedHolder changeSetHolder' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'Interface-Diff & Merge tool' |
|
10 |
! |
|
11 |
||
12 |
SmalltalkDiffTool::DiffItem subclass:#DiffItem |
|
13 |
instanceVariableNames:'versionMerged state' |
|
14 |
classVariableNames:'' |
|
15 |
poolDictionaries:'' |
|
16 |
privateIn:SmalltalkMergeTool |
|
17 |
! |
|
18 |
||
19 |
!SmalltalkMergeTool class methodsFor:'documentation'! |
|
20 |
||
21 |
documentation |
|
22 |
" |
|
23 |
documentation to be added. |
|
24 |
||
25 |
[author:] |
|
26 |
Jan Vrany (janfrog@bruxa) |
|
27 |
||
28 |
[instance variables:] |
|
29 |
||
30 |
[class variables:] |
|
31 |
||
32 |
[see also:] |
|
33 |
||
34 |
" |
|
35 |
! |
|
36 |
||
37 |
examples |
|
38 |
" |
|
39 |
Starting the application: |
|
40 |
[exBegin] |
|
41 |
MergeTool open |
|
42 |
||
43 |
[exEnd] |
|
44 |
||
45 |
more examples to be added: |
|
46 |
[exBegin] |
|
47 |
... add code fragment for |
|
48 |
... executable example here ... |
|
49 |
[exEnd] |
|
50 |
" |
|
51 |
! |
|
52 |
||
53 |
history |
|
54 |
"Created: / 06-12-2007 / 11:00:54 / janfrog" |
|
55 |
! ! |
|
56 |
||
57 |
!SmalltalkMergeTool class methodsFor:'initialization'! |
|
58 |
||
59 |
initialize |
|
60 |
"self initialize" |
|
61 |
||
62 |
|menuItem| |
|
63 |
||
64 |
menuItem := (MenuItem label:'Merge tool') |
|
65 |
nameKey:'MergeTool'; |
|
66 |
value:[SmalltalkMergeTool open]; |
|
67 |
isButton:false. |
|
68 |
||
69 |
||
70 |
NewLauncher |
|
71 |
addMenuItem:menuItem |
|
72 |
from:self |
|
10113 | 73 |
in:'menu.tools.programming' |
10019 | 74 |
position:#(before startSmaCCParserGenerator) |
75 |
space:false. |
|
76 |
||
77 |
"Created: / 11-12-2007 / 19:12:08 / janfrog" |
|
78 |
"Modified: / 09-08-2009 / 14:15:12 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
10113 | 79 |
"Modified (format): / 03-07-2011 / 22:30:30 / cg" |
10019 | 80 |
! ! |
81 |
||
82 |
!SmalltalkMergeTool class methodsFor:'interface specs'! |
|
83 |
||
84 |
conflictsListSpec |
|
85 |
"This resource specification was automatically generated |
|
86 |
by the UIPainter of ST/X." |
|
87 |
||
88 |
"Do not manually edit this!! If it is corrupted, |
|
89 |
the UIPainter may not be able to read the specification." |
|
90 |
||
91 |
" |
|
92 |
UIPainter new openOnClass:MergeTool andSelector:#conflictsListSpec |
|
93 |
MergeTool new openInterface:#conflictsListSpec |
|
94 |
" |
|
95 |
||
96 |
<resource: #canvas> |
|
97 |
||
98 |
^ |
|
99 |
#(FullSpec |
|
100 |
name: conflictsListSpec |
|
101 |
window: |
|
102 |
(WindowSpec |
|
103 |
label: 'VersionBothListSpec' |
|
104 |
name: 'VersionBothListSpec' |
|
105 |
min: (Point 10 10) |
|
106 |
bounds: (Rectangle 0 0 306 406) |
|
107 |
) |
|
108 |
component: |
|
109 |
(SpecCollection |
|
110 |
collection: ( |
|
111 |
(LabelSpec |
|
112 |
label: 'Conflicts (present in both A and B)' |
|
113 |
name: 'VersionBothLabel' |
|
114 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
115 |
translateLabel: true |
|
116 |
labelChannel: conflictsLabelHolder |
|
117 |
) |
|
118 |
(SelectionInListModelViewSpec |
|
119 |
name: 'VersionBothList' |
|
120 |
layout: (LayoutFrame 0 0 30 0 0 1 0 1) |
|
121 |
model: selectionHolder |
|
122 |
menu: resolveMenu |
|
123 |
hasHorizontalScrollBar: true |
|
124 |
hasVerticalScrollBar: true |
|
125 |
listModel: conflictsListHolder |
|
126 |
multipleSelectOk: true |
|
127 |
useIndex: false |
|
128 |
highlightMode: line |
|
129 |
) |
|
130 |
) |
|
131 |
||
132 |
) |
|
133 |
) |
|
134 |
||
135 |
"Modified: / 11-12-2007 / 16:46:23 / janfrog" |
|
136 |
"Created: / 19-04-2008 / 12:58:29 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
137 |
! |
|
138 |
||
139 |
inAOnlyListSpec |
|
140 |
"This resource specification was automatically generated |
|
141 |
by the UIPainter of ST/X." |
|
142 |
||
143 |
"Do not manually edit this!! If it is corrupted, |
|
144 |
the UIPainter may not be able to read the specification." |
|
145 |
||
146 |
" |
|
147 |
UIPainter new openOnClass:MergeTool andSelector:#inAOnlyListSpec |
|
148 |
MergeTool new openInterface:#inAOnlyListSpec |
|
149 |
" |
|
150 |
||
151 |
<resource: #canvas> |
|
152 |
||
153 |
^ |
|
154 |
#(FullSpec |
|
155 |
name: inAOnlyListSpec |
|
156 |
window: |
|
157 |
(WindowSpec |
|
158 |
label: 'VersionAOnlyListSpec' |
|
159 |
name: 'VersionAOnlyListSpec' |
|
160 |
min: (Point 10 10) |
|
161 |
bounds: (Rectangle 0 0 306 406) |
|
162 |
) |
|
163 |
component: |
|
164 |
(SpecCollection |
|
165 |
collection: ( |
|
166 |
(LabelSpec |
|
167 |
label: 'In A only' |
|
168 |
name: 'VersionAOnlyLabel' |
|
169 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
170 |
translateLabel: true |
|
171 |
labelChannel: inAOnlyLabelHolder |
|
172 |
) |
|
173 |
(SelectionInListModelViewSpec |
|
174 |
name: 'VersionAOnlyList' |
|
175 |
layout: (LayoutFrame 0 0 30 0 0 1 0 1) |
|
176 |
model: selectionHolder |
|
177 |
menu: resolveMenu |
|
178 |
hasHorizontalScrollBar: true |
|
179 |
hasVerticalScrollBar: true |
|
180 |
listModel: inAOnlyListHolder |
|
181 |
multipleSelectOk: true |
|
182 |
useIndex: false |
|
183 |
highlightMode: line |
|
184 |
postBuildCallback: postBuildVersionAListWidget: |
|
185 |
) |
|
186 |
) |
|
187 |
||
188 |
) |
|
189 |
) |
|
190 |
||
191 |
"Modified: / 11-12-2007 / 16:46:29 / janfrog" |
|
192 |
"Created: / 19-04-2008 / 12:58:29 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
193 |
! |
|
194 |
||
195 |
inBOnlyListSpec |
|
196 |
"This resource specification was automatically generated |
|
197 |
by the UIPainter of ST/X." |
|
198 |
||
199 |
"Do not manually edit this!! If it is corrupted, |
|
200 |
the UIPainter may not be able to read the specification." |
|
201 |
||
202 |
" |
|
203 |
UIPainter new openOnClass:MergeTool andSelector:#inBOnlyListSpec |
|
204 |
MergeTool new openInterface:#inBOnlyListSpec |
|
205 |
" |
|
206 |
||
207 |
<resource: #canvas> |
|
208 |
||
209 |
^ |
|
210 |
#(FullSpec |
|
211 |
name: inBOnlyListSpec |
|
212 |
window: |
|
213 |
(WindowSpec |
|
214 |
label: 'VersionBOnlyListSpec' |
|
215 |
name: 'VersionBOnlyListSpec' |
|
216 |
min: (Point 10 10) |
|
217 |
bounds: (Rectangle 0 0 306 406) |
|
218 |
) |
|
219 |
component: |
|
220 |
(SpecCollection |
|
221 |
collection: ( |
|
222 |
(LabelSpec |
|
223 |
label: 'In B only' |
|
224 |
name: 'VersionBOnlyLabel' |
|
225 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
226 |
translateLabel: true |
|
227 |
labelChannel: inBOnlyLabelHolder |
|
228 |
) |
|
229 |
(SelectionInListModelViewSpec |
|
230 |
name: 'VersionBOnlyList' |
|
231 |
layout: (LayoutFrame 0 0 30 0 0 1 0 1) |
|
232 |
model: selectionHolder |
|
233 |
menu: resolveMenu |
|
234 |
hasHorizontalScrollBar: true |
|
235 |
hasVerticalScrollBar: true |
|
236 |
listModel: inBOnlyListHolder |
|
237 |
multipleSelectOk: true |
|
238 |
postBuildCallback: postBuildVersionBListWidget: |
|
239 |
useIndex: false |
|
240 |
highlightMode: line |
|
241 |
) |
|
242 |
) |
|
243 |
||
244 |
) |
|
245 |
) |
|
246 |
||
247 |
"Modified: / 11-12-2007 / 16:46:33 / janfrog" |
|
248 |
"Created: / 19-04-2008 / 12:58:29 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
249 |
! ! |
|
250 |
||
251 |
!SmalltalkMergeTool class methodsFor:'menu specs'! |
|
252 |
||
253 |
mainMenu |
|
254 |
"This resource specification was automatically generated |
|
255 |
by the MenuEditor of ST/X." |
|
256 |
||
257 |
"Do not manually edit this!! If it is corrupted, |
|
258 |
the MenuEditor may not be able to read the specification." |
|
259 |
||
260 |
" |
|
261 |
MenuEditor new openOnClass:Tools::MergeTool andSelector:#mainMenu |
|
262 |
(Menu new fromLiteralArrayEncoding:(Tools::MergeTool mainMenu)) startUp |
|
263 |
" |
|
264 |
||
265 |
<resource: #menu> |
|
266 |
||
267 |
^ |
|
268 |
#(Menu |
|
269 |
( |
|
270 |
(MenuItem |
|
271 |
label: 'File' |
|
272 |
translateLabel: true |
|
273 |
submenu: |
|
274 |
(Menu |
|
275 |
( |
|
276 |
(MenuItem |
|
277 |
label: 'Open file' |
|
278 |
itemValue: fileMenuMergeFileIntoImage |
|
279 |
translateLabel: true |
|
280 |
) |
|
281 |
(MenuItem |
|
282 |
label: '-' |
|
283 |
) |
|
284 |
(MenuItem |
|
285 |
label: 'Apply resolved' |
|
286 |
itemValue: fileMenuApplyResolved |
|
287 |
translateLabel: true |
|
288 |
) |
|
289 |
(MenuItem |
|
290 |
label: '-' |
|
291 |
) |
|
292 |
(MenuItem |
|
293 |
label: 'Exit' |
|
294 |
itemValue: closeRequest |
|
295 |
translateLabel: true |
|
296 |
) |
|
297 |
) |
|
298 |
nil |
|
299 |
nil |
|
300 |
) |
|
301 |
) |
|
302 |
(MenuItem |
|
303 |
label: 'Resolve' |
|
304 |
translateLabel: true |
|
305 |
submenuChannel: resolveMenu |
|
306 |
) |
|
307 |
(MenuItem |
|
308 |
label: 'Help' |
|
309 |
translateLabel: true |
|
310 |
startGroup: right |
|
311 |
submenu: |
|
312 |
(Menu |
|
313 |
( |
|
314 |
(MenuItem |
|
315 |
label: 'About this Application...' |
|
316 |
itemValue: openAboutThisApplication |
|
317 |
translateLabel: true |
|
318 |
) |
|
319 |
) |
|
320 |
nil |
|
321 |
nil |
|
322 |
) |
|
323 |
) |
|
324 |
) |
|
325 |
nil |
|
326 |
nil |
|
327 |
) |
|
328 |
||
329 |
"Modified: / 08-11-2008 / 11:09:41 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
330 |
! |
|
331 |
||
332 |
resolveMenu |
|
333 |
"This resource specification was automatically generated |
|
334 |
by the MenuEditor of ST/X." |
|
335 |
||
336 |
"Do not manually edit this!! If it is corrupted, |
|
337 |
the MenuEditor may not be able to read the specification." |
|
338 |
||
339 |
" |
|
340 |
MenuEditor new openOnClass:Tools::MergeTool andSelector:#resolveMenu |
|
341 |
(Menu new fromLiteralArrayEncoding:(Tools::MergeTool resolveMenu)) startUp |
|
342 |
" |
|
343 |
||
344 |
<resource: #menu> |
|
345 |
||
346 |
^ |
|
347 |
#(Menu |
|
348 |
( |
|
349 |
(MenuItem |
|
350 |
enabled: selectionIsNonEmptyAndAllHasVersionA |
|
351 |
label: 'Resolve using version A <-' |
|
352 |
itemValue: resolveMenuResolveUsingA |
|
353 |
translateLabel: true |
|
354 |
) |
|
355 |
(MenuItem |
|
356 |
enabled: selectionIsNonEmptyAndAllHasVersionB |
|
357 |
label: 'Resolve using version B ->' |
|
358 |
itemValue: resolveMenuResolveUsingB |
|
359 |
translateLabel: true |
|
360 |
) |
|
361 |
(MenuItem |
|
362 |
enabled: selectionIsNonEmpty |
|
363 |
label: 'Delete' |
|
364 |
itemValue: resolveMenuDelete |
|
365 |
translateLabel: true |
|
366 |
) |
|
367 |
(MenuItem |
|
368 |
enabled: selectionIsNonEmpty |
|
369 |
label: 'Unresolve' |
|
370 |
itemValue: resolveMenuUnresolve |
|
371 |
translateLabel: true |
|
372 |
) |
|
373 |
(MenuItem |
|
374 |
label: '-' |
|
375 |
) |
|
376 |
(MenuItem |
|
377 |
enabled: false |
|
378 |
label: 'Show changeset' |
|
379 |
translateLabel: true |
|
380 |
indication: showMergingChangeSetHolder |
|
381 |
) |
|
382 |
) |
|
383 |
nil |
|
384 |
nil |
|
385 |
) |
|
386 |
||
387 |
"Modified: / 08-11-2008 / 11:06:43 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
388 |
! ! |
|
389 |
||
390 |
!SmalltalkMergeTool class methodsFor:'plugIn spec'! |
|
391 |
||
392 |
aspectSelectors |
|
393 |
||
394 |
^super aspectSelectors, |
|
395 |
#( |
|
396 |
||
397 |
#resolvedHolder |
|
398 |
#changeSetHolder |
|
399 |
). |
|
400 |
||
401 |
"Created: / 02-04-2009 / 22:04:50 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
402 |
"Modified: / 09-04-2009 / 09:21:32 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
403 |
! ! |
|
404 |
||
405 |
!SmalltalkMergeTool methodsFor:'accessing'! |
|
406 |
||
407 |
diffItemClass |
|
408 |
||
409 |
^SmalltalkMergeTool::DiffItem |
|
410 |
||
411 |
"Created: / 21-05-2008 / 14:39:38 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
412 |
"Modified: / 09-08-2009 / 14:57:46 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
413 |
! ! |
|
414 |
||
415 |
!SmalltalkMergeTool methodsFor:'aspects'! |
|
416 |
||
417 |
changeSetHolder |
|
418 |
"return/create the 'changeSetHolder' value holder (automatically generated)" |
|
419 |
||
420 |
changeSetHolder isNil ifTrue:[ |
|
421 |
changeSetHolder := ValueHolder new. |
|
422 |
]. |
|
423 |
^ changeSetHolder |
|
424 |
! |
|
425 |
||
426 |
changeSetHolder:aValueHolder |
|
427 |
"set the 'changeSetHolder' value holder (automatically generated)" |
|
428 |
||
429 |
changeSetHolder := aValueHolder. |
|
430 |
! |
|
431 |
||
432 |
resolvedHolder |
|
433 |
||
434 |
resolvedHolder ifNil: |
|
435 |
[resolvedHolder := false asValue]. |
|
436 |
^resolvedHolder |
|
437 |
||
438 |
"Created: / 02-04-2009 / 21:53:19 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
439 |
! |
|
440 |
||
441 |
selectionHolder |
|
442 |
||
443 |
selectionHolder ifNil: |
|
444 |
[selectionHolder := List new asValue. |
|
445 |
selectionHolder |
|
446 |
onChangeSend:#selectionChanged to: self]. |
|
447 |
^selectionHolder |
|
448 |
||
449 |
"Created: / 21-05-2008 / 19:30:59 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
450 |
! ! |
|
451 |
||
452 |
!SmalltalkMergeTool methodsFor:'change & update'! |
|
453 |
||
454 |
resolutionChanged |
|
455 |
||
456 |
super resolutionChanged. |
|
457 |
self resolvedHolder value: self resolved. |
|
458 |
self changeSetHolder value: self changeSet. |
|
459 |
||
460 |
"Created: / 22-10-2008 / 10:50:35 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
461 |
"Modified: / 02-04-2009 / 22:04:06 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
462 |
! ! |
|
463 |
||
464 |
!SmalltalkMergeTool methodsFor:'menu actions'! |
|
465 |
||
466 |
fileMenuApplyResolved |
|
467 |
(Dialog confirm:'Really apply resolved?') ifFalse:[ |
|
468 |
^ self |
|
469 |
]. |
|
470 |
self inAOnlyListHolder |
|
471 |
value:(self inAOnlyListHolder value reject:[:e | e isResolved ]). |
|
472 |
self conflictsListHolder |
|
473 |
value:(self conflictsListHolder value reject:[:e | e isResolved ]). |
|
474 |
self inBOnlyListHolder |
|
475 |
value:(self inBOnlyListHolder value reject:[:e | e isResolved ]). |
|
476 |
self fileMenuApplyResolved:self changeSetToApply |
|
477 |
||
478 |
"Modified: / 12-12-2007 / 08:37:21 / janfrog" |
|
479 |
"Created: / 08-11-2008 / 11:08:34 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
480 |
! |
|
481 |
||
482 |
fileMenuApplyResolved:aChangeSet |
|
483 |
(Class updateChangeFileQuerySignal , Class updateChangeListQuerySignal) |
|
484 |
answer:false |
|
485 |
do:[ aChangeSet apply ] |
|
486 |
||
487 |
"Modified: / 12-12-2007 / 08:36:04 / janfrog" |
|
488 |
"Created: / 08-11-2008 / 11:08:44 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
489 |
! |
|
490 |
||
491 |
fileMenuMergeFileIntoImage |
|
492 |
||
493 |
|filename| |
|
494 |
||
495 |
filename := Dialog requestFileName:'Enter fileout or change file' pattern:'*.st;*.cha'. |
|
496 |
filename isNilOrEmptyCollection ifTrue:[^self]. |
|
497 |
filename := filename asFilename. |
|
498 |
filename isRegularFile ifFalse:[^Dialog warn:'Selected file is not a regular file']. |
|
499 |
filename isReadable ifFalse:[^Dialog warn:'Selected file is not readable']. |
|
500 |
||
501 |
[ |
|
502 |
self |
|
503 |
diffSet: (ChangeSet fromFile: filename) diffSetsAgainstImage labelA: filename components last |
|
504 |
labelB: 'image' |
|
505 |
] on: Error do:[:ex| |
|
506 |
Dialog warn: 'Error when reading changeset: ', ex description. |
|
507 |
ex pass |
|
508 |
] |
|
509 |
||
510 |
"Created: / 11-12-2007 / 16:59:04 / janfrog" |
|
511 |
"Modified: / 12-12-2007 / 15:12:01 / janfrog" |
|
512 |
! |
|
513 |
||
514 |
resolveMenuDelete |
|
515 |
||
516 |
self selection do: |
|
517 |
[:mergeItem|mergeItem delete]. |
|
518 |
self resolutionChanged |
|
519 |
||
520 |
"Modified: / 11-12-2007 / 16:54:51 / janfrog" |
|
521 |
! |
|
522 |
||
523 |
resolveMenuResolveUsingA |
|
524 |
||
525 |
self selection do: |
|
526 |
[:mergeItem|mergeItem resolveUsingA]. |
|
527 |
self resolutionChanged |
|
528 |
||
529 |
"Modified: / 11-12-2007 / 16:54:56 / janfrog" |
|
530 |
! |
|
531 |
||
532 |
resolveMenuResolveUsingB |
|
533 |
||
534 |
self selection do: |
|
535 |
[:mergeItem|mergeItem resolveUsingB]. |
|
536 |
self resolutionChanged |
|
537 |
||
538 |
"Modified: / 11-12-2007 / 16:55:01 / janfrog" |
|
539 |
! |
|
540 |
||
541 |
resolveMenuUnresolve |
|
542 |
||
543 |
self selection do: |
|
544 |
[:mergeItem|mergeItem unresolve]. |
|
545 |
self resolutionChanged |
|
546 |
||
547 |
"Modified: / 11-12-2007 / 16:55:05 / janfrog" |
|
548 |
! ! |
|
549 |
||
550 |
!SmalltalkMergeTool methodsFor:'private'! |
|
551 |
||
552 |
changeSet |
|
553 |
||
554 |
^ChangeSet withAll: |
|
555 |
((self inAOnlyListHolder value , self conflictsListHolder value, self inBOnlyListHolder value) |
|
556 |
select:[:e|e isResolved] thenCollect:[:e|e versionMerged]) |
|
557 |
||
558 |
"Created: / 02-04-2009 / 22:03:25 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
559 |
! |
|
560 |
||
561 |
resolved |
|
562 |
^ (self inAOnlyListHolder value allSatisfy:[:e | e isResolved ]) |
|
563 |
and:[ |
|
564 |
(self conflictsListHolder value allSatisfy:[:e | e isResolved ]) |
|
565 |
and:[ (self inBOnlyListHolder value allSatisfy:[:e | e isResolved ]) ] |
|
566 |
] |
|
567 |
||
568 |
"Created: / 21-10-2008 / 09:51:03 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
569 |
! ! |
|
570 |
||
571 |
!SmalltalkMergeTool::DiffItem class methodsFor:'documentation'! |
|
572 |
||
573 |
version |
|
12123
4bde08cebd48
trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10113
diff
changeset
|
574 |
^'$Id: Tools__SmalltalkMergeTool.st,v 1.2 2011/07/03 20:56:26 cg Exp $' |
10019 | 575 |
! ! |
576 |
||
577 |
!SmalltalkMergeTool::DiffItem class methodsFor:'image specs'! |
|
578 |
||
579 |
resolvedAsRemoveIcon |
|
580 |
"This resource specification was automatically generated |
|
581 |
by the ImageEditor of ST/X." |
|
582 |
||
583 |
"Do not manually edit this!! If it is corrupted, |
|
584 |
the ImageEditor may not be able to read the specification." |
|
585 |
||
586 |
" |
|
587 |
self resolvedAsRemoveIcon inspect |
|
588 |
ImageEditor openOnClass:self andSelector:#resolvedAsRemoveIcon |
|
589 |
Icon flushCachedIcons |
|
590 |
" |
|
591 |
||
592 |
<resource: #image> |
|
593 |
||
594 |
^Icon |
|
595 |
constantNamed:'Tools::MergeTool::DiffItem class resolvedAsRemoveIcon' |
|
596 |
ifAbsentPut:[(Depth2Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#[2]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@T@AP@EPAT@@UAT@@AUT@@@ET@@@AU@@@AUT@@ATEP@AT@U@@T@AP@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 0 0 170 170 170 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
597 |
?????<@C6A/\N<931>OC0<OC1>ON\=0;6A/@@?????<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
598 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
599 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; yourself); yourself] |
|
600 |
||
601 |
"Created: / 08-11-2008 / 10:58:51 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
602 |
! |
|
603 |
||
604 |
resolvedAsVersionAIcon |
|
605 |
<resource: #image> |
|
606 |
"This resource specification was automatically generated |
|
607 |
by the ImageEditor of ST/X." |
|
608 |
"Do not manually edit this!! If it is corrupted, |
|
609 |
the ImageEditor may not be able to read the specification." |
|
610 |
" |
|
611 |
self resolvedUsingVersionAIcon inspect |
|
612 |
ImageEditor openOnClass:self andSelector:#resolvedUsingVersionAIcon |
|
613 |
Icon flushCachedIcons" |
|
614 |
||
615 |
^ Icon |
|
616 |
constantNamed:'Tools::MergeTool::DiffItem class resolvedUsingVersionAIcon' |
|
617 |
ifAbsentPut:[ |
|
618 |
(Depth2Image new) |
|
619 |
width:16; |
|
620 |
height:16; |
|
621 |
photometric:(#palette); |
|
622 |
bitsPerSample:(#[ 2 ]); |
|
623 |
samplesPerPixel:((1)); |
|
624 |
bits:(ByteArray |
|
625 |
fromPackedString:'@@@@@@@@@@@EUUUPAUPUT@UTEU@ET@UPAU@ET@UAPU@EPTEPAPUPT@T@@E@D@@@PAAUTD@UUUU@@@@@@@@@@@@@a'); |
|
626 |
colorMapFromArray:#[ 0 0 0 191 255 191 30 255 30 255 255 255 ]; |
|
627 |
mask:((Depth1Image new) |
|
628 |
width:16; |
|
629 |
height:16; |
|
630 |
photometric:(#blackIs0); |
|
631 |
bitsPerSample:(#[ 1 ]); |
|
632 |
samplesPerPixel:((1)); |
|
633 |
bits:(ByteArray |
|
634 |
fromPackedString:' |
|
635 |
??????????????????????????????????????????<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
636 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
637 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a'); |
|
638 |
yourself); |
|
639 |
yourself |
|
640 |
] |
|
641 |
||
642 |
"Created: / 08-11-2008 / 10:59:10 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
643 |
! |
|
644 |
||
645 |
resolvedAsVersionBIcon |
|
646 |
<resource: #image> |
|
647 |
"This resource specification was automatically generated |
|
648 |
by the ImageEditor of ST/X." |
|
649 |
"Do not manually edit this!! If it is corrupted, |
|
650 |
the ImageEditor may not be able to read the specification." |
|
651 |
" |
|
652 |
self resolvedUsingVersionBIcon inspect |
|
653 |
ImageEditor openOnClass:self andSelector:#resolvedUsingVersionBIcon |
|
654 |
Icon flushCachedIcons" |
|
655 |
||
656 |
^ Icon |
|
657 |
constantNamed:'Tools::MergeTool::DiffItem class resolvedUsingVersionBIcon' |
|
658 |
ifAbsentPut:[ |
|
659 |
(Depth2Image new) |
|
660 |
width:16; |
|
661 |
height:16; |
|
662 |
photometric:(#palette); |
|
663 |
bitsPerSample:(#[ 2 ]); |
|
664 |
samplesPerPixel:((1)); |
|
665 |
bits:(ByteArray |
|
666 |
fromPackedString:'@@@@@@@@@@@EUUUPAT@ET@UAPU@EPTEPATEAT@U@AU@EP@UPATEAT@UAPU@EPTEPAT@ET@UUUU@@@@@@@@@@@@@a'); |
|
667 |
colorMapFromArray:#[ 0 0 0 255 191 191 30 255 30 255 255 255 ]; |
|
668 |
mask:((Depth1Image new) |
|
669 |
width:16; |
|
670 |
height:16; |
|
671 |
photometric:(#blackIs0); |
|
672 |
bitsPerSample:(#[ 1 ]); |
|
673 |
samplesPerPixel:((1)); |
|
674 |
bits:(ByteArray |
|
675 |
fromPackedString:' |
|
676 |
??????????????????????????????????????????<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
677 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
678 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a'); |
|
679 |
yourself); |
|
680 |
yourself |
|
681 |
] |
|
682 |
||
683 |
"Created: / 08-11-2008 / 10:59:01 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
684 |
! |
|
685 |
||
686 |
unresolvedIcon |
|
687 |
"This resource specification was automatically generated |
|
688 |
by the ImageEditor of ST/X." |
|
689 |
||
690 |
"Do not manually edit this!! If it is corrupted, |
|
691 |
the ImageEditor may not be able to read the specification." |
|
692 |
||
693 |
" |
|
694 |
self unresolvedIcon inspect |
|
695 |
ImageEditor openOnClass:self andSelector:#unresolvedIcon |
|
696 |
Icon flushCachedIcons |
|
697 |
" |
|
698 |
||
699 |
<resource: #image> |
|
700 |
||
701 |
^Icon |
|
702 |
constantNamed:'Tools::MergeTool::DiffItem class unresolvedIcon' |
|
703 |
ifAbsentPut:[(Depth2Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#[2]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 84 84 84 170 170 170 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
704 |
?????<@C0@O@@<@C0@O@@<@C0@O@@<@C0@O@@?????<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
705 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
706 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; yourself); yourself] |
|
707 |
||
708 |
"Created: / 08-11-2008 / 10:41:16 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
709 |
! ! |
|
710 |
||
711 |
!SmalltalkMergeTool::DiffItem class methodsFor:'instance creation'! |
|
712 |
||
713 |
versionA: changeA |
|
714 |
||
715 |
^self new |
|
716 |
versionA: changeA; |
|
717 |
versionMerged: changeA; |
|
718 |
state: #merged |
|
719 |
||
720 |
"Created: / 21-05-2008 / 14:14:31 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
721 |
! |
|
722 |
||
723 |
versionB: changeB |
|
724 |
||
725 |
^self new |
|
726 |
versionB: changeB; |
|
727 |
versionMerged: changeB; |
|
728 |
state: #merged |
|
729 |
||
730 |
"Created: / 21-05-2008 / 14:14:47 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
731 |
! ! |
|
732 |
||
733 |
!SmalltalkMergeTool::DiffItem methodsFor:'accessing'! |
|
734 |
||
735 |
icon |
|
736 |
||
737 |
state = #unresolved ifTrue:[^self class unresolvedIcon]. |
|
738 |
state = #deleted ifTrue:[^self class resolvedAsRemoveIcon]. |
|
739 |
||
740 |
versionMerged = versionA ifTrue:[^self class resolvedAsVersionAIcon]. |
|
741 |
versionMerged = versionB ifTrue:[^self class resolvedAsVersionBIcon]. |
|
742 |
||
743 |
^self class unresolvedIcon |
|
744 |
||
745 |
"Created: / 08-11-2008 / 10:59:37 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
746 |
! |
|
747 |
||
748 |
state |
|
749 |
^ state ? #unresolved |
|
750 |
||
751 |
"Modified: / 06-12-2007 / 20:55:20 / janfrog" |
|
752 |
"Created: / 21-05-2008 / 11:52:59 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
753 |
! |
|
754 |
||
755 |
state:aSymbol |
|
756 |
||
757 |
self |
|
758 |
assert:(#(unresolved deleted merged) includes: aSymbol). |
|
759 |
state := aSymbol. |
|
760 |
||
761 |
"Created: / 21-05-2008 / 11:52:59 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
762 |
! |
|
763 |
||
764 |
version |
|
765 |
^ versionMerged ? versionA ? versionB |
|
766 |
||
767 |
"Created: / 21-05-2008 / 11:52:50 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
768 |
! |
|
769 |
||
770 |
versionMerged |
|
771 |
^ versionMerged |
|
772 |
||
773 |
"Created: / 21-05-2008 / 11:52:55 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
774 |
! |
|
775 |
||
776 |
versionMerged:aChange |
|
777 |
versionMerged := aChange. |
|
778 |
||
779 |
"Created: / 21-05-2008 / 11:52:55 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
780 |
"Modified: / 21-05-2008 / 13:42:09 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
781 |
! |
|
782 |
||
783 |
versionMergedSource |
|
784 |
^ versionMerged |
|
785 |
ifNil:[nil] |
|
786 |
ifNotNil:[versionMerged source] |
|
787 |
||
788 |
"Created: / 21-05-2008 / 11:52:55 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
789 |
! ! |
|
790 |
||
791 |
!SmalltalkMergeTool::DiffItem methodsFor:'displaying'! |
|
792 |
||
793 |
displayIconOn:aGC x:x y:y |
|
794 |
||
795 |
self icon |
|
796 |
displayOn:aGC |
|
797 |
x:x |
|
798 |
y:y - 14 |
|
799 |
||
800 |
"Created: / 21-05-2008 / 11:54:47 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
801 |
"Modified: / 08-11-2008 / 11:03:00 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
802 |
! |
|
803 |
||
804 |
displayOn: aGC x:x y:y |
|
805 |
||
806 |
self displayIconOn: aGC x:x y:y. |
|
807 |
self displayChangeOn: aGC x:x + 18 y:y. |
|
808 |
||
809 |
"Created: / 21-05-2008 / 11:55:01 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
810 |
! ! |
|
811 |
||
812 |
!SmalltalkMergeTool::DiffItem methodsFor:'resolution'! |
|
813 |
||
814 |
apply |
|
815 |
||
816 |
^self versionMerged apply |
|
817 |
||
818 |
"Modified: / 11-12-2007 / 18:58:37 / janfrog" |
|
819 |
"Created: / 21-05-2008 / 11:53:12 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
820 |
! |
|
821 |
||
822 |
delete |
|
823 |
||
824 |
self state: #deleted. |
|
825 |
self isMethodChange ifTrue: |
|
826 |
[versionMerged := MethodRemoveChange |
|
827 |
class: self version changeClass |
|
828 |
selector: self version changeSelector] |
|
829 |
||
830 |
"Modified: / 11-12-2007 / 18:41:49 / janfrog" |
|
831 |
"Created: / 21-05-2008 / 11:53:12 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
832 |
! |
|
833 |
||
834 |
resolveUsingA |
|
835 |
||
836 |
self state: #merged. |
|
837 |
versionMerged := versionA |
|
838 |
||
839 |
"Created: / 21-05-2008 / 11:53:12 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
840 |
! |
|
841 |
||
842 |
resolveUsingB |
|
843 |
||
844 |
self state: #merged. |
|
845 |
versionMerged := versionB |
|
846 |
||
847 |
"Created: / 21-05-2008 / 11:53:12 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
848 |
! |
|
849 |
||
850 |
unresolve |
|
851 |
||
852 |
self state: #unresolved |
|
853 |
||
854 |
"Created: / 21-05-2008 / 11:53:12 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
855 |
! ! |
|
856 |
||
857 |
!SmalltalkMergeTool::DiffItem methodsFor:'testing'! |
|
858 |
||
859 |
isMergedVersionDifferent |
|
860 |
||
861 |
^versionMerged notNil |
|
862 |
and:[versionMerged ~= versionA |
|
863 |
and:[versionMerged ~= versionB]] |
|
864 |
||
865 |
"Created: / 21-05-2008 / 11:53:19 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
866 |
! |
|
867 |
||
868 |
isResolved |
|
869 |
||
870 |
^self state ~= #unresolved |
|
871 |
||
872 |
"Created: / 21-05-2008 / 11:53:22 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
873 |
! ! |
|
874 |
||
875 |
!SmalltalkMergeTool class methodsFor:'documentation'! |
|
876 |
||
877 |
version_CVS |
|
12123
4bde08cebd48
trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10113
diff
changeset
|
878 |
^ '§Header: /cvs/stx/stx/libtool/Tools__SmalltalkMergeTool.st,v 1.2 2011/07/03 20:56:26 cg Exp §' |
10019 | 879 |
! |
880 |
||
881 |
version_SVN |
|
12123
4bde08cebd48
trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10113
diff
changeset
|
882 |
^ '$Id: Tools__SmalltalkMergeTool.st 7486 2009-10-26 22:06:24Z vranyj1 $' |
10019 | 883 |
! ! |
884 |
||
12123
4bde08cebd48
trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10113
diff
changeset
|
885 |
SmalltalkMergeTool initialize! |