author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Thu, 17 Jan 2013 17:02:15 +0000 | |
branch | jv |
changeset 3099 | be6ff432a2ad |
parent 3098 | 67aaf3fadffb |
child 3121 | 19723298dd2c |
child 3122 | 91c582043a51 |
child 3125 | 08d6603c4fe9 |
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 |
||
3078 | 68 |
!ChangeSetDiffComponent class methodsFor:'others'! |
69 |
||
70 |
version_CVS |
|
71 |
^ '§Header: /cvs/stx/stx/libbasic3/ChangeSetDiffComponent.st,v 1.4 2012/07/31 12:34:40 vrany Exp §' |
|
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| |
|
3033 | 82 |
(item versionMerged isClassDefinitionChange or:[item versionMerged isMethodCodeChange]) ifTrue:[ |
83 |
cs add: item versionA |
|
84 |
] |
|
2643 | 85 |
]. |
86 |
^cs |
|
87 |
||
3033 | 88 |
"Modified: / 20-03-2012 / 13:57:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2406 | 89 |
! |
90 |
||
91 |
changesetB |
|
3033 | 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| |
|
3033 | 97 |
(item versionMerged isClassDefinitionChange or:[item versionMerged isMethodCodeChange]) ifTrue:[ |
98 |
cs add: item versionB |
|
99 |
] |
|
2643 | 100 |
]. |
101 |
^cs |
|
102 |
||
3033 | 103 |
"Modified: / 20-03-2012 / 13:57:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
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| |
|
112 |
(item versionBase isClassDefinitionChange or:[item versionBase isMethodCodeChange]) ifTrue:[ |
|
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>" |
|
119 |
! |
|
120 |
||
121 |
changesetMerged |
|
122 |
"Answers a changeset with containing all versionA changes" |
|
123 |
| cs | |
|
124 |
||
125 |
cs := ChangeSet new name: 'Merged'. |
|
126 |
self do:[:item| |
|
3036
7be02f89af2b
Fixes in merging category changes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
127 |
"/ (item versionMerged isClassDefinitionChange or:[item versionMerged isMethodCodeChange]) ifTrue:[ |
3033 | 128 |
cs add: item versionMerged |
3036
7be02f89af2b
Fixes in merging category changes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3033
diff
changeset
|
129 |
"/ ] |
3033 | 130 |
]. |
131 |
^cs |
|
132 |
||
133 |
"Created: / 20-03-2012 / 13:32:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2406 | 134 |
! |
135 |
||
3098
67aaf3fadffb
Added ChangeSetDiffComponent>>depth
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3078
diff
changeset
|
136 |
depth |
67aaf3fadffb
Added ChangeSetDiffComponent>>depth
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3078
diff
changeset
|
137 |
"Return the depth if diff component hierarchy, 0 if there is no nesting at all" |
67aaf3fadffb
Added ChangeSetDiffComponent>>depth
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3078
diff
changeset
|
138 |
^0 |
67aaf3fadffb
Added ChangeSetDiffComponent>>depth
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3078
diff
changeset
|
139 |
|
67aaf3fadffb
Added ChangeSetDiffComponent>>depth
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3078
diff
changeset
|
140 |
"Created: / 15-01-2013 / 11:26:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
67aaf3fadffb
Added ChangeSetDiffComponent>>depth
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3078
diff
changeset
|
141 |
! |
67aaf3fadffb
Added ChangeSetDiffComponent>>depth
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3078
diff
changeset
|
142 |
|
2406 | 143 |
diffs |
144 |
||
145 |
^#() |
|
146 |
||
147 |
"Created: / 10-11-2009 / 11:29:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
148 |
! |
|
149 |
||
150 |
flattened |
|
151 |
||
152 |
^ChangeSetDiffSet new add: self |
|
153 |
||
154 |
"Created: / 05-12-2009 / 11:07:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
155 |
! |
|
156 |
||
157 |
name |
|
158 |
"raise an error: must be redefined in concrete subclass(es)" |
|
159 |
||
160 |
^ self subclassResponsibility |
|
161 |
! |
|
162 |
||
163 |
parent |
|
164 |
^ parent |
|
165 |
! |
|
166 |
||
167 |
parent:aDiffSet |
|
168 |
parent := aDiffSet. |
|
2643 | 169 |
! |
170 |
||
171 |
versionALabel |
|
172 |
^ parent versionALabel |
|
173 |
||
174 |
"Created: / 09-11-2009 / 12:38:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
175 |
! |
|
176 |
||
177 |
versionBLabel |
|
178 |
^ parent versionBLabel |
|
179 |
||
180 |
"Created: / 09-11-2009 / 12:38:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3033 | 181 |
! |
182 |
||
183 |
versionBaseLabel |
|
184 |
^ parent versionBaseLabel |
|
185 |
||
186 |
"Created: / 20-03-2012 / 13:31:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2406 | 187 |
! ! |
188 |
||
189 |
!ChangeSetDiffComponent methodsFor:'change & update'! |
|
190 |
||
191 |
changed: aspect with: param |
|
192 |
||
193 |
(aspect = #resolution and:[parent notNil]) |
|
194 |
ifTrue:[parent changed: aspect with: param]. |
|
195 |
super changed: aspect with: param. |
|
196 |
||
197 |
"Created: / 24-11-2009 / 12:58:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
198 |
! ! |
|
199 |
||
200 |
!ChangeSetDiffComponent methodsFor:'enumerating'! |
|
201 |
||
202 |
do: aBlock |
|
203 |
||
204 |
self subclassResponsibility |
|
205 |
||
206 |
"Created: / 25-11-2009 / 10:22:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
207 |
! ! |
|
208 |
||
209 |
!ChangeSetDiffComponent methodsFor:'printing & storing'! |
|
210 |
||
211 |
printOn:aStream |
|
212 |
"append a printed representation if the receiver to the argument, aStream" |
|
213 |
||
214 |
super printOn:aStream. |
|
215 |
aStream nextPut:$(. |
|
216 |
self name printOn: aStream. |
|
217 |
aStream nextPut:$). |
|
218 |
||
219 |
"Modified: / 26-11-2009 / 16:25:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
220 |
! ! |
|
221 |
||
222 |
!ChangeSetDiffComponent methodsFor:'private'! |
|
223 |
||
224 |
flattenOn: stream |
|
225 |
||
226 |
^stream nextPut: self |
|
227 |
||
228 |
"Created: / 05-12-2009 / 11:06:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3099
be6ff432a2ad
Fixes in ChangeSetDiff...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3098
diff
changeset
|
229 |
! |
be6ff432a2ad
Fixes in ChangeSetDiff...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3098
diff
changeset
|
230 |
|
be6ff432a2ad
Fixes in ChangeSetDiff...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3098
diff
changeset
|
231 |
sort |
be6ff432a2ad
Fixes in ChangeSetDiff...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3098
diff
changeset
|
232 |
self sort: [:a :b|a printString < b printString ]. |
be6ff432a2ad
Fixes in ChangeSetDiff...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3098
diff
changeset
|
233 |
|
be6ff432a2ad
Fixes in ChangeSetDiff...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3098
diff
changeset
|
234 |
"Created: / 17-01-2013 / 13:56:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
be6ff432a2ad
Fixes in ChangeSetDiff...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3098
diff
changeset
|
235 |
! |
be6ff432a2ad
Fixes in ChangeSetDiff...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3098
diff
changeset
|
236 |
|
be6ff432a2ad
Fixes in ChangeSetDiff...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3098
diff
changeset
|
237 |
sort: sortBlock |
be6ff432a2ad
Fixes in ChangeSetDiff...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3098
diff
changeset
|
238 |
self subclassResponsibility |
be6ff432a2ad
Fixes in ChangeSetDiff...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3098
diff
changeset
|
239 |
|
be6ff432a2ad
Fixes in ChangeSetDiff...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3098
diff
changeset
|
240 |
"Created: / 17-01-2013 / 13:57:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2406 | 241 |
! ! |
242 |
||
243 |
!ChangeSetDiffComponent methodsFor:'testing'! |
|
244 |
||
3074
e38a06f751a5
Some more testing methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3069
diff
changeset
|
245 |
isConflict |
e38a06f751a5
Some more testing methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3069
diff
changeset
|
246 |
"Return true, if there is a conflict." |
e38a06f751a5
Some more testing methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3069
diff
changeset
|
247 |
|
e38a06f751a5
Some more testing methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3069
diff
changeset
|
248 |
^ self subclassResponsibility |
e38a06f751a5
Some more testing methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3069
diff
changeset
|
249 |
|
e38a06f751a5
Some more testing methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3069
diff
changeset
|
250 |
"Modified (comment): / 01-08-2012 / 17:11:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
e38a06f751a5
Some more testing methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3069
diff
changeset
|
251 |
! |
e38a06f751a5
Some more testing methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3069
diff
changeset
|
252 |
|
2406 | 253 |
isDiffItem |
254 |
^ false |
|
255 |
! |
|
256 |
||
257 |
isDiffSet |
|
258 |
^ false |
|
259 |
! |
|
260 |
||
261 |
isEmpty |
|
262 |
||
263 |
^false |
|
3030 | 264 |
! |
265 |
||
3074
e38a06f751a5
Some more testing methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3069
diff
changeset
|
266 |
isForCopyrightMethod |
e38a06f751a5
Some more testing methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3069
diff
changeset
|
267 |
"Returns true, if this is an entry for #copyright method" |
e38a06f751a5
Some more testing methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3069
diff
changeset
|
268 |
^self subclassResponsibility |
e38a06f751a5
Some more testing methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3069
diff
changeset
|
269 |
|
e38a06f751a5
Some more testing methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3069
diff
changeset
|
270 |
"Created: / 01-08-2012 / 16:37:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
e38a06f751a5
Some more testing methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3069
diff
changeset
|
271 |
! |
e38a06f751a5
Some more testing methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3069
diff
changeset
|
272 |
|
3051 | 273 |
isForVersionMethod |
274 |
"Returns true, if this is an entry for version method" |
|
275 |
^self subclassResponsibility |
|
276 |
||
277 |
"Created: / 18-04-2012 / 19:04:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
278 |
! |
|
279 |
||
3030 | 280 |
isMerged |
281 |
"raise an error: must be redefined in concrete subclass(es)" |
|
282 |
||
283 |
^ self subclassResponsibility |
|
2406 | 284 |
! ! |
285 |
||
286 |
!ChangeSetDiffComponent class methodsFor:'documentation'! |
|
287 |
||
3069 | 288 |
version |
3099
be6ff432a2ad
Fixes in ChangeSetDiff...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3098
diff
changeset
|
289 |
^ '$Id: ChangeSetDiffComponent.st 1986 2013-01-17 17:02:15Z vranyj1 $' |
3012 | 290 |
! |
291 |
||
292 |
version_SVN |
|
3099
be6ff432a2ad
Fixes in ChangeSetDiff...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3098
diff
changeset
|
293 |
^ '$Id: ChangeSetDiffComponent.st 1986 2013-01-17 17:02:15Z vranyj1 $' |
3012 | 294 |
! ! |