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