author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Fri, 16 Mar 2012 16:51:41 +0000 | |
branch | jv |
changeset 3029 | c7be0be50898 |
parent 3012 | 4f40b8304d54 |
child 3030 | f89aa3cfedde |
permissions | -rw-r--r-- |
2409 | 1 |
" |
2 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, |
|
3 |
Czech Technical University in Prague |
|
4 |
Copyright (c) 2009-2010 eXept Software AG |
|
5 |
||
6 |
Permission is hereby granted, free of charge, to any person |
|
7 |
obtaining a copy of this software and associated documentation |
|
8 |
files (the 'Software'), to deal in the Software without |
|
9 |
restriction, including without limitation the rights to use, |
|
10 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
11 |
copies of the Software, and to permit persons to whom the |
|
12 |
Software is furnished to do so, subject to the following |
|
13 |
conditions: |
|
14 |
||
15 |
The above copyright notice and this permission notice shall be |
|
16 |
included in all copies or substantial portions of the Software. |
|
17 |
||
18 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
19 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
20 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
21 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
22 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
23 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
24 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
25 |
OTHER DEALINGS IN THE SOFTWARE. |
|
26 |
" |
|
27 |
"{ Package: 'stx:libbasic3' }" |
|
28 |
||
29 |
ChangeSetDiffComponent subclass:#ChangeSetDiffEntry |
|
30 |
instanceVariableNames:'versionBase versionA versionB versionMerged' |
|
31 |
classVariableNames:'' |
|
32 |
poolDictionaries:'' |
|
33 |
category:'System-Changes-Diff' |
|
34 |
! |
|
35 |
||
36 |
!ChangeSetDiffEntry class methodsFor:'documentation'! |
|
37 |
||
38 |
copyright |
|
39 |
" |
|
40 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, |
|
41 |
Czech Technical University in Prague |
|
42 |
Copyright (c) 2009-2010 eXept Software AG |
|
43 |
||
44 |
Permission is hereby granted, free of charge, to any person |
|
45 |
obtaining a copy of this software and associated documentation |
|
46 |
files (the 'Software'), to deal in the Software without |
|
47 |
restriction, including without limitation the rights to use, |
|
48 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
49 |
copies of the Software, and to permit persons to whom the |
|
50 |
Software is furnished to do so, subject to the following |
|
51 |
conditions: |
|
52 |
||
53 |
The above copyright notice and this permission notice shall be |
|
54 |
included in all copies or substantial portions of the Software. |
|
55 |
||
56 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
57 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
58 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
59 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
60 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
61 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
62 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
63 |
OTHER DEALINGS IN THE SOFTWARE. |
|
64 |
||
65 |
" |
|
66 |
! ! |
|
67 |
||
68 |
!ChangeSetDiffEntry class methodsFor:'instance creation'! |
|
69 |
||
70 |
versionA:versionA |
|
71 |
||
72 |
^self new |
|
73 |
versionA: versionA; |
|
74 |
versionB: versionA asAntiChange |
|
75 |
||
76 |
"Modified: / 24-11-2009 / 12:30:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
77 |
! |
|
78 |
||
79 |
versionA:versionA versionB:versionB |
|
80 |
||
81 |
^self new |
|
82 |
versionA: versionA; |
|
83 |
versionB: versionB. |
|
84 |
! |
|
85 |
||
86 |
versionB:versionB |
|
87 |
||
88 |
^self new |
|
89 |
versionA: versionB asAntiChange; |
|
90 |
versionB: versionB. |
|
91 |
||
92 |
"Modified: / 24-11-2009 / 12:30:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
93 |
! ! |
|
94 |
||
95 |
!ChangeSetDiffEntry class methodsFor:'image specs'! |
|
96 |
||
97 |
iconMinus |
|
2492 | 98 |
^ ToolbarIconLibrary iconMinus12x12 |
2409 | 99 |
|
2492 | 100 |
"Modified: / 31-08-2011 / 10:51:21 / cg" |
2409 | 101 |
! |
102 |
||
103 |
iconPlus |
|
2492 | 104 |
^ ToolbarIconLibrary iconPlus12x12 |
2409 | 105 |
|
2492 | 106 |
"Modified: / 31-08-2011 / 10:51:34 / cg" |
2409 | 107 |
! ! |
108 |
||
109 |
!ChangeSetDiffEntry methodsFor:'accessing'! |
|
110 |
||
2631 | 111 |
changeClass |
112 |
||
113 |
^(versionA ? versionB) changeClass |
|
114 |
||
115 |
"Created: / 30-11-2011 / 11:35:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
116 |
! |
|
117 |
||
118 |
changeSelector |
|
119 |
||
120 |
| chg | |
|
121 |
||
122 |
(chg := versionA ? versionB) isMethodChange ifTrue:[ |
|
123 |
^chg changeSelector |
|
124 |
] ifFalse:[ |
|
125 |
^nil |
|
126 |
] |
|
127 |
||
128 |
"Created: / 30-11-2011 / 11:40:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
129 |
! |
|
130 |
||
2409 | 131 |
className |
132 |
||
133 |
^(versionA ? versionB) className |
|
134 |
||
135 |
"Created: / 01-11-2009 / 16:48:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
136 |
! |
|
137 |
||
138 |
merged |
|
139 |
^ versionMerged notNil |
|
140 |
||
141 |
"Modified: / 24-11-2009 / 12:55:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
142 |
! |
|
143 |
||
144 |
mergedUsingVersionA |
|
145 |
||
146 |
versionMerged ifNil:[^false]. |
|
147 |
versionA ifNil:[^false]. |
|
148 |
||
149 |
^versionA sameAs: versionMerged |
|
150 |
||
151 |
"Created: / 24-11-2009 / 08:16:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
152 |
! |
|
153 |
||
154 |
mergedUsingVersionB |
|
155 |
||
156 |
versionMerged ifNil:[^false]. |
|
157 |
versionB ifNil:[^false]. |
|
158 |
||
159 |
^versionB sameAs: versionMerged |
|
160 |
||
161 |
"Created: / 24-11-2009 / 08:16:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
162 |
! |
|
163 |
||
164 |
mergedUsingVersionBase |
|
165 |
||
166 |
versionMerged ifNil:[^false]. |
|
167 |
versionBase ifNil:[^false]. |
|
168 |
||
169 |
^versionBase sameAs: versionMerged |
|
170 |
||
171 |
"Created: / 24-11-2009 / 08:16:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
172 |
! |
|
173 |
||
174 |
name |
|
175 |
||
176 |
^self versionAorB displayString |
|
177 |
||
178 |
"Created: / 24-11-2009 / 09:56:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
179 |
! |
|
180 |
||
181 |
nonMetaClassName |
|
182 |
||
183 |
^(versionA ? versionB) nonMetaClassName |
|
184 |
||
185 |
"Created: / 21-11-2009 / 07:42:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
186 |
! |
|
187 |
||
188 |
versionA |
|
189 |
^ versionA |
|
190 |
! |
|
191 |
||
192 |
versionA:something |
|
193 |
versionA := something. |
|
194 |
! |
|
195 |
||
196 |
versionALabel |
|
197 |
^ parent versionALabel |
|
198 |
||
199 |
"Created: / 09-11-2009 / 12:38:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
200 |
! |
|
201 |
||
202 |
versionAText |
|
203 |
^ versionA source |
|
204 |
||
205 |
"Created: / 06-07-2011 / 12:29:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
206 |
! |
|
207 |
||
208 |
versionAorB |
|
209 |
||
210 |
^versionA isClassRemoveChangeOrMethodRemoveChange |
|
211 |
ifFalse:[versionA] |
|
212 |
ifTrue:[versionB] |
|
213 |
||
214 |
"Created: / 02-11-2009 / 18:48:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
215 |
! |
|
216 |
||
217 |
versionB |
|
218 |
^ versionB |
|
219 |
! |
|
220 |
||
221 |
versionB:something |
|
222 |
versionB := something. |
|
223 |
! |
|
224 |
||
225 |
versionBLabel |
|
226 |
^ parent versionBLabel |
|
227 |
||
228 |
"Created: / 09-11-2009 / 12:38:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
229 |
! |
|
230 |
||
231 |
versionBText |
|
232 |
^ versionB source |
|
233 |
||
234 |
"Created: / 06-07-2011 / 12:29:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
235 |
! |
|
236 |
||
237 |
versionBase |
|
238 |
^ versionBase |
|
239 |
! |
|
240 |
||
241 |
versionBase:something |
|
242 |
versionBase := something. |
|
243 |
! |
|
244 |
||
245 |
versionBaseLabel |
|
246 |
^ parent versionBaseLabel |
|
247 |
||
248 |
"Created: / 23-11-2009 / 22:55:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
249 |
! |
|
250 |
||
3029
c7be0be50898
- ChangeSet>>#fromFile: sets the name of the CS to tje filename.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
251 |
versionBaseText |
c7be0be50898
- ChangeSet>>#fromFile: sets the name of the CS to tje filename.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
252 |
^versionBase notNil ifTrue:[ |
c7be0be50898
- ChangeSet>>#fromFile: sets the name of the CS to tje filename.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
253 |
versionBase source |
c7be0be50898
- ChangeSet>>#fromFile: sets the name of the CS to tje filename.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
254 |
] ifFalse:[ |
c7be0be50898
- ChangeSet>>#fromFile: sets the name of the CS to tje filename.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
255 |
nil |
c7be0be50898
- ChangeSet>>#fromFile: sets the name of the CS to tje filename.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
256 |
] |
c7be0be50898
- ChangeSet>>#fromFile: sets the name of the CS to tje filename.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
257 |
|
c7be0be50898
- ChangeSet>>#fromFile: sets the name of the CS to tje filename.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
258 |
"Created: / 16-03-2012 / 15:20:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c7be0be50898
- ChangeSet>>#fromFile: sets the name of the CS to tje filename.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
259 |
! |
c7be0be50898
- ChangeSet>>#fromFile: sets the name of the CS to tje filename.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
260 |
|
2409 | 261 |
versionMerged |
262 |
^ versionMerged |
|
263 |
! |
|
264 |
||
265 |
versionMerged:aChange |
|
266 |
versionMerged := aChange. |
|
267 |
self changed:#resolution with: aChange |
|
268 |
||
269 |
"Modified: / 24-11-2009 / 12:58:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
270 |
! |
|
271 |
||
272 |
versionMergedLabel |
|
273 |
||
274 |
(versionMerged isNil) |
|
275 |
ifTrue:[^'<unresolved>' asText colorizeAllWith: Color red]. |
|
276 |
(versionMerged sameAs: versionA) |
|
277 |
ifTrue:[^self versionALabel]. |
|
278 |
(versionMerged sameAs: versionB) |
|
279 |
ifTrue:[^self versionBLabel]. |
|
280 |
(versionMerged sameAs: versionBase) |
|
281 |
ifTrue:[^self versionBaseLabel]. |
|
282 |
^'manual merge' |
|
283 |
! ! |
|
284 |
||
285 |
!ChangeSetDiffEntry methodsFor:'enumerating'! |
|
286 |
||
287 |
do: aBlock |
|
288 |
||
289 |
aBlock value: self |
|
290 |
||
291 |
"Created: / 25-11-2009 / 10:22:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
292 |
! ! |
|
293 |
||
294 |
!ChangeSetDiffEntry methodsFor:'merging'! |
|
295 |
||
296 |
automerge |
|
297 |
||
298 |
"Try to automatically merge differences. The merge is based |
|
299 |
on versionBase. If any of versions is same as versionBase, |
|
300 |
the other is used as merge result" |
|
301 |
||
302 |
versionBase ifNil:[^self]. |
|
303 |
||
304 |
(versionA sameAs: versionBase) ifTrue:[versionMerged := versionB copy]. |
|
305 |
(versionB sameAs: versionBase) ifTrue:[versionMerged := versionA copy]. |
|
306 |
||
307 |
"Created: / 02-11-2009 / 18:51:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
308 |
"Modified: / 25-11-2009 / 08:21:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
309 |
! ! |
|
310 |
||
311 |
!ChangeSetDiffEntry methodsFor:'testing'! |
|
312 |
||
313 |
isDiffItem |
|
314 |
^ true |
|
315 |
! ! |
|
316 |
||
317 |
!ChangeSetDiffEntry class methodsFor:'documentation'! |
|
318 |
||
319 |
version_CVS |
|
3011
1997ff6e7e55
trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2631
diff
changeset
|
320 |
^ '§Header: /cvs/stx/stx/libbasic3/ChangeSetDiffEntry.st,v 1.3 2011/11/30 18:52:51 vrany Exp §' |
3012 | 321 |
! |
322 |
||
323 |
version_SVN |
|
3029
c7be0be50898
- ChangeSet>>#fromFile: sets the name of the CS to tje filename.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
324 |
^ '$Id: ChangeSetDiffEntry.st 1895 2012-03-16 16:51:41Z vranyj1 $' |
3012 | 325 |
! ! |