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