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