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