author | Claus Gittinger <cg@exept.de> |
Wed, 05 Feb 2014 18:52:14 +0100 | |
changeset 3457 | 5fa7f02eea95 |
parent 2880 | 0072cabff85a |
child 3838 | 474d8ec95b33 |
child 4017 | e816f4b73919 |
permissions | -rw-r--r-- |
2406 | 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 |
||
2424
bc7e320cec40
Inherit from object, not Model (to fix dependencies)
vrany
parents:
2406
diff
changeset
|
29 |
Object subclass:#ChangeSetDiffComponent |
2406 | 30 |
instanceVariableNames:'parent' |
31 |
classVariableNames:'' |
|
32 |
poolDictionaries:'' |
|
33 |
category:'System-Changes-Diff' |
|
34 |
! |
|
35 |
||
36 |
!ChangeSetDiffComponent 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 |
||
2880 | 68 |
!ChangeSetDiffComponent class methodsFor:'others'! |
69 |
||
70 |
version_CVS |
|
3457 | 71 |
^ '$Header: /cvs/stx/stx/libbasic3/ChangeSetDiffComponent.st,v 1.5 2014-02-05 17:52:14 cg Exp $' |
2880 | 72 |
! ! |
73 |
||
2406 | 74 |
!ChangeSetDiffComponent methodsFor:'accessing'! |
75 |
||
76 |
changesetA |
|
2643 | 77 |
"Answers a changeset with containing all versionA changes" |
78 |
| cs | |
|
2406 | 79 |
|
2643 | 80 |
cs := ChangeSet new name: self versionALabel. |
81 |
self do:[:item| |
|
3457 | 82 |
(item versionA notNil" and:[item versionMerged isClassDefinitionChange or:[item versionMerged isMethodCodeChange]]") ifTrue:[ |
2880 | 83 |
cs add: item versionA |
84 |
] |
|
2643 | 85 |
]. |
86 |
^cs |
|
87 |
||
3457 | 88 |
"Modified: / 18-12-2013 / 20:55:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2406 | 89 |
! |
90 |
||
91 |
changesetB |
|
2880 | 92 |
"Answers a changeset with containing all versionA changes" |
2643 | 93 |
| cs | |
2406 | 94 |
|
2643 | 95 |
cs := ChangeSet new name: self versionBLabel. |
96 |
self do:[:item| |
|
3457 | 97 |
(item versionB notNil" and:[item versionMerged isClassDefinitionChange or:[item versionMerged isMethodCodeChange]]") ifTrue:[ |
2880 | 98 |
cs add: item versionB |
99 |
] |
|
2643 | 100 |
]. |
101 |
^cs |
|
102 |
||
3457 | 103 |
"Modified: / 18-12-2013 / 20:55:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2880 | 104 |
! |
105 |
||
106 |
changesetBase |
|
107 |
"Answers a changeset with containing all versionA changes" |
|
108 |
| cs | |
|
109 |
||
110 |
cs := ChangeSet new name: self versionBaseLabel. |
|
111 |
self do:[:item| |
|
3457 | 112 |
(item versionBase notNil" and:[item versionBase isClassDefinitionChange or:[item versionBase isMethodCodeChange]]") ifTrue:[ |
2880 | 113 |
cs add: item versionBase |
114 |
] |
|
115 |
]. |
|
116 |
^cs |
|
117 |
||
118 |
"Created: / 20-03-2012 / 13:31:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3457 | 119 |
"Modified: / 13-11-2013 / 11:47:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2880 | 120 |
! |
121 |
||
122 |
changesetMerged |
|
123 |
"Answers a changeset with containing all versionA changes" |
|
124 |
| cs | |
|
125 |
||
126 |
cs := ChangeSet new name: 'Merged'. |
|
127 |
self do:[:item| |
|
3457 | 128 |
(item versionMerged notNil "and:[item versionMerged isClassDefinitionChange or:[item versionMerged isMethodCodeChange]]") ifTrue:[ |
2880 | 129 |
cs add: item versionMerged |
3457 | 130 |
] |
2880 | 131 |
]. |
132 |
^cs |
|
133 |
||
134 |
"Created: / 20-03-2012 / 13:32:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3457 | 135 |
"Modified: / 13-11-2013 / 11:47:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
136 |
! |
|
137 |
||
138 |
depth |
|
139 |
"Return the depth if diff component hierarchy, 0 if there is no nesting at all" |
|
140 |
^0 |
|
141 |
||
142 |
"Created: / 15-01-2013 / 11:26:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2406 | 143 |
! |
144 |
||
145 |
diffs |
|
146 |
||
147 |
^#() |
|
148 |
||
149 |
"Created: / 10-11-2009 / 11:29:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
150 |
! |
|
151 |
||
152 |
flattened |
|
153 |
||
154 |
^ChangeSetDiffSet new add: self |
|
155 |
||
156 |
"Created: / 05-12-2009 / 11:07:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
157 |
! |
|
158 |
||
159 |
name |
|
160 |
"raise an error: must be redefined in concrete subclass(es)" |
|
161 |
||
162 |
^ self subclassResponsibility |
|
163 |
! |
|
164 |
||
165 |
parent |
|
166 |
^ parent |
|
167 |
! |
|
168 |
||
169 |
parent:aDiffSet |
|
170 |
parent := aDiffSet. |
|
2643 | 171 |
! |
172 |
||
173 |
versionALabel |
|
174 |
^ parent versionALabel |
|
175 |
||
176 |
"Created: / 09-11-2009 / 12:38:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
177 |
! |
|
178 |
||
179 |
versionBLabel |
|
180 |
^ parent versionBLabel |
|
181 |
||
182 |
"Created: / 09-11-2009 / 12:38:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2880 | 183 |
! |
184 |
||
185 |
versionBaseLabel |
|
186 |
^ parent versionBaseLabel |
|
187 |
||
188 |
"Created: / 20-03-2012 / 13:31:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2406 | 189 |
! ! |
190 |
||
191 |
!ChangeSetDiffComponent methodsFor:'change & update'! |
|
192 |
||
193 |
changed: aspect with: param |
|
194 |
||
195 |
(aspect = #resolution and:[parent notNil]) |
|
196 |
ifTrue:[parent changed: aspect with: param]. |
|
197 |
super changed: aspect with: param. |
|
198 |
||
199 |
"Created: / 24-11-2009 / 12:58:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
200 |
! ! |
|
201 |
||
202 |
!ChangeSetDiffComponent methodsFor:'enumerating'! |
|
203 |
||
204 |
do: aBlock |
|
205 |
||
206 |
self subclassResponsibility |
|
207 |
||
208 |
"Created: / 25-11-2009 / 10:22:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
209 |
! ! |
|
210 |
||
211 |
!ChangeSetDiffComponent methodsFor:'printing & storing'! |
|
212 |
||
213 |
printOn:aStream |
|
214 |
"append a printed representation if the receiver to the argument, aStream" |
|
215 |
||
216 |
super printOn:aStream. |
|
217 |
aStream nextPut:$(. |
|
218 |
self name printOn: aStream. |
|
219 |
aStream nextPut:$). |
|
220 |
||
221 |
"Modified: / 26-11-2009 / 16:25:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
222 |
! ! |
|
223 |
||
224 |
!ChangeSetDiffComponent methodsFor:'private'! |
|
225 |
||
226 |
flattenOn: stream |
|
227 |
||
228 |
^stream nextPut: self |
|
229 |
||
230 |
"Created: / 05-12-2009 / 11:06:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3457 | 231 |
! |
232 |
||
233 |
sort |
|
234 |
self sort: [:a :b|a printString < b printString ]. |
|
235 |
||
236 |
"Created: / 17-01-2013 / 13:56:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
237 |
! |
|
238 |
||
239 |
sort: sortBlock |
|
240 |
self subclassResponsibility |
|
241 |
||
242 |
"Created: / 17-01-2013 / 13:57:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2406 | 243 |
! ! |
244 |
||
245 |
!ChangeSetDiffComponent methodsFor:'testing'! |
|
246 |
||
3457 | 247 |
isConflict |
248 |
"Return true, if there is a conflict." |
|
249 |
||
250 |
^ self subclassResponsibility |
|
251 |
||
252 |
"Modified (comment): / 01-08-2012 / 17:11:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
253 |
! |
|
254 |
||
2406 | 255 |
isDiffItem |
256 |
^ false |
|
257 |
! |
|
258 |
||
259 |
isDiffSet |
|
260 |
^ false |
|
261 |
! |
|
262 |
||
263 |
isEmpty |
|
264 |
||
265 |
^false |
|
2880 | 266 |
! |
267 |
||
3457 | 268 |
isForCopyrightMethod |
269 |
"Returns true, if this is an entry for #copyright method" |
|
270 |
^self subclassResponsibility |
|
271 |
||
272 |
"Created: / 01-08-2012 / 16:37:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
273 |
! |
|
274 |
||
2880 | 275 |
isForVersionMethod |
276 |
"Returns true, if this is an entry for version method" |
|
277 |
^self subclassResponsibility |
|
278 |
||
279 |
"Created: / 18-04-2012 / 19:04:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
280 |
! |
|
281 |
||
282 |
isMerged |
|
283 |
"raise an error: must be redefined in concrete subclass(es)" |
|
284 |
||
285 |
^ self subclassResponsibility |
|
2406 | 286 |
! ! |
287 |
||
288 |
!ChangeSetDiffComponent class methodsFor:'documentation'! |
|
289 |
||
2880 | 290 |
version_SVN |
3457 | 291 |
^ '$Id: ChangeSetDiffComponent.st,v 1.5 2014-02-05 17:52:14 cg Exp $' |
2406 | 292 |
! ! |
3457 | 293 |