author | Claus Gittinger <cg@exept.de> |
Thu, 08 Nov 2001 19:32:34 +0100 | |
changeset 1097 | 88c7c0313286 |
parent 1096 | 4a949a840bb3 |
child 1098 | 420a868fd606 |
permissions | -rw-r--r-- |
3 | 1 |
" |
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
16 | 3 |
All Rights Reserved |
3 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
0 | 12 |
|
921
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
13 |
"{ Package: 'stx:libbasic3' }" |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
14 |
|
0 | 15 |
OrderedCollection subclass:#ChangeSet |
235 | 16 |
instanceVariableNames:'' |
17 |
classVariableNames:'' |
|
18 |
poolDictionaries:'' |
|
19 |
category:'System-Changes' |
|
0 | 20 |
! |
21 |
||
625
06f4ed35832b
added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
378
diff
changeset
|
22 |
!ChangeSet class methodsFor:'documentation'! |
9 | 23 |
|
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
16 | 27 |
All Rights Reserved |
9 | 28 |
|
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
38 |
documentation |
|
39 |
" |
|
40 |
used in the changes management to keep track of changes |
|
235 | 41 |
|
42 |
[author:] |
|
879 | 43 |
Claus Gittinger |
9 | 44 |
" |
45 |
! ! |
|
46 |
||
654 | 47 |
!ChangeSet class methodsFor:'instance creation'! |
48 |
||
1042
702a30f7c328
chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents:
1041
diff
changeset
|
49 |
changesFromParseTree:aTree andStream:aStream lineNumber:initialLineNumberOrNil position:initialPositionOrNil do:aBlock |
930 | 50 |
"given a parse-tree (from parsing some changes source/chunk), |
51 |
create changes and evaluate aBlock on each. |
|
52 |
The block is invoked with the change and a lineNumberOrNil as |
|
53 |
arg; the lineNumber is only valid, if the underlying stream |
|
54 |
provides line-numbers; otherwise, nil is passed." |
|
55 |
||
56 |
|changes sel className categoryName |
|
57 |
methodSource methodSelector change parser |
|
58 |
oldName newName priv receiver receiverVarName |
|
59 |
receiverSelector receiverReceiver primSource |
|
1042
702a30f7c328
chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents:
1041
diff
changeset
|
60 |
nameSpace lineNumberOrNil posOrNil| |
930 | 61 |
|
931 | 62 |
lineNumberOrNil := initialLineNumberOrNil. |
1042
702a30f7c328
chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents:
1041
diff
changeset
|
63 |
posOrNil := initialPositionOrNil. |
930 | 64 |
|
65 |
"/ nameSpace := Class nameSpaceQuerySignal query. |
|
66 |
"/ nameSpace isNil ifTrue:[nameSpace := Smalltalk]. |
|
67 |
||
68 |
sel := aTree selector. |
|
69 |
receiver := aTree receiver. |
|
70 |
receiver isMessage ifTrue:[ |
|
71 |
receiverSelector := receiver selector. |
|
72 |
receiverReceiver := receiver receiver. |
|
73 |
] ifFalse:[ |
|
74 |
receiver isVariable ifTrue:[ |
|
75 |
receiverVarName := receiver name |
|
76 |
] |
|
77 |
]. |
|
78 |
||
960
9b0994b92e10
parse v'age, squeak and stv changesets
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
79 |
(sel == #'methods' |
9b0994b92e10
parse v'age, squeak and stv changesets
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
80 |
or:[(sel == #'methodsFor:') |
9b0994b92e10
parse v'age, squeak and stv changesets
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
81 |
or:[(sel == #'publicMethodsFor:') |
9b0994b92e10
parse v'age, squeak and stv changesets
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
82 |
or:[(sel == #'privateMethodsFor:') |
9b0994b92e10
parse v'age, squeak and stv changesets
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
83 |
or:[(sel == #'methodsFor:stamp:') |
9b0994b92e10
parse v'age, squeak and stv changesets
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
84 |
or:[(sel == #'ignoredMethodsFor:')]]]]]) ifTrue:[ |
930 | 85 |
(sel == #'ignoredMethodsFor:') ifTrue:[ |
86 |
priv := #ignored. |
|
87 |
] ifFalse:[ |
|
88 |
priv := nil |
|
89 |
]. |
|
90 |
(receiver isUnaryMessage |
|
91 |
and:[receiverSelector == #class]) ifTrue:[ |
|
92 |
className := (receiverReceiver name) , ' class'. |
|
93 |
] ifFalse:[ |
|
94 |
className := (receiver name). |
|
95 |
]. |
|
96 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
|
97 |
"/ className := nameSpace name , '::' , className |
|
98 |
"/ ]. |
|
960
9b0994b92e10
parse v'age, squeak and stv changesets
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
99 |
sel == #'methods' ifTrue:[ |
9b0994b92e10
parse v'age, squeak and stv changesets
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
100 |
categoryName := 'uncategorized' |
9b0994b92e10
parse v'age, squeak and stv changesets
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
101 |
] ifFalse:[ |
9b0994b92e10
parse v'age, squeak and stv changesets
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
102 |
categoryName := (aTree arguments at:1) evaluate. |
9b0994b92e10
parse v'age, squeak and stv changesets
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
103 |
]. |
930 | 104 |
aStream skipSeparators. |
105 |
lineNumberOrNil := aStream lineNumber. |
|
1042
702a30f7c328
chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents:
1041
diff
changeset
|
106 |
posOrNil := aStream position. |
930 | 107 |
methodSource := aStream nextChunk. |
108 |
changes := OrderedCollection new. |
|
109 |
||
110 |
[methodSource notEmpty] whileTrue:[ |
|
111 |
parser := Parser |
|
112 |
parseMethodArgAndVarSpecification:methodSource |
|
113 |
in:nil |
|
114 |
ignoreErrors:true |
|
115 |
ignoreWarnings:true |
|
116 |
parseBody:false. |
|
117 |
||
118 |
parser isNil ifTrue:[ |
|
119 |
"/ something wierd ... |
|
120 |
methodSelector := '????'. |
|
121 |
] ifFalse:[ |
|
122 |
methodSelector := parser selector. |
|
123 |
]. |
|
124 |
||
125 |
change := MethodChange new. |
|
126 |
change |
|
127 |
className:className |
|
128 |
selector:methodSelector |
|
129 |
source:methodSource |
|
130 |
category:categoryName |
|
131 |
privacy:priv. |
|
1042
702a30f7c328
chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents:
1041
diff
changeset
|
132 |
aBlock value:change value:lineNumberOrNil value:posOrNil. |
930 | 133 |
|
134 |
aStream skipSeparators. |
|
135 |
lineNumberOrNil := aStream lineNumber. |
|
1042
702a30f7c328
chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents:
1041
diff
changeset
|
136 |
posOrNil := aStream position. |
930 | 137 |
methodSource := aStream nextChunk. |
138 |
]. |
|
139 |
^ true |
|
140 |
]. |
|
141 |
||
142 |
sel == #'removeSelector:' ifTrue:[ |
|
143 |
(receiver isUnaryMessage |
|
144 |
and:[receiverSelector == #class]) ifTrue:[ |
|
145 |
className := (receiverReceiver name) , ' class'. |
|
146 |
] ifFalse:[ |
|
147 |
className := (receiver name). |
|
148 |
]. |
|
149 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
|
150 |
"/ className := nameSpace name , '::' , className |
|
151 |
"/ ]. |
|
152 |
methodSelector := (aTree arguments at:1) evaluate. |
|
153 |
change := MethodRemoveChange new. |
|
154 |
change |
|
155 |
className:className |
|
156 |
selector:methodSelector. |
|
1042
702a30f7c328
chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents:
1041
diff
changeset
|
157 |
aBlock value:change value:lineNumberOrNil value:posOrNil. |
930 | 158 |
^ true |
159 |
]. |
|
160 |
||
161 |
"/ any subclass definiton selector ? |
|
162 |
(Behavior definitionSelectors includes:sel) |
|
163 |
ifTrue:[ |
|
164 |
className := (aTree arguments at:1) evaluate. |
|
165 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
|
166 |
"/ className := nameSpace name , '::' , className |
|
167 |
"/ ]. |
|
1045
1b2aa47f9dc5
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
1042
diff
changeset
|
168 |
nameSpace := Class nameSpaceQuerySignal query. |
1b2aa47f9dc5
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
1042
diff
changeset
|
169 |
nameSpace ~~ Smalltalk ifTrue:[ |
1b2aa47f9dc5
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
1042
diff
changeset
|
170 |
className := nameSpace name , '::' , className |
1b2aa47f9dc5
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
1042
diff
changeset
|
171 |
]. |
1b2aa47f9dc5
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
1042
diff
changeset
|
172 |
|
930 | 173 |
change := ClassDefinitionChange new. |
174 |
change |
|
175 |
className:className; |
|
176 |
source:(aTree printString). |
|
1045
1b2aa47f9dc5
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
1042
diff
changeset
|
177 |
|
1b2aa47f9dc5
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
1042
diff
changeset
|
178 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
1b2aa47f9dc5
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
1042
diff
changeset
|
179 |
"/ change nameSpaceName:(nameSpace name). |
1b2aa47f9dc5
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
1042
diff
changeset
|
180 |
"/ ]. |
1b2aa47f9dc5
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
1042
diff
changeset
|
181 |
"/ |
1042
702a30f7c328
chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents:
1041
diff
changeset
|
182 |
aBlock value:change value:lineNumberOrNil value:posOrNil. |
930 | 183 |
^ true |
184 |
]. |
|
185 |
||
186 |
sel == #'renameCategory:to:' ifTrue:[ |
|
187 |
(receiver isUnaryMessage |
|
188 |
and:[receiverSelector == #class]) ifTrue:[ |
|
189 |
className := (receiverReceiver name) , ' class'. |
|
190 |
] ifFalse:[ |
|
191 |
className := (receiver name). |
|
192 |
]. |
|
193 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
|
194 |
"/ className := nameSpace name , '::' , className |
|
195 |
"/ ]. |
|
196 |
change := MethodCategoryRenameChange new. |
|
197 |
change |
|
198 |
className:className; |
|
199 |
oldCategoryName:(aTree arguments at:1) evaluate |
|
200 |
newCategoryName:(aTree arguments at:2) evaluate. |
|
1042
702a30f7c328
chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents:
1041
diff
changeset
|
201 |
aBlock value:change value:lineNumberOrNil value:posOrNil. |
930 | 202 |
^ true |
203 |
]. |
|
204 |
||
205 |
(sel == #'category:' |
|
206 |
or:[sel == #'privacy:']) ifTrue:[ |
|
207 |
(receiver isMessage |
|
208 |
and:[receiverSelector == #'compiledMethodAt:']) ifTrue:[ |
|
209 |
(receiverReceiver isUnaryMessage |
|
210 |
and:[receiverReceiver selector == #class]) ifTrue:[ |
|
211 |
className := (receiverReceiver receiver name) , ' class'. |
|
212 |
] ifFalse:[ |
|
213 |
className := (receiverReceiver name). |
|
214 |
]. |
|
215 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
|
216 |
"/ className := nameSpace name , '::' , className |
|
217 |
"/ ]. |
|
218 |
methodSelector := (receiver arguments at:1) evaluate. |
|
219 |
||
220 |
sel == #'category:' ifTrue:[ |
|
221 |
change := MethodCategoryChange new. |
|
222 |
change |
|
223 |
className:className |
|
224 |
selector:methodSelector |
|
225 |
category:(aTree arguments at:1) evaluate. |
|
226 |
] ifFalse:[ |
|
227 |
change := MethodPrivacyChange new. |
|
228 |
change |
|
229 |
className:className |
|
230 |
selector:methodSelector |
|
231 |
privacy:(aTree arguments at:1) evaluate. |
|
232 |
]. |
|
233 |
||
1042
702a30f7c328
chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents:
1041
diff
changeset
|
234 |
aBlock value:change value:lineNumberOrNil value:posOrNil. |
930 | 235 |
^ true |
236 |
] ifFalse:[ |
|
237 |
self halt:'unexpected change' |
|
238 |
]. |
|
239 |
]. |
|
240 |
||
241 |
sel == #'comment:' ifTrue:[ |
|
242 |
(receiver isUnaryMessage |
|
243 |
and:[receiverSelector == #class]) ifTrue:[ |
|
244 |
className := (receiverReceiver name) , ' class'. |
|
245 |
] ifFalse:[ |
|
246 |
className := (receiver name). |
|
247 |
]. |
|
248 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
|
249 |
"/ className := nameSpace name , '::' , className |
|
250 |
"/ ]. |
|
251 |
||
252 |
change := ClassCommentChange new. |
|
253 |
change |
|
254 |
className:className |
|
255 |
comment:(aTree arguments at:1) evaluate. |
|
256 |
change source:(aTree printString). |
|
1042
702a30f7c328
chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents:
1041
diff
changeset
|
257 |
aBlock value:change value:lineNumberOrNil value:posOrNil. |
930 | 258 |
^ true |
259 |
]. |
|
260 |
||
261 |
sel == #'instanceVariableNames:' ifTrue:[ |
|
262 |
(receiver isUnaryMessage |
|
263 |
and:[receiverSelector == #class]) ifTrue:[ |
|
264 |
className := (receiverReceiver name) , ' class'. |
|
265 |
] ifFalse:[ |
|
266 |
className := (receiver name). |
|
267 |
]. |
|
268 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
|
269 |
"/ className := nameSpace name , '::' , className |
|
270 |
"/ ]. |
|
271 |
change := ClassInstVarDefinitionChange new. |
|
272 |
change className:className. |
|
273 |
change source:(aTree printString). |
|
1042
702a30f7c328
chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents:
1041
diff
changeset
|
274 |
aBlock value:change value:lineNumberOrNil value:posOrNil. |
930 | 275 |
^ true |
276 |
]. |
|
277 |
||
278 |
sel == #'removeClass:' ifTrue:[ |
|
279 |
(receiverVarName == #Smalltalk) ifTrue:[ |
|
280 |
className := (aTree arguments at:1) name. |
|
281 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
|
282 |
"/ className := nameSpace name , '::' , className |
|
283 |
"/ ]. |
|
284 |
||
285 |
change := ClassRemoveChange new. |
|
286 |
change className:className. |
|
1042
702a30f7c328
chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents:
1041
diff
changeset
|
287 |
aBlock value:change value:lineNumberOrNil value:posOrNil. |
930 | 288 |
^ true |
289 |
] ifFalse:[ |
|
939 | 290 |
self halt:'unexpected receiver in #name: message' |
930 | 291 |
]. |
292 |
]. |
|
293 |
||
294 |
sel == #'renameClass:to:' ifTrue:[ |
|
295 |
(receiverVarName == #Smalltalk) ifTrue:[ |
|
296 |
oldName := (aTree arguments at:1) name. |
|
297 |
newName := (aTree arguments at:2) evaluate. |
|
298 |
||
299 |
change := ClassRenameChange new. |
|
300 |
change oldName:oldName newName:newName. |
|
1042
702a30f7c328
chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents:
1041
diff
changeset
|
301 |
aBlock value:change value:lineNumberOrNil value:posOrNil. |
930 | 302 |
^ true |
303 |
] ifFalse:[ |
|
939 | 304 |
self halt:'unexpected receiver in #name: message' |
930 | 305 |
]. |
306 |
]. |
|
307 |
||
308 |
sel == #'name:' ifTrue:[ |
|
309 |
((receiverVarName == #Namespace) |
|
310 |
or:[receiverVarName == #NameSpace]) ifTrue:[ |
|
311 |
className := (aTree arguments at:1) evaluate. |
|
312 |
||
313 |
change := NameSpaceCreationChange new. |
|
314 |
change name:className. |
|
1042
702a30f7c328
chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents:
1041
diff
changeset
|
315 |
aBlock value:change value:lineNumberOrNil value:posOrNil. |
930 | 316 |
^ true |
317 |
] ifFalse:[ |
|
939 | 318 |
self halt:'unexpected receiver in #name: message' |
930 | 319 |
]. |
320 |
]. |
|
321 |
||
322 |
(sel == #'primitiveDefinitions' |
|
323 |
or:[sel == #'primitiveFunctions' |
|
324 |
or:[sel == #'primitiveVariables']]) ifTrue:[ |
|
325 |
(receiver isUnaryMessage |
|
326 |
and:[receiverSelector == #class]) ifTrue:[ |
|
327 |
className := (receiverReceiver name) , ' class'. |
|
328 |
] ifFalse:[ |
|
329 |
className := (receiver name). |
|
330 |
]. |
|
331 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
|
332 |
"/ className := nameSpace name , '::' , className |
|
333 |
"/ ]. |
|
334 |
||
335 |
aStream skipSeparators. |
|
336 |
primSource := aStream nextChunk. |
|
337 |
||
338 |
sel == #'primitiveDefinitions' ifTrue:[ |
|
339 |
change := ClassPrimitiveDefinitionsChange new |
|
340 |
] ifFalse:[ |
|
341 |
sel == #'primitiveFunctions' ifTrue:[ |
|
342 |
change := ClassPrimitiveFunctionsChange new |
|
343 |
] ifFalse:[ |
|
344 |
change := ClassPrimitiveVariablesChange new |
|
345 |
] |
|
346 |
]. |
|
347 |
change class:className source:primSource. |
|
1042
702a30f7c328
chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents:
1041
diff
changeset
|
348 |
aBlock value:change value:lineNumberOrNil value:posOrNil. |
930 | 349 |
^ true |
350 |
]. |
|
351 |
||
352 |
^ false |
|
353 |
||
354 |
"Created: / 16.2.1998 / 13:42:40 / cg" |
|
355 |
"Modified: / 15.12.1999 / 00:29:06 / cg" |
|
356 |
! |
|
357 |
||
358 |
changesFromStream:aStream do:aBlock |
|
359 |
"enumerate changes from a stream and invoke aBlock on each. |
|
360 |
The block is invoked with the change and a lineNumberOrNil as |
|
361 |
arg; the lineNumber is only valid, if the underlying stream |
|
362 |
provides line-numbers; otherwise, nil is passed." |
|
363 |
||
364 |
|chunk sawExcla lastTimeStamp s change nameSpace changes |
|
1042
702a30f7c328
chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents:
1041
diff
changeset
|
365 |
lineNumber pos| |
930 | 366 |
|
367 |
nameSpace := Smalltalk. |
|
368 |
||
369 |
[aStream atEnd] whileFalse:[ |
|
370 |
aStream skipSeparators. |
|
371 |
sawExcla := aStream peekFor:$!!. |
|
372 |
lineNumber := aStream lineNumber. |
|
1042
702a30f7c328
chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents:
1041
diff
changeset
|
373 |
pos := aStream position. |
930 | 374 |
chunk := aStream nextChunk. |
375 |
(chunk notNil and:[chunk notEmpty]) ifTrue:[ |
|
376 |
Class nameSpaceQuerySignal answer:nameSpace do:[ |
|
377 |
|parser tree ns| |
|
378 |
||
379 |
parser := Parser for:chunk. |
|
380 |
tree := parser |
|
381 |
parseExpressionWithSelf:nil |
|
382 |
notifying:nil |
|
383 |
ignoreErrors:true |
|
384 |
ignoreWarnings:true |
|
385 |
inNameSpace:nameSpace. |
|
386 |
||
387 |
tree == #Error ifTrue:[ |
|
388 |
change := DoItChange new. |
|
389 |
change source:chunk. |
|
1042
702a30f7c328
chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents:
1041
diff
changeset
|
390 |
aBlock value:change value:lineNumber value:pos. |
930 | 391 |
] ifFalse:[ |
392 |
(tree notNil and:[tree ~~ #Error]) ifTrue:[ |
|
393 |
"/ if there is any nameSpace directive in there, extract it. |
|
394 |
((ns := parser currentNameSpace) notNil |
|
395 |
and:[ns ~~ nameSpace]) ifTrue:[ |
|
396 |
"/ self halt. |
|
397 |
nameSpace := ns |
|
398 |
]. |
|
399 |
Class nameSpaceQuerySignal answer:nameSpace do:[ |
|
400 |
"/ |
|
401 |
"/ what type of chunk is this ... |
|
402 |
"/ |
|
403 |
tree isConstant ifTrue:[ |
|
404 |
(s := tree evaluate) isString ifTrue:[ |
|
405 |
(s startsWith:'---- timestamp ') ifTrue:[ |
|
406 |
lastTimeStamp := s. |
|
407 |
] |
|
408 |
] ifFalse:[ |
|
409 |
self halt:'unexpected change-chunk' |
|
410 |
] |
|
411 |
] ifFalse:[ |
|
412 |
tree isMessage ifTrue:[ |
|
413 |
(self |
|
414 |
changesFromParseTree:tree |
|
415 |
andStream:aStream |
|
931 | 416 |
lineNumber:lineNumber |
1042
702a30f7c328
chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents:
1041
diff
changeset
|
417 |
position:pos |
930 | 418 |
do:aBlock) ifFalse:[ |
419 |
change := DoItChange new. |
|
420 |
change source:chunk. |
|
1042
702a30f7c328
chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents:
1041
diff
changeset
|
421 |
aBlock value:change value:lineNumber value:pos. |
930 | 422 |
] |
423 |
] ifFalse:[ |
|
424 |
self halt:'unexpected change-chunk' |
|
425 |
] |
|
426 |
] |
|
427 |
] |
|
428 |
] |
|
429 |
] |
|
430 |
] |
|
431 |
] |
|
432 |
]. |
|
433 |
||
434 |
" |
|
435 |
ChangeSet fromStream:('changes' asFilename readStream) |
|
436 |
ChangeSet fromStream:('patches' asFilename readStream) |
|
437 |
ChangeSet fromStream:(Object source asString readStream) |
|
438 |
" |
|
439 |
||
440 |
"Created: / 16.2.1998 / 12:19:34 / cg" |
|
441 |
"Modified: / 14.12.1999 / 15:23:16 / cg" |
|
442 |
! |
|
443 |
||
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
444 |
forExistingClass:aClass |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
445 |
"build a changeSet for some given class. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
446 |
That does of course not give deltas, but instead reflects the current |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
447 |
state of the given class. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
448 |
It is useful in conjunction with the other utility methods, |
965 | 449 |
for example, when building patchLists, diffSets etc." |
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
450 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
451 |
|changeSet chunk sawExcla lastTimeStamp s change nameSpace| |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
452 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
453 |
changeSet := self new. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
454 |
nameSpace := Smalltalk. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
455 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
456 |
"/ first, a classDefinition change ... |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
457 |
changeSet addClassDefinitionChangeFor:aClass. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
458 |
"/ are there any class-instVars ? |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
459 |
aClass class instVarNames size > 0 ifTrue:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
460 |
changeSet addInstVarDefinitionChangeFor:aClass class. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
461 |
]. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
462 |
"/ a comment ? |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
463 |
aClass comment size > 0 ifTrue:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
464 |
changeSet addClassCommentChangeFor:aClass. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
465 |
]. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
466 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
467 |
"/ class methods first ... |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
468 |
aClass class methodDictionary keysAndValuesDo:[:sel :mthd | |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
469 |
changeSet addMethodChange:mthd in:aClass class. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
470 |
]. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
471 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
472 |
"/ instance methods ... |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
473 |
aClass methodDictionary keysAndValuesDo:[:sel :mthd | |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
474 |
changeSet addMethodChange:mthd in:aClass. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
475 |
]. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
476 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
477 |
^ changeSet |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
478 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
479 |
" |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
480 |
ChangeSet forExistingClass:ChangeSet |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
481 |
" |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
482 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
483 |
"Created: / 16.2.1998 / 12:19:34 / cg" |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
484 |
"Modified: / 14.12.1999 / 15:23:16 / cg" |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
485 |
! |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
486 |
|
654 | 487 |
fromStream:aStream |
488 |
"build a changeSet from a stream, containing chunks. |
|
489 |
(i.e. either a classes sourceFile or a change-file). |
|
490 |
Return the changeSet." |
|
491 |
||
1041 | 492 |
^ self fromStream:aStream while:[:thisChange | true] |
493 |
||
494 |
" |
|
495 |
ChangeSet fromStream:('changes' asFilename readStream) |
|
496 |
ChangeSet fromStream:('patches' asFilename readStream) |
|
497 |
ChangeSet fromStream:(Object source asString readStream) |
|
498 |
" |
|
499 |
||
500 |
"Created: / 16.2.1998 / 12:19:34 / cg" |
|
501 |
"Modified: / 14.12.1999 / 15:23:16 / cg" |
|
502 |
! |
|
503 |
||
504 |
fromStream:aStream while:aConditionBlock |
|
505 |
"build a changeSet from a stream, containing chunks. |
|
506 |
(i.e. either a classes sourceFile or a change-file). |
|
507 |
Return the changeSet." |
|
508 |
||
930 | 509 |
|changeSet| |
654 | 510 |
|
511 |
changeSet := self new. |
|
1042
702a30f7c328
chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents:
1041
diff
changeset
|
512 |
self changesFromStream:aStream do:[:aChange :lineNumberOrNil :posOrNil | |
1041 | 513 |
changeSet add:aChange. |
514 |
(aConditionBlock value:aChange) ifFalse:[^ changeSet]. |
|
930 | 515 |
]. |
921
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
516 |
|
654 | 517 |
^ changeSet |
518 |
||
519 |
" |
|
520 |
ChangeSet fromStream:('changes' asFilename readStream) |
|
521 |
ChangeSet fromStream:('patches' asFilename readStream) |
|
522 |
ChangeSet fromStream:(Object source asString readStream) |
|
523 |
" |
|
524 |
||
525 |
"Created: / 16.2.1998 / 12:19:34 / cg" |
|
859 | 526 |
"Modified: / 14.12.1999 / 15:23:16 / cg" |
916 | 527 |
! |
528 |
||
529 |
fromXMLStream:aStream |
|
530 |
"build a changeSet from an XML stream, containing XML definitions. |
|
531 |
Return the changeSet." |
|
532 |
||
533 |
|changeSet builder nameSpace| |
|
534 |
||
1042
702a30f7c328
chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents:
1041
diff
changeset
|
535 |
aStream isNil ifTrue:[^ nil]. |
702a30f7c328
chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents:
1041
diff
changeset
|
536 |
|
916 | 537 |
changeSet := self new. |
538 |
nameSpace := Smalltalk. |
|
539 |
||
965 | 540 |
builder := XML::SourceScannerNodeBuilder new. |
916 | 541 |
builder scanFile:aStream |
542 |
do:[:change | changeSet add: change. ]. |
|
543 |
^ changeSet |
|
544 |
||
545 |
" |
|
546 |
ChangeSet fromXMLStream:('../../goodies/xml-vw/xmlFileInTests/XMLParser.xml' asFilename readStream) |
|
547 |
ChangeSetBrowser |
|
548 |
openOn:(ChangeSet fromXMLStream:('../../goodies/xml-vw/xmlFileInTests/XMLParser.xml' asFilename readStream)) |
|
549 |
" |
|
654 | 550 |
! ! |
551 |
||
883 | 552 |
!ChangeSet class methodsFor:'Compatibility - ST80'! |
625
06f4ed35832b
added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
378
diff
changeset
|
553 |
|
06f4ed35832b
added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
378
diff
changeset
|
554 |
patches |
06f4ed35832b
added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
378
diff
changeset
|
555 |
^ #() |
06f4ed35832b
added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
378
diff
changeset
|
556 |
|
06f4ed35832b
added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
378
diff
changeset
|
557 |
"Created: / 27.10.1997 / 13:52:54 / cg" |
06f4ed35832b
added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
378
diff
changeset
|
558 |
! ! |
06f4ed35832b
added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
378
diff
changeset
|
559 |
|
1083 | 560 |
!ChangeSet class methodsFor:'Compatibility - VW'! |
561 |
||
562 |
component: component definition: anObject change: changeSymbol |
|
563 |
"Include indication that a class/namespace was added or removed |
|
564 |
from a CodeComponent." |
|
565 |
||
566 |
self |
|
567 |
changed:#'component:definition:change:' |
|
568 |
with: |
|
569 |
( Array |
|
570 |
with: component |
|
571 |
with: anObject |
|
572 |
with: changeSymbol |
|
573 |
) |
|
574 |
||
575 |
! ! |
|
576 |
||
625
06f4ed35832b
added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
378
diff
changeset
|
577 |
!ChangeSet class methodsFor:'queries'! |
27 | 578 |
|
579 |
current |
|
580 |
"ST-80 compatibility: return the current changeSet" |
|
581 |
||
582 |
|p| |
|
583 |
||
584 |
(Project notNil and:[(p := Project current) notNil]) ifTrue:[ |
|
959
ca4fff926135
ChangeSet current: return empty collection if there is no changeSet
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
585 |
^ p changeSet |
ca4fff926135
ChangeSet current: return empty collection if there is no changeSet
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
586 |
]. |
ca4fff926135
ChangeSet current: return empty collection if there is no changeSet
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
587 |
^ #() |
27 | 588 |
|
589 |
" |
|
590 |
ChangeSet current |
|
591 |
" |
|
592 |
! ! |
|
593 |
||
899 | 594 |
!ChangeSet methodsFor:'Compatibility - ST80'! |
378 | 595 |
|
899 | 596 |
changeClass:aClass |
597 |
"dummy here" |
|
100 | 598 |
|
899 | 599 |
"Created: / 4.2.2000 / 18:30:59 / cg" |
901 | 600 |
! |
601 |
||
1096 | 602 |
component:component definition:anObject change:changeSymbol |
1083 | 603 |
"Include indication that a class/namespace was added or removed |
604 |
from a CodeComponent." |
|
605 |
||
606 |
self |
|
607 |
changed:#'component:definition:change:' |
|
608 |
with: |
|
609 |
( Array |
|
610 |
with: component |
|
611 |
with: anObject |
|
612 |
with: changeSymbol |
|
613 |
) |
|
614 |
! |
|
615 |
||
901 | 616 |
reorganizeSystem |
617 |
"dummy here" |
|
618 |
||
619 |
"Created: / 6.2.2000 / 20:45:10 / cg" |
|
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
620 |
! ! |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
621 |
|
985 | 622 |
!ChangeSet methodsFor:'change & update'! |
623 |
||
1096 | 624 |
changed:anAspectSymbol with:aParameter |
625 |
"Allow objects to depend on the ChangeSet class instead of a particular instance |
|
626 |
of ChangeSet (which may be switched using projects)." |
|
985 | 627 |
|
1096 | 628 |
ChangeSet changed:anAspectSymbol with:aParameter. |
629 |
super changed:anAspectSymbol with:aParameter |
|
985 | 630 |
! ! |
631 |
||
901 | 632 |
!ChangeSet methodsFor:'changes management'! |
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
633 |
|
1097 | 634 |
add:aChange |
635 |
super add:aChange. |
|
636 |
self changed:#addChange with:aChange. |
|
637 |
! |
|
638 |
||
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
639 |
addClassCommentChangeFor:aClass |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
640 |
"add a classComment change to the receiver" |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
641 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
642 |
|newChange| |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
643 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
644 |
newChange := ClassCommentChange class:aClass. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
645 |
newChange comment:aClass comment. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
646 |
self add:newChange |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
647 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
648 |
"Modified: 15.7.1996 / 09:27:05 / cg" |
100 | 649 |
! |
650 |
||
651 |
addClassDefinitionChangeFor:aClass |
|
378 | 652 |
"add a classDefinition change to the receiver" |
653 |
||
100 | 654 |
|newChange| |
655 |
||
1096 | 656 |
newChange := ClassDefinitionChange class:aClass source:(aClass definition). |
657 |
self add:newChange |
|
658 |
||
659 |
"Modified: 15.7.1996 / 09:27:05 / cg" |
|
660 |
! |
|
661 |
||
662 |
addClassRemoveChange:oldClassName |
|
663 |
"add a classRemove change to the receiver" |
|
664 |
||
665 |
|newChange| |
|
666 |
||
667 |
newChange := ClassRemoveChange new className:oldClassName. |
|
668 |
self add:newChange |
|
669 |
! |
|
670 |
||
671 |
addClassRenameChangeFrom:oldName to:newName |
|
672 |
"add a classRename change to the receiver" |
|
673 |
||
674 |
|newChange| |
|
675 |
||
676 |
newChange := ClassRenameChange new oldName:oldName newName:newName. |
|
677 |
self add:newChange |
|
100 | 678 |
|
378 | 679 |
"Modified: 15.7.1996 / 09:27:05 / cg" |
100 | 680 |
! |
681 |
||
1081 | 682 |
addDoIt:aString |
683 |
"add a doIt to the receiver" |
|
684 |
||
685 |
|newChange| |
|
686 |
||
1096 | 687 |
newChange := DoItChange new source:aString. |
688 |
self add:newChange. |
|
1081 | 689 |
! |
690 |
||
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
691 |
addInstVarDefinitionChangeFor:aClass |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
692 |
"add an instVarDefinition change to the receiver" |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
693 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
694 |
|newChange| |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
695 |
|
1096 | 696 |
newChange := ClassInstVarDefinitionChange |
697 |
class:aClass |
|
698 |
source:(aClass name , ' instanceVariableNames:' , aClass instanceVariableString storeString). |
|
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
699 |
self add:newChange |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
700 |
! |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
701 |
|
16 | 702 |
addMethodCategoryChange:aMethod category:newCategory in:aClass |
378 | 703 |
"add a methodCategory change to the receiver" |
704 |
||
16 | 705 |
|newChange| |
706 |
||
1096 | 707 |
newChange := MethodCategoryChange |
708 |
class:aClass |
|
709 |
selector:(aClass selectorAtMethod:aMethod) |
|
710 |
category:newCategory. |
|
16 | 711 |
self add:newChange |
712 |
||
378 | 713 |
"Modified: 15.7.1996 / 09:27:15 / cg" |
44 | 714 |
! |
715 |
||
956
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
716 |
addMethodChange:aMethod fromOld:oldMethod in:aClass |
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
717 |
"add a method change to the receiver" |
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
718 |
|
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
719 |
|newChange| |
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
720 |
|
1096 | 721 |
newChange := MethodChange |
722 |
class:aClass |
|
723 |
selector:aMethod selector |
|
724 |
source:aMethod source |
|
725 |
category:aMethod category. |
|
956
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
726 |
oldMethod notNil ifTrue:[ |
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
727 |
newChange previousVersion:oldMethod source. |
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
728 |
]. |
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
729 |
self add:newChange. |
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
730 |
|
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
731 |
"Modified: 15.7.1996 / 09:27:21 / cg" |
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
732 |
! |
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
733 |
|
85 | 734 |
addMethodChange:aMethod in:aClass |
378 | 735 |
"add a method change to the receiver" |
736 |
||
85 | 737 |
|newChange| |
738 |
||
1096 | 739 |
newChange := MethodChange |
740 |
class:aClass |
|
741 |
selector:aMethod selector |
|
742 |
source:aMethod source |
|
743 |
category:aMethod category. |
|
85 | 744 |
self add:newChange |
378 | 745 |
|
746 |
"Modified: 15.7.1996 / 09:27:21 / cg" |
|
85 | 747 |
! |
748 |
||
44 | 749 |
addMethodPrivacyChange:aMethod in:aClass |
378 | 750 |
"add a methodPrivacy change to the receiver" |
751 |
||
44 | 752 |
|newChange| |
753 |
||
1096 | 754 |
newChange := MethodPrivacyChange |
755 |
class:aClass |
|
756 |
selector:(aClass selectorAtMethod:aMethod) |
|
757 |
privacy:aMethod privacy. |
|
44 | 758 |
self add:newChange |
759 |
||
760 |
"Modified: 27.8.1995 / 22:55:22 / claus" |
|
378 | 761 |
"Modified: 15.7.1996 / 09:27:28 / cg" |
235 | 762 |
! |
763 |
||
764 |
addPrimitiveDefinitionsChangeFor:aClass |
|
378 | 765 |
"add a primitiveDefinitions change to the receiver" |
766 |
||
235 | 767 |
|newChange| |
768 |
||
783 | 769 |
newChange := ClassPrimitiveDefinitionsChange new |
1096 | 770 |
class:aClass name source:(aClass primitiveDefinitionsString). |
235 | 771 |
self add:newChange |
378 | 772 |
|
773 |
"Modified: 15.7.1996 / 09:27:40 / cg" |
|
235 | 774 |
! |
775 |
||
776 |
addPrimitiveFunctionsChangeFor:aClass |
|
378 | 777 |
"add a primitiveFunctions change to the receiver" |
778 |
||
235 | 779 |
|newChange| |
780 |
||
783 | 781 |
newChange := ClassPrimitiveFunctionsChange new |
1096 | 782 |
class:aClass name source:(aClass primitiveFunctionsString). |
235 | 783 |
self add:newChange |
378 | 784 |
|
785 |
"Modified: 15.7.1996 / 09:27:47 / cg" |
|
235 | 786 |
! |
787 |
||
788 |
addPrimitiveVariablesChangeFor:aClass |
|
378 | 789 |
"add a primitiveVariables change to the receiver" |
790 |
||
235 | 791 |
|newChange| |
792 |
||
783 | 793 |
newChange := ClassPrimitiveVariablesChange new |
1096 | 794 |
class:aClass name source:(aClass primitiveVariablesString). |
235 | 795 |
self add:newChange |
378 | 796 |
|
797 |
"Modified: 15.7.1996 / 09:27:55 / cg" |
|
654 | 798 |
! |
799 |
||
800 |
addRemoveSelectorChange:aSelector in:aClass |
|
801 |
"add a method-remove change to the receiver" |
|
802 |
||
803 |
|newChange| |
|
804 |
||
1081 | 805 |
newChange := MethodRemoveChange class:aClass selector:aSelector. |
654 | 806 |
self add:newChange |
807 |
||
808 |
"Modified: / 27.8.1995 / 22:55:22 / claus" |
|
809 |
"Modified: / 15.7.1996 / 09:27:28 / cg" |
|
810 |
"Created: / 16.2.1998 / 12:47:07 / cg" |
|
901 | 811 |
! |
812 |
||
813 |
addRenameCategoryChangeIn:aClass from:oldCategory to:newCategory |
|
814 |
"add a category rename change to the receiver" |
|
815 |
||
816 |
|newChange| |
|
817 |
||
818 |
newChange := MethodCategoryRenameChange class:aClass. |
|
819 |
newChange oldCategoryName:oldCategory newCategoryName:newCategory. |
|
820 |
self add:newChange |
|
821 |
||
822 |
"Modified: / 6.2.2000 / 02:30:30 / cg" |
|
0 | 823 |
! ! |
824 |
||
85 | 825 |
!ChangeSet methodsFor:'misc'! |
826 |
||
827 |
addPatch:nameOfPatch |
|
828 |
"ignored for now - allows fileIn of ST-80 patch stuff .." |
|
829 |
||
830 |
^ self |
|
831 |
! ! |
|
832 |
||
1034
cdc9ddc19155
added query for a class being in a changeSet
Claus Gittinger <cg@exept.de>
parents:
985
diff
changeset
|
833 |
!ChangeSet methodsFor:'queries'! |
cdc9ddc19155
added query for a class being in a changeSet
Claus Gittinger <cg@exept.de>
parents:
985
diff
changeset
|
834 |
|
cdc9ddc19155
added query for a class being in a changeSet
Claus Gittinger <cg@exept.de>
parents:
985
diff
changeset
|
835 |
includesChangeForClass:aClass |
1096 | 836 |
|nameOfClass| |
1085 | 837 |
|
838 |
nameOfClass := aClass theNonMetaclass name. |
|
839 |
||
1096 | 840 |
^ self contains:[:aChange | |
841 |
aChange className = nameOfClass |
|
1085 | 842 |
] |
843 |
||
844 |
" |
|
845 |
ChangeSet current includesChangeForClass:ChangeSet |
|
1096 | 846 |
ChangeSet current includesChangeForClass:ChangeSet class |
1085 | 847 |
" |
848 |
||
849 |
"Modified: / 31.10.2001 / 10:58:40 / cg" |
|
850 |
! |
|
851 |
||
852 |
includesChangeForClass:aClass selector:selector |
|
1096 | 853 |
|nameOfClass| |
1085 | 854 |
|
1096 | 855 |
nameOfClass := aClass name. |
1085 | 856 |
|
1096 | 857 |
^ self contains:[:aChange | |
858 |
aChange selector = selector |
|
859 |
ifFalse:[ |
|
860 |
false |
|
861 |
] ifTrue:[ |
|
862 |
aChange className = nameOfClass |
|
863 |
] |
|
1085 | 864 |
] |
865 |
||
866 |
" |
|
867 |
ChangeSet current includesChangeForClass:ChangeSet selector:#includesChangeForClass: |
|
868 |
" |
|
869 |
||
870 |
"Created: / 31.10.2001 / 10:26:31 / cg" |
|
871 |
"Modified: / 31.10.2001 / 10:59:49 / cg" |
|
1096 | 872 |
! |
873 |
||
874 |
includesChangeForClassOrMetaclass:aClass |
|
875 |
|nameOfClass nameOfMetaclass| |
|
876 |
||
877 |
nameOfClass := aClass theNonMetaclass name. |
|
878 |
nameOfMetaclass := aClass theMetaclass name. |
|
879 |
||
880 |
^ self contains:[:aChange | |
|
881 |
|changeClassName| |
|
882 |
||
883 |
changeClassName := aChange className. |
|
884 |
changeClassName = nameOfClass or:[changeClassName = nameOfMetaclass] |
|
885 |
] |
|
1034
cdc9ddc19155
added query for a class being in a changeSet
Claus Gittinger <cg@exept.de>
parents:
985
diff
changeset
|
886 |
! ! |
cdc9ddc19155
added query for a class being in a changeSet
Claus Gittinger <cg@exept.de>
parents:
985
diff
changeset
|
887 |
|
857 | 888 |
!ChangeSet methodsFor:'utilities'! |
889 |
||
878 | 890 |
apply |
891 |
"apply all changes in the receivers changeSet" |
|
892 |
||
893 |
self do:[:aChange | |
|
879 | 894 |
aChange apply |
878 | 895 |
] |
896 |
! |
|
897 |
||
1096 | 898 |
condenseChangesForClass:aClass |
899 |
"remove all changes for aClass |
|
900 |
(i.e. leave changes for other classes)." |
|
901 |
||
902 |
self condenseChangesForClass:aClass package:nil |
|
903 |
! |
|
904 |
||
878 | 905 |
condenseChangesForClass:aClass package:aPackageSymbol |
906 |
"remove all changes for aClass and aPackageSymbol |
|
1087
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
907 |
(i.e. leave methodChanges for other packages). |
956
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
908 |
This is invoked when a class is checked into the repository." |
878 | 909 |
|
945
f9e349d38d49
care for metaclasses when condensing changeSet
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
910 |
|changesToRemove className metaClassName chgCls| |
878 | 911 |
|
912 |
changesToRemove := OrderedCollection new. |
|
945
f9e349d38d49
care for metaclasses when condensing changeSet
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
913 |
className := aClass theNonMetaclass name. |
f9e349d38d49
care for metaclasses when condensing changeSet
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
914 |
metaClassName := aClass theMetaclass name. |
1087
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
915 |
self do:[:aChange | |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
916 |
|chgClassName chgClass removeThis mClass mthd| |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
917 |
|
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
918 |
removeThis := false. |
945
f9e349d38d49
care for metaclasses when condensing changeSet
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
919 |
chgClassName := aChange className. |
f9e349d38d49
care for metaclasses when condensing changeSet
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
920 |
(chgClassName = className |
f9e349d38d49
care for metaclasses when condensing changeSet
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
921 |
or:[chgClassName = metaClassName]) ifTrue:[ |
1087
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
922 |
removeThis := true. |
944
f4cb7e9b034b
when condensing, also care for private classes
Claus Gittinger <cg@exept.de>
parents:
939
diff
changeset
|
923 |
] ifFalse:[ |
f4cb7e9b034b
when condensing, also care for private classes
Claus Gittinger <cg@exept.de>
parents:
939
diff
changeset
|
924 |
chgCls := aChange changeClass. |
f4cb7e9b034b
when condensing, also care for private classes
Claus Gittinger <cg@exept.de>
parents:
939
diff
changeset
|
925 |
(chgCls notNil |
f4cb7e9b034b
when condensing, also care for private classes
Claus Gittinger <cg@exept.de>
parents:
939
diff
changeset
|
926 |
and:[chgCls isPrivate |
f4cb7e9b034b
when condensing, also care for private classes
Claus Gittinger <cg@exept.de>
parents:
939
diff
changeset
|
927 |
and:[chgCls owningClass == aClass]]) ifTrue:[ |
1087
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
928 |
removeThis := true |
944
f4cb7e9b034b
when condensing, also care for private classes
Claus Gittinger <cg@exept.de>
parents:
939
diff
changeset
|
929 |
] |
1087
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
930 |
]. |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
931 |
removeThis ifTrue:[ |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
932 |
aChange isMethodChange ifTrue:[ |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
933 |
mClass := aChange changeClass. |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
934 |
mClass notNil ifTrue:[ |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
935 |
mthd := mClass compiledMethodAt:(aChange selector). |
1096 | 936 |
mthd isNil ifTrue:[ |
937 |
"/ mthd does no longer exist |
|
938 |
aPackageSymbol notNil ifTrue:[ |
|
939 |
removeThis := false |
|
940 |
] |
|
941 |
] ifFalse:[ |
|
942 |
(aPackageSymbol notNil and:[mthd package ~= aPackageSymbol]) ifTrue:[ |
|
943 |
removeThis := false |
|
944 |
] |
|
1087
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
945 |
] |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
946 |
] |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
947 |
]. |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
948 |
]. |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
949 |
removeThis ifTrue:[ |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
950 |
changesToRemove add:aChange |
887
3cfdf7d2ba89
oops - must care for unloaded/nonExistent/removed/renamed classes
Claus Gittinger <cg@exept.de>
parents:
883
diff
changeset
|
951 |
] |
878 | 952 |
]. |
953 |
self removeAll:changesToRemove |
|
1087
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
954 |
|
1088
6575d464d900
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1087
diff
changeset
|
955 |
"Modified: / 5.11.2001 / 14:29:22 / cg" |
1087
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
956 |
! |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
957 |
|
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
958 |
condenseChangesForExtensionsInPackage:aPackageSymbol |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
959 |
"remove all changes for aClass and aPackageSymbol |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
960 |
(i.e. leave methodChanges for other packages). |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
961 |
This is invoked when a class is checked into the repository." |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
962 |
|
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
963 |
|changesToRemove| |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
964 |
|
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
965 |
changesToRemove := OrderedCollection new. |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
966 |
|
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
967 |
self do:[:aChange | |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
968 |
|removeThis mClass mthd| |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
969 |
|
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
970 |
aChange isMethodChange ifTrue:[ |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
971 |
removeThis := false. |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
972 |
mClass := aChange changeClass. |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
973 |
mClass notNil ifTrue:[ |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
974 |
mthd := mClass compiledMethodAt:(aChange selector). |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
975 |
mthd package ~= aPackageSymbol ifTrue:[ |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
976 |
removeThis := false |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
977 |
] |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
978 |
]. |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
979 |
removeThis ifTrue:[ |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
980 |
changesToRemove add:aChange |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
981 |
] |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
982 |
]. |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
983 |
]. |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
984 |
self removeAll:changesToRemove |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
985 |
|
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
986 |
"Modified: / 5.11.2001 / 14:11:45 / cg" |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
987 |
"Created: / 5.11.2001 / 14:21:17 / cg" |
878 | 988 |
! |
989 |
||
857 | 990 |
diffSetsAgainst:anotherChangeSet |
991 |
"walk over the receiver and anotherChangeSet, |
|
992 |
add all changes to one of the tree lists: |
|
946 | 993 |
onlyInReceiver, onlyInArg or changed, |
994 |
each being a changeSet containing corresponding changes. |
|
995 |
WARNING: destructive; could modify both the receiver and the argument" |
|
857 | 996 |
|
997 |
|onlyInReceiver onlyInArg changedMethods |
|
998 |
indexFromChangedMethodsToA indexFromChangedMethodsToB |
|
864 | 999 |
"info" ret| |
857 | 1000 |
|
1001 |
onlyInReceiver := ChangeSet new. |
|
1002 |
onlyInArg := ChangeSet new. |
|
1003 |
changedMethods := ChangeSet new. |
|
1004 |
||
1005 |
indexFromChangedMethodsToA := OrderedCollection new. |
|
1006 |
indexFromChangedMethodsToB := OrderedCollection new. |
|
1007 |
||
1008 |
self keysAndValuesDo:[:idxA :aChangeInA | |
|
946 | 1009 |
|anyFound ch| |
857 | 1010 |
|
946 | 1011 |
anyFound := false. |
857 | 1012 |
|
946 | 1013 |
anotherChangeSet keysAndValuesDo:[:idxB :aChangeInB | |
1014 |
(aChangeInA isForSameAs:aChangeInB) ifTrue:[ |
|
1015 |
anyFound := true. |
|
857 | 1016 |
|
946 | 1017 |
"/ also in B - is it different ? |
1018 |
(aChangeInA sameAs:aChangeInB) ifFalse:[ |
|
1019 |
changedMethods add:aChangeInA. |
|
1020 |
indexFromChangedMethodsToA add:idxA. |
|
1021 |
indexFromChangedMethodsToB add:idxB. |
|
1022 |
] ifTrue:[ |
|
1023 |
aChangeInA isMethodChange ifTrue:[ |
|
1024 |
aChangeInA methodCategory ~= aChangeInB methodCategory ifTrue:[ |
|
1025 |
"/ only the category is different; |
|
1026 |
"/ make it a MethodCategory changes. |
|
857 | 1027 |
|
946 | 1028 |
ch := MethodCategoryChange new |
1029 |
className:aChangeInA className |
|
1030 |
selector:aChangeInA selector |
|
1031 |
category:aChangeInA methodCategory. |
|
1032 |
self at:idxA put:ch. |
|
857 | 1033 |
|
946 | 1034 |
ch := MethodCategoryChange new |
1035 |
className:aChangeInB className |
|
1036 |
selector:aChangeInB selector |
|
1037 |
category:aChangeInB methodCategory. |
|
1038 |
anotherChangeSet at:idxB put:ch. |
|
857 | 1039 |
|
946 | 1040 |
changedMethods add:aChangeInA. |
1041 |
indexFromChangedMethodsToA add:idxA. |
|
1042 |
indexFromChangedMethodsToB add:idxB. |
|
1043 |
] |
|
1044 |
]. |
|
1045 |
] |
|
1046 |
] ifFalse:[ |
|
1047 |
(aChangeInA sameAs:aChangeInB) ifTrue:[ |
|
1048 |
anyFound := true. |
|
1049 |
] ifFalse:[ |
|
1050 |
] |
|
1051 |
] |
|
1052 |
]. |
|
857 | 1053 |
|
946 | 1054 |
anyFound ifFalse:[ |
1055 |
onlyInReceiver add:aChangeInA. |
|
1056 |
] |
|
857 | 1057 |
]. |
1058 |
||
1059 |
anotherChangeSet keysAndValuesDo:[:idxB :aChangeInB | |
|
946 | 1060 |
|anyFound| |
857 | 1061 |
|
946 | 1062 |
anyFound := false. |
857 | 1063 |
|
946 | 1064 |
self do:[:aChangeInA | |
1065 |
|idxM| |
|
857 | 1066 |
|
946 | 1067 |
(aChangeInA isForSameAs:aChangeInB) ifTrue:[ |
1068 |
anyFound := true. |
|
857 | 1069 |
|
946 | 1070 |
"/ also in B - is it different ? |
1071 |
(aChangeInA sameAs:aChangeInB) ifFalse:[ |
|
1072 |
"/ already there ? |
|
1073 |
idxM := changedMethods findFirst:[:c | c isForSameAs:aChangeInB]. |
|
1074 |
idxM == 0 ifTrue:[ |
|
1075 |
changedMethods add:aChangeInB. |
|
1076 |
indexFromChangedMethodsToB add:idxB. |
|
1077 |
] ifFalse:[ |
|
1078 |
indexFromChangedMethodsToB at:idxM put:idxB |
|
1079 |
] |
|
1080 |
] |
|
1081 |
] ifFalse:[ |
|
1082 |
(aChangeInA sameAs:aChangeInB) ifTrue:[ |
|
1083 |
anyFound := true. |
|
1084 |
] ifFalse:[ |
|
1085 |
] |
|
1086 |
] |
|
1087 |
]. |
|
1088 |
anyFound ifFalse:[ |
|
1089 |
onlyInArg add:aChangeInB. |
|
1090 |
] |
|
857 | 1091 |
]. |
1092 |
||
864 | 1093 |
"/ info := OrderedCollection new:(changedMethods size). |
1094 |
"/ changedMethods keysAndValuesDo:[:idx :changedMethod | |
|
1095 |
"/ info add:(Array |
|
1096 |
"/ with:(indexFromChangedMethodsToA at:idx) |
|
1097 |
"/ with:(indexFromChangedMethodsToB at:idx) |
|
1098 |
"/ ) |
|
1099 |
"/ ]. |
|
857 | 1100 |
changedMethods := (1 to:changedMethods size) collect:[:idx | |
946 | 1101 |
|cA cB| |
857 | 1102 |
|
946 | 1103 |
cA := self at:(indexFromChangedMethodsToA at:idx). |
1104 |
cB := anotherChangeSet at:(indexFromChangedMethodsToB at:idx). |
|
1105 |
Array with:cA with:cB |
|
1106 |
]. |
|
857 | 1107 |
|
1108 |
ret := IdentityDictionary new. |
|
864 | 1109 |
"/ ret at:#info put:info. |
857 | 1110 |
ret at:#changed put:changedMethods. |
1111 |
ret at:#onlyInReceiver put:onlyInReceiver. |
|
1112 |
ret at:#onlyInArg put:onlyInArg. |
|
864 | 1113 |
^ret |
857 | 1114 |
! ! |
1115 |
||
625
06f4ed35832b
added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
378
diff
changeset
|
1116 |
!ChangeSet class methodsFor:'documentation'! |
100 | 1117 |
|
1118 |
version |
|
1097 | 1119 |
^ '$Header: /cvs/stx/stx/libbasic3/ChangeSet.st,v 1.67 2001-11-08 18:32:34 cg Exp $' |
100 | 1120 |
! ! |