44
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
Object subclass:#MCConflict
|
|
4 |
instanceVariableNames:'operation chooseRemote'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
616
|
7 |
category:'SCM-Monticello-Merging'
|
44
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!MCConflict class methodsFor:'as yet unclassified'!
|
|
12 |
|
|
13 |
operation: anOperation
|
|
14 |
^ self new operation: anOperation
|
|
15 |
! !
|
|
16 |
|
|
17 |
!MCConflict methodsFor:'as yet unclassified'!
|
|
18 |
|
|
19 |
annotations
|
191
|
20 |
| op |
|
|
21 |
^(op := operation) ifNotNil: [ op annotations ]
|
44
|
22 |
!
|
|
23 |
|
|
24 |
applyTo: anObject
|
|
25 |
self isResolved ifFalse: [self error: 'Cannot continue until this conflict has been resolved'].
|
|
26 |
self remoteChosen ifTrue: [operation applyTo: anObject].
|
|
27 |
!
|
|
28 |
|
|
29 |
chooseLocal
|
191
|
30 |
chooseRemote := false
|
44
|
31 |
!
|
|
32 |
|
|
33 |
chooseNewer
|
|
34 |
self isLocalNewer ifTrue: [ self chooseLocal ]
|
|
35 |
ifFalse: [ self isRemoteNewer ifTrue: [ self chooseRemote ]]
|
|
36 |
!
|
|
37 |
|
|
38 |
chooseOlder
|
|
39 |
self isRemoteNewer ifTrue: [ self chooseLocal ]
|
|
40 |
ifFalse: [ self isLocalNewer ifTrue: [ self chooseRemote ]]
|
|
41 |
!
|
|
42 |
|
|
43 |
chooseRemote
|
191
|
44 |
chooseRemote := true
|
44
|
45 |
!
|
|
46 |
|
|
47 |
clearChoice
|
191
|
48 |
chooseRemote := nil
|
44
|
49 |
!
|
|
50 |
|
|
51 |
definition
|
191
|
52 |
| op |
|
|
53 |
^(op := operation) ifNotNil: [ op definition ]
|
44
|
54 |
!
|
|
55 |
|
|
56 |
isConflict
|
|
57 |
^true
|
|
58 |
!
|
|
59 |
|
|
60 |
isLocalNewer
|
|
61 |
^ self localDefinition fullTimeStamp > self remoteDefinition fullTimeStamp
|
|
62 |
!
|
|
63 |
|
|
64 |
isRemoteNewer
|
|
65 |
^ self localDefinition fullTimeStamp < self remoteDefinition fullTimeStamp
|
|
66 |
!
|
|
67 |
|
|
68 |
isResolved
|
|
69 |
^ chooseRemote notNil
|
|
70 |
!
|
|
71 |
|
|
72 |
localChosen
|
|
73 |
^ chooseRemote notNil and: [chooseRemote not]
|
|
74 |
!
|
|
75 |
|
|
76 |
localDefinition
|
|
77 |
^ operation baseDefinition
|
|
78 |
!
|
|
79 |
|
|
80 |
operation
|
|
81 |
^ operation
|
|
82 |
!
|
|
83 |
|
|
84 |
operation: anOperation
|
191
|
85 |
operation := anOperation
|
44
|
86 |
!
|
|
87 |
|
|
88 |
remoteChosen
|
|
89 |
^ chooseRemote notNil and: [chooseRemote]
|
|
90 |
!
|
|
91 |
|
|
92 |
remoteDefinition
|
|
93 |
^ operation targetDefinition
|
|
94 |
!
|
|
95 |
|
|
96 |
source
|
|
97 |
^ self localChosen
|
|
98 |
ifTrue: [operation fromSource]
|
|
99 |
ifFalse: [operation source]
|
|
100 |
!
|
|
101 |
|
|
102 |
status
|
|
103 |
^ self isResolved
|
|
104 |
ifFalse: ['']
|
|
105 |
ifTrue: [self remoteChosen
|
|
106 |
ifFalse: ['L']
|
|
107 |
ifTrue: ['R']]
|
|
108 |
!
|
|
109 |
|
|
110 |
summary
|
|
111 |
| attribute |
|
191
|
112 |
attribute :=
|
44
|
113 |
self isResolved
|
|
114 |
ifTrue: [self remoteChosen ifTrue: [#underlined] ifFalse: [#struckOut]]
|
|
115 |
ifFalse: [#bold].
|
|
116 |
^ Text string: operation summary attribute: (TextEmphasis perform: attribute)
|
|
117 |
! !
|
|
118 |
|
|
119 |
!MCConflict class methodsFor:'documentation'!
|
|
120 |
|
274
|
121 |
version
|
616
|
122 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCConflict.st,v 1.4 2012-09-11 21:21:04 cg Exp $'
|
274
|
123 |
!
|
|
124 |
|
191
|
125 |
version_CVS
|
616
|
126 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCConflict.st,v 1.4 2012-09-11 21:21:04 cg Exp $'
|
191
|
127 |
!
|
|
128 |
|
|
129 |
version_SVN
|
|
130 |
^ '§Id: MCConflict.st 17 2010-10-13 12:07:52Z vranyj1 §'
|
44
|
131 |
! !
|