author | Claus Gittinger <cg@exept.de> |
Wed, 12 Apr 2000 23:40:29 +0200 | |
changeset 924 | 41c0748bff4e |
parent 921 | fa4db05c887b |
child 930 | ca4ce60fea8b |
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 |
||
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
49 |
forExistingClass:aClass |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
50 |
"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
|
51 |
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
|
52 |
state of the given class. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
53 |
It is useful in conjunction with the other utility methods, |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
54 |
for example, when building patchLists etc." |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
55 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
56 |
|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
|
57 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
58 |
changeSet := self new. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
59 |
nameSpace := Smalltalk. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
60 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
61 |
"/ first, a classDefinition change ... |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
62 |
changeSet addClassDefinitionChangeFor:aClass. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
63 |
"/ are there any class-instVars ? |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
64 |
aClass class instVarNames size > 0 ifTrue:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
65 |
changeSet addInstVarDefinitionChangeFor:aClass class. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
66 |
]. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
67 |
"/ a comment ? |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
68 |
aClass comment size > 0 ifTrue:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
69 |
changeSet addClassCommentChangeFor:aClass. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
70 |
]. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
71 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
72 |
"/ class methods first ... |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
73 |
aClass class methodDictionary keysAndValuesDo:[:sel :mthd | |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
74 |
changeSet addMethodChange:mthd in:aClass class. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
75 |
]. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
76 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
77 |
"/ instance methods ... |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
78 |
aClass methodDictionary keysAndValuesDo:[:sel :mthd | |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
79 |
changeSet addMethodChange:mthd in:aClass. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
80 |
]. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
81 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
82 |
^ changeSet |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
83 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
84 |
" |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
85 |
ChangeSet forExistingClass:ChangeSet |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
86 |
" |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
87 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
88 |
"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
|
89 |
"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
|
90 |
! |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
91 |
|
654 | 92 |
fromStream:aStream |
93 |
"build a changeSet from a stream, containing chunks. |
|
94 |
(i.e. either a classes sourceFile or a change-file). |
|
95 |
Return the changeSet." |
|
96 |
||
859 | 97 |
|changeSet chunk sawExcla lastTimeStamp s change nameSpace| |
654 | 98 |
|
99 |
changeSet := self new. |
|
859 | 100 |
nameSpace := Smalltalk. |
654 | 101 |
|
102 |
[aStream atEnd] whileFalse:[ |
|
894 | 103 |
aStream skipSeparators. |
104 |
sawExcla := aStream peekFor:$!!. |
|
105 |
chunk := aStream nextChunk. |
|
106 |
(chunk notNil and:[chunk notEmpty]) ifTrue:[ |
|
107 |
Class nameSpaceQuerySignal answer:nameSpace do:[ |
|
921
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
108 |
|parser tree ns| |
859 | 109 |
|
894 | 110 |
parser := Parser for:chunk. |
111 |
tree := parser |
|
112 |
parseExpressionWithSelf:nil |
|
113 |
notifying:nil |
|
114 |
ignoreErrors:true |
|
115 |
ignoreWarnings:true |
|
116 |
inNameSpace:nameSpace. |
|
921
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
117 |
|
894 | 118 |
tree == #Error ifTrue:[ |
119 |
change := DoItChange new. |
|
120 |
change source:chunk. |
|
121 |
changeSet add: change. |
|
122 |
] ifFalse:[ |
|
123 |
(tree notNil and:[tree ~~ #Error]) ifTrue:[ |
|
921
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
124 |
"/ if there is any nameSpace directive in there, extract it. |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
125 |
((ns := parser currentNameSpace) notNil |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
126 |
and:[ns ~~ nameSpace]) ifTrue:[ |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
127 |
"/ self halt. |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
128 |
nameSpace := ns |
894 | 129 |
]. |
130 |
Class nameSpaceQuerySignal answer:nameSpace do:[ |
|
131 |
"/ |
|
132 |
"/ what type of chunk is this ... |
|
133 |
"/ |
|
134 |
tree isConstant ifTrue:[ |
|
135 |
(s := tree evaluate) isString ifTrue:[ |
|
136 |
(s startsWith:'---- timestamp ') ifTrue:[ |
|
137 |
lastTimeStamp := s. |
|
138 |
] |
|
139 |
] ifFalse:[ |
|
140 |
self halt:'unexpected change-chunk' |
|
141 |
] |
|
142 |
] ifFalse:[ |
|
143 |
tree isMessage ifTrue:[ |
|
144 |
(changeSet addFromParseTree:tree andStream:aStream) ifFalse:[ |
|
145 |
change := DoItChange new. |
|
146 |
change source:chunk. |
|
147 |
changeSet add: change. |
|
148 |
] |
|
149 |
] ifFalse:[ |
|
150 |
self halt:'unexpected change-chunk' |
|
151 |
] |
|
152 |
] |
|
153 |
] |
|
154 |
] |
|
155 |
] |
|
156 |
] |
|
157 |
] |
|
654 | 158 |
]. |
159 |
^ changeSet |
|
160 |
||
161 |
" |
|
162 |
ChangeSet fromStream:('changes' asFilename readStream) |
|
163 |
ChangeSet fromStream:('patches' asFilename readStream) |
|
164 |
ChangeSet fromStream:(Object source asString readStream) |
|
165 |
" |
|
166 |
||
167 |
"Created: / 16.2.1998 / 12:19:34 / cg" |
|
859 | 168 |
"Modified: / 14.12.1999 / 15:23:16 / cg" |
916 | 169 |
! |
170 |
||
171 |
fromXMLStream:aStream |
|
172 |
"build a changeSet from an XML stream, containing XML definitions. |
|
173 |
Return the changeSet." |
|
174 |
||
175 |
|changeSet builder nameSpace| |
|
176 |
||
177 |
changeSet := self new. |
|
178 |
nameSpace := Smalltalk. |
|
179 |
||
180 |
builder := XML.SourceScannerNodeBuilder new. |
|
181 |
builder scanFile:aStream |
|
182 |
do:[:change | changeSet add: change. ]. |
|
183 |
^ changeSet |
|
184 |
||
185 |
" |
|
186 |
ChangeSet fromXMLStream:('../../goodies/xml-vw/xmlFileInTests/XMLParser.xml' asFilename readStream) |
|
187 |
ChangeSetBrowser |
|
188 |
openOn:(ChangeSet fromXMLStream:('../../goodies/xml-vw/xmlFileInTests/XMLParser.xml' asFilename readStream)) |
|
189 |
" |
|
190 |
||
654 | 191 |
! ! |
192 |
||
883 | 193 |
!ChangeSet class methodsFor:'Compatibility - ST80'! |
625
06f4ed35832b
added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
378
diff
changeset
|
194 |
|
06f4ed35832b
added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
378
diff
changeset
|
195 |
patches |
06f4ed35832b
added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
378
diff
changeset
|
196 |
^ #() |
06f4ed35832b
added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
378
diff
changeset
|
197 |
|
06f4ed35832b
added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
378
diff
changeset
|
198 |
"Created: / 27.10.1997 / 13:52:54 / cg" |
06f4ed35832b
added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
378
diff
changeset
|
199 |
! ! |
06f4ed35832b
added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
378
diff
changeset
|
200 |
|
06f4ed35832b
added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
378
diff
changeset
|
201 |
!ChangeSet class methodsFor:'queries'! |
27 | 202 |
|
203 |
current |
|
204 |
"ST-80 compatibility: return the current changeSet" |
|
205 |
||
206 |
|p| |
|
207 |
||
208 |
(Project notNil and:[(p := Project current) notNil]) ifTrue:[ |
|
209 |
^ p changeSet |
|
210 |
] |
|
211 |
||
212 |
" |
|
213 |
ChangeSet current |
|
214 |
" |
|
215 |
! ! |
|
216 |
||
899 | 217 |
!ChangeSet methodsFor:'Compatibility - ST80'! |
378 | 218 |
|
899 | 219 |
changeClass:aClass |
220 |
"dummy here" |
|
100 | 221 |
|
899 | 222 |
"Created: / 4.2.2000 / 18:30:59 / cg" |
901 | 223 |
! |
224 |
||
225 |
reorganizeSystem |
|
226 |
"dummy here" |
|
227 |
||
228 |
"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
|
229 |
! ! |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
230 |
|
901 | 231 |
!ChangeSet methodsFor:'changes management'! |
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
232 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
233 |
addClassCommentChangeFor:aClass |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
234 |
"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
|
235 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
236 |
|newChange| |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
237 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
238 |
newChange := ClassCommentChange class:aClass. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
239 |
newChange comment:aClass comment. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
240 |
self add:newChange |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
241 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
242 |
"Modified: 15.7.1996 / 09:27:05 / cg" |
100 | 243 |
! |
244 |
||
245 |
addClassDefinitionChangeFor:aClass |
|
378 | 246 |
"add a classDefinition change to the receiver" |
247 |
||
100 | 248 |
|newChange| |
249 |
||
250 |
newChange := ClassDefinitionChange class:aClass. |
|
787 | 251 |
newChange source:aClass definition. |
100 | 252 |
self add:newChange |
253 |
||
378 | 254 |
"Modified: 15.7.1996 / 09:27:05 / cg" |
100 | 255 |
! |
256 |
||
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
257 |
addInstVarDefinitionChangeFor:aClass |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
258 |
"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
|
259 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
260 |
|newChange| |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
261 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
262 |
newChange := ClassInstVarDefinitionChange class:aClass. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
263 |
newChange source:(aClass name , ' instanceVariableNames:' , aClass instanceVariableString storeString). |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
264 |
self add:newChange |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
265 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
266 |
! |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
267 |
|
16 | 268 |
addMethodCategoryChange:aMethod category:newCategory in:aClass |
378 | 269 |
"add a methodCategory change to the receiver" |
270 |
||
16 | 271 |
|newChange| |
272 |
||
273 |
newChange := MethodCategoryChange class:aClass |
|
879 | 274 |
selector:(aClass selectorAtMethod:aMethod) |
275 |
category:newCategory. |
|
16 | 276 |
self add:newChange |
277 |
||
378 | 278 |
"Modified: 15.7.1996 / 09:27:15 / cg" |
44 | 279 |
! |
280 |
||
85 | 281 |
addMethodChange:aMethod in:aClass |
378 | 282 |
"add a method change to the receiver" |
283 |
||
85 | 284 |
|newChange| |
285 |
||
286 |
newChange := MethodChange class:aClass |
|
879 | 287 |
selector:(aClass selectorAtMethod:aMethod) |
288 |
source:aMethod source |
|
289 |
category:aMethod category. |
|
85 | 290 |
self add:newChange |
378 | 291 |
|
292 |
"Modified: 15.7.1996 / 09:27:21 / cg" |
|
85 | 293 |
! |
294 |
||
44 | 295 |
addMethodPrivacyChange:aMethod in:aClass |
378 | 296 |
"add a methodPrivacy change to the receiver" |
297 |
||
44 | 298 |
|newChange| |
299 |
||
300 |
newChange := MethodPrivacyChange class:aClass |
|
879 | 301 |
selector:(aClass selectorAtMethod:aMethod) |
302 |
privacy:aMethod privacy. |
|
44 | 303 |
self add:newChange |
304 |
||
305 |
"Modified: 27.8.1995 / 22:55:22 / claus" |
|
378 | 306 |
"Modified: 15.7.1996 / 09:27:28 / cg" |
235 | 307 |
! |
308 |
||
309 |
addPrimitiveDefinitionsChangeFor:aClass |
|
378 | 310 |
"add a primitiveDefinitions change to the receiver" |
311 |
||
235 | 312 |
|newChange| |
313 |
||
783 | 314 |
newChange := ClassPrimitiveDefinitionsChange new |
879 | 315 |
class:aClass name source:aClass primitiveDefinitionsString. |
235 | 316 |
self add:newChange |
378 | 317 |
|
318 |
"Modified: 15.7.1996 / 09:27:40 / cg" |
|
235 | 319 |
! |
320 |
||
321 |
addPrimitiveFunctionsChangeFor:aClass |
|
378 | 322 |
"add a primitiveFunctions change to the receiver" |
323 |
||
235 | 324 |
|newChange| |
325 |
||
783 | 326 |
newChange := ClassPrimitiveFunctionsChange new |
879 | 327 |
class:aClass name source:aClass primitiveFunctionsString. |
235 | 328 |
self add:newChange |
378 | 329 |
|
330 |
"Modified: 15.7.1996 / 09:27:47 / cg" |
|
235 | 331 |
! |
332 |
||
333 |
addPrimitiveVariablesChangeFor:aClass |
|
378 | 334 |
"add a primitiveVariables change to the receiver" |
335 |
||
235 | 336 |
|newChange| |
337 |
||
783 | 338 |
newChange := ClassPrimitiveVariablesChange new |
879 | 339 |
class:aClass name source:aClass primitiveVariablesString. |
235 | 340 |
self add:newChange |
378 | 341 |
|
342 |
"Modified: 15.7.1996 / 09:27:55 / cg" |
|
654 | 343 |
! |
344 |
||
345 |
addRemoveSelectorChange:aSelector in:aClass |
|
346 |
"add a method-remove change to the receiver" |
|
347 |
||
348 |
|newChange| |
|
349 |
||
350 |
newChange := MethodRemoveChange |
|
879 | 351 |
class:aClass |
352 |
selector:aSelector. |
|
654 | 353 |
self add:newChange |
354 |
||
355 |
"Modified: / 27.8.1995 / 22:55:22 / claus" |
|
356 |
"Modified: / 15.7.1996 / 09:27:28 / cg" |
|
357 |
"Created: / 16.2.1998 / 12:47:07 / cg" |
|
901 | 358 |
! |
359 |
||
360 |
addRenameCategoryChangeIn:aClass from:oldCategory to:newCategory |
|
361 |
"add a category rename change to the receiver" |
|
362 |
||
363 |
|newChange| |
|
364 |
||
365 |
newChange := MethodCategoryRenameChange class:aClass. |
|
366 |
newChange oldCategoryName:oldCategory newCategoryName:newCategory. |
|
367 |
self add:newChange |
|
368 |
||
369 |
"Modified: / 6.2.2000 / 02:30:30 / cg" |
|
0 | 370 |
! ! |
371 |
||
85 | 372 |
!ChangeSet methodsFor:'misc'! |
373 |
||
374 |
addPatch:nameOfPatch |
|
375 |
"ignored for now - allows fileIn of ST-80 patch stuff .." |
|
376 |
||
377 |
^ self |
|
378 |
! ! |
|
379 |
||
654 | 380 |
!ChangeSet methodsFor:'private'! |
381 |
||
382 |
addFromParseTree:aTree andStream:aStream |
|
921
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
383 |
"given a parse-tree (from parsing some changes source/chunk), |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
384 |
create a change and add it to the changeSet" |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
385 |
|
654 | 386 |
|sel className categoryName |
387 |
methodSource methodSelector change parser |
|
775 | 388 |
oldName newName priv receiver receiverVarName |
859 | 389 |
receiverSelector receiverReceiver primSource |
390 |
nameSpace| |
|
391 |
||
921
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
392 |
"/ nameSpace := Class nameSpaceQuerySignal query. |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
393 |
"/ nameSpace isNil ifTrue:[nameSpace := Smalltalk]. |
654 | 394 |
|
395 |
sel := aTree selector. |
|
775 | 396 |
receiver := aTree receiver. |
397 |
receiver isMessage ifTrue:[ |
|
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
398 |
receiverSelector := receiver selector. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
399 |
receiverReceiver := receiver receiver. |
775 | 400 |
] ifFalse:[ |
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
401 |
receiver isVariable ifTrue:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
402 |
receiverVarName := receiver name |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
403 |
] |
775 | 404 |
]. |
405 |
||
654 | 406 |
(sel == #'methodsFor:' |
407 |
or:[(sel == #'ignoredMethodsFor:')]) ifTrue:[ |
|
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
408 |
(sel == #'ignoredMethodsFor:') ifTrue:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
409 |
priv := #ignored. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
410 |
] ifFalse:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
411 |
priv := nil |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
412 |
]. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
413 |
(receiver isUnaryMessage |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
414 |
and:[receiverSelector == #class]) ifTrue:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
415 |
className := (receiverReceiver name) , ' class'. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
416 |
] ifFalse:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
417 |
className := (receiver name). |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
418 |
]. |
921
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
419 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
420 |
"/ className := nameSpace name , '::' , className |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
421 |
"/ ]. |
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
422 |
categoryName := (aTree arguments at:1) evaluate. |
654 | 423 |
|
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
424 |
aStream skipSeparators. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
425 |
methodSource := aStream nextChunk. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
426 |
[methodSource notEmpty] whileTrue:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
427 |
parser := Parser |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
428 |
parseMethodArgAndVarSpecification:methodSource |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
429 |
in:nil |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
430 |
ignoreErrors:true |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
431 |
ignoreWarnings:true |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
432 |
parseBody:false. |
654 | 433 |
|
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
434 |
parser isNil ifTrue:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
435 |
"/ something wierd ... |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
436 |
methodSelector := '????'. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
437 |
] ifFalse:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
438 |
methodSelector := parser selector. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
439 |
]. |
654 | 440 |
|
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
441 |
change := MethodChange new. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
442 |
change |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
443 |
className:className |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
444 |
selector:methodSelector |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
445 |
source:methodSource |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
446 |
category:categoryName |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
447 |
privacy:priv. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
448 |
self add: change. |
654 | 449 |
|
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
450 |
aStream skipSeparators. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
451 |
methodSource := aStream nextChunk. |
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 |
^ true |
654 | 454 |
]. |
455 |
||
456 |
sel == #'removeSelector:' ifTrue:[ |
|
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
457 |
(receiver isUnaryMessage |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
458 |
and:[receiverSelector == #class]) ifTrue:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
459 |
className := (receiverReceiver name) , ' class'. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
460 |
] ifFalse:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
461 |
className := (receiver name). |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
462 |
]. |
921
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
463 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
464 |
"/ className := nameSpace name , '::' , className |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
465 |
"/ ]. |
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
466 |
methodSelector := (aTree arguments at:1) evaluate. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
467 |
change := MethodRemoveChange new. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
468 |
change |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
469 |
className:className |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
470 |
selector:methodSelector. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
471 |
self add: change. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
472 |
^ true |
654 | 473 |
]. |
474 |
||
787 | 475 |
"/ any subclass definiton selector ? |
802 | 476 |
(Behavior definitionSelectors includes:sel) |
787 | 477 |
ifTrue:[ |
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
478 |
className := (aTree arguments at:1) evaluate. |
921
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
479 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
480 |
"/ className := nameSpace name , '::' , className |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
481 |
"/ ]. |
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
482 |
change := ClassDefinitionChange new. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
483 |
change |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
484 |
className:className; |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
485 |
source:(aTree printString). |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
486 |
self add: change. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
487 |
^ true |
654 | 488 |
]. |
489 |
||
490 |
sel == #'renameCategory:to:' ifTrue:[ |
|
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
491 |
(receiver isUnaryMessage |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
492 |
and:[receiverSelector == #class]) ifTrue:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
493 |
className := (receiverReceiver name) , ' class'. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
494 |
] ifFalse:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
495 |
className := (receiver name). |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
496 |
]. |
921
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
497 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
498 |
"/ className := nameSpace name , '::' , className |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
499 |
"/ ]. |
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
500 |
change := MethodCategoryRenameChange new. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
501 |
change |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
502 |
className:className; |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
503 |
oldCategoryName:(aTree arguments at:1) evaluate |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
504 |
newCategoryName:(aTree arguments at:2) evaluate. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
505 |
self add: change. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
506 |
^ true |
654 | 507 |
]. |
508 |
||
509 |
(sel == #'category:' |
|
510 |
or:[sel == #'privacy:']) ifTrue:[ |
|
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
511 |
(receiver isMessage |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
512 |
and:[receiverSelector == #'compiledMethodAt:']) ifTrue:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
513 |
(receiverReceiver isUnaryMessage |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
514 |
and:[receiverReceiver selector == #class]) ifTrue:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
515 |
className := (receiverReceiver receiver name) , ' class'. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
516 |
] ifFalse:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
517 |
className := (receiverReceiver name). |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
518 |
]. |
921
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
519 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
520 |
"/ className := nameSpace name , '::' , className |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
521 |
"/ ]. |
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
522 |
methodSelector := (receiver arguments at:1) evaluate. |
654 | 523 |
|
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
524 |
sel == #'category:' ifTrue:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
525 |
change := MethodCategoryChange new. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
526 |
change |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
527 |
className:className |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
528 |
selector:methodSelector |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
529 |
category:(aTree arguments at:1) evaluate. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
530 |
] ifFalse:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
531 |
change := MethodPrivacyChange new. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
532 |
change |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
533 |
className:className |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
534 |
selector:methodSelector |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
535 |
privacy:(aTree arguments at:1) evaluate. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
536 |
]. |
654 | 537 |
|
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
538 |
self add: change. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
539 |
^ true |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
540 |
] ifFalse:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
541 |
self halt:'unexpected change' |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
542 |
]. |
654 | 543 |
]. |
544 |
||
545 |
sel == #'comment:' ifTrue:[ |
|
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
546 |
(receiver isUnaryMessage |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
547 |
and:[receiverSelector == #class]) ifTrue:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
548 |
className := (receiverReceiver name) , ' class'. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
549 |
] ifFalse:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
550 |
className := (receiver name). |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
551 |
]. |
921
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
552 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
553 |
"/ className := nameSpace name , '::' , className |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
554 |
"/ ]. |
654 | 555 |
|
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
556 |
change := ClassCommentChange new. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
557 |
change |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
558 |
className:className |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
559 |
comment:(aTree arguments at:1) evaluate. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
560 |
change source:(aTree printString). |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
561 |
self add: change. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
562 |
^ true |
654 | 563 |
]. |
564 |
||
798 | 565 |
sel == #'instanceVariableNames:' ifTrue:[ |
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
566 |
(receiver isUnaryMessage |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
567 |
and:[receiverSelector == #class]) ifTrue:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
568 |
className := (receiverReceiver name) , ' class'. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
569 |
] ifFalse:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
570 |
className := (receiver name). |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
571 |
]. |
921
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
572 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
573 |
"/ className := nameSpace name , '::' , className |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
574 |
"/ ]. |
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
575 |
change := ClassInstVarDefinitionChange new. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
576 |
change className:className. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
577 |
change source:(aTree printString). |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
578 |
self add: change. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
579 |
^ true |
798 | 580 |
]. |
581 |
||
654 | 582 |
sel == #'removeClass:' ifTrue:[ |
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
583 |
(receiverVarName == #Smalltalk) ifTrue:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
584 |
className := (aTree arguments at:1) name. |
921
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
585 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
586 |
"/ className := nameSpace name , '::' , className |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
587 |
"/ ]. |
654 | 588 |
|
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
589 |
change := ClassRemoveChange new. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
590 |
change className:className. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
591 |
self add: change. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
592 |
^ true |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
593 |
] ifFalse:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
594 |
self halt |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
595 |
]. |
654 | 596 |
]. |
597 |
||
598 |
sel == #'renameClass:to:' ifTrue:[ |
|
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
599 |
(receiverVarName == #Smalltalk) ifTrue:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
600 |
oldName := (aTree arguments at:1) name. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
601 |
newName := (aTree arguments at:2) evaluate. |
654 | 602 |
|
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
603 |
change := ClassRenameChange new. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
604 |
change oldName:oldName newName:newName. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
605 |
self add: change. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
606 |
^ true |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
607 |
] ifFalse:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
608 |
self halt |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
609 |
]. |
654 | 610 |
]. |
611 |
||
612 |
sel == #'name:' ifTrue:[ |
|
924 | 613 |
((receiverVarName == #Namespace) |
614 |
or:[receiverVarName == #NameSpace]) ifTrue:[ |
|
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
615 |
className := (aTree arguments at:1) evaluate. |
654 | 616 |
|
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
617 |
change := NameSpaceCreationChange new. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
618 |
change name:className. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
619 |
self add: change. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
620 |
^ true |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
621 |
] ifFalse:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
622 |
self halt |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
623 |
]. |
654 | 624 |
]. |
625 |
||
781 | 626 |
(sel == #'primitiveDefinitions' |
627 |
or:[sel == #'primitiveFunctions' |
|
628 |
or:[sel == #'primitiveVariables']]) ifTrue:[ |
|
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
629 |
(receiver isUnaryMessage |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
630 |
and:[receiverSelector == #class]) ifTrue:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
631 |
className := (receiverReceiver name) , ' class'. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
632 |
] ifFalse:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
633 |
className := (receiver name). |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
634 |
]. |
921
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
635 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
636 |
"/ className := nameSpace name , '::' , className |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
637 |
"/ ]. |
781 | 638 |
|
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
639 |
aStream skipSeparators. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
640 |
primSource := aStream nextChunk. |
781 | 641 |
|
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
642 |
sel == #'primitiveDefinitions' ifTrue:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
643 |
change := ClassPrimitiveDefinitionsChange new |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
644 |
] ifFalse:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
645 |
sel == #'primitiveFunctions' ifTrue:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
646 |
change := ClassPrimitiveFunctionsChange new |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
647 |
] ifFalse:[ |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
648 |
change := ClassPrimitiveVariablesChange new |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
649 |
] |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
650 |
]. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
651 |
change class:className source:primSource. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
652 |
self add: change. |
781 | 653 |
|
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
654 |
^ true |
781 | 655 |
]. |
656 |
||
654 | 657 |
^ false |
658 |
||
659 |
"Created: / 16.2.1998 / 13:42:40 / cg" |
|
860 | 660 |
"Modified: / 15.12.1999 / 00:29:06 / cg" |
654 | 661 |
! ! |
662 |
||
857 | 663 |
!ChangeSet methodsFor:'utilities'! |
664 |
||
878 | 665 |
apply |
666 |
"apply all changes in the receivers changeSet" |
|
667 |
||
668 |
self do:[:aChange | |
|
879 | 669 |
aChange apply |
878 | 670 |
] |
671 |
! |
|
672 |
||
673 |
condenseChangesForClass:aClass package:aPackageSymbol |
|
674 |
"remove all changes for aClass and aPackageSymbol |
|
675 |
(i.e. leave methodChanges for other packages" |
|
676 |
||
887
3cfdf7d2ba89
oops - must care for unloaded/nonExistent/removed/renamed classes
Claus Gittinger <cg@exept.de>
parents:
883
diff
changeset
|
677 |
|changesToRemove className| |
878 | 678 |
|
679 |
changesToRemove := OrderedCollection new. |
|
887
3cfdf7d2ba89
oops - must care for unloaded/nonExistent/removed/renamed classes
Claus Gittinger <cg@exept.de>
parents:
883
diff
changeset
|
680 |
className := aClass name. |
3cfdf7d2ba89
oops - must care for unloaded/nonExistent/removed/renamed classes
Claus Gittinger <cg@exept.de>
parents:
883
diff
changeset
|
681 |
self do:[:aChange | |chgClass| |
3cfdf7d2ba89
oops - must care for unloaded/nonExistent/removed/renamed classes
Claus Gittinger <cg@exept.de>
parents:
883
diff
changeset
|
682 |
aChange className = className ifTrue:[ |
3cfdf7d2ba89
oops - must care for unloaded/nonExistent/removed/renamed classes
Claus Gittinger <cg@exept.de>
parents:
883
diff
changeset
|
683 |
changesToRemove add:aChange |
3cfdf7d2ba89
oops - must care for unloaded/nonExistent/removed/renamed classes
Claus Gittinger <cg@exept.de>
parents:
883
diff
changeset
|
684 |
] |
878 | 685 |
]. |
686 |
self removeAll:changesToRemove |
|
687 |
||
688 |
! |
|
689 |
||
857 | 690 |
diffSetsAgainst:anotherChangeSet |
691 |
"walk over the receiver and anotherChangeSet, |
|
692 |
add all changes to one of the tree lists: |
|
879 | 693 |
onlyInReceiver, onlyInArg or changed, |
864 | 694 |
each being a changeSet containing corresponding changes." |
857 | 695 |
|
696 |
|onlyInReceiver onlyInArg changedMethods |
|
697 |
indexFromChangedMethodsToA indexFromChangedMethodsToB |
|
864 | 698 |
"info" ret| |
857 | 699 |
|
700 |
onlyInReceiver := ChangeSet new. |
|
701 |
onlyInArg := ChangeSet new. |
|
702 |
changedMethods := ChangeSet new. |
|
703 |
||
704 |
indexFromChangedMethodsToA := OrderedCollection new. |
|
705 |
indexFromChangedMethodsToB := OrderedCollection new. |
|
706 |
||
707 |
self keysAndValuesDo:[:idxA :aChangeInA | |
|
879 | 708 |
|anyFound ch| |
857 | 709 |
|
879 | 710 |
anyFound := false. |
857 | 711 |
|
879 | 712 |
anotherChangeSet keysAndValuesDo:[:idxB :aChangeInB | |
713 |
(aChangeInA isForSameAs:aChangeInB) ifTrue:[ |
|
714 |
anyFound := true. |
|
857 | 715 |
|
879 | 716 |
"/ also in B - is it different ? |
717 |
(aChangeInA sameAs:aChangeInB) ifFalse:[ |
|
718 |
changedMethods add:aChangeInA. |
|
719 |
indexFromChangedMethodsToA add:idxA. |
|
720 |
indexFromChangedMethodsToB add:idxB. |
|
721 |
] ifTrue:[ |
|
722 |
aChangeInA isMethodChange ifTrue:[ |
|
723 |
aChangeInA methodCategory ~= aChangeInB methodCategory ifTrue:[ |
|
724 |
"/ only the category is different; |
|
725 |
"/ make it a MethodCategory changes. |
|
857 | 726 |
|
879 | 727 |
ch := MethodCategoryChange new |
728 |
className:aChangeInA className |
|
729 |
selector:aChangeInA selector |
|
730 |
category:aChangeInA methodCategory. |
|
731 |
self at:idxA put:ch. |
|
857 | 732 |
|
879 | 733 |
ch := MethodCategoryChange new |
734 |
className:aChangeInB className |
|
735 |
selector:aChangeInB selector |
|
736 |
category:aChangeInB methodCategory. |
|
737 |
anotherChangeSet at:idxB put:ch. |
|
857 | 738 |
|
879 | 739 |
changedMethods add:aChangeInA. |
740 |
indexFromChangedMethodsToA add:idxA. |
|
741 |
indexFromChangedMethodsToB add:idxB. |
|
742 |
] |
|
743 |
]. |
|
744 |
] |
|
745 |
] ifFalse:[ |
|
746 |
(aChangeInA sameAs:aChangeInB) ifTrue:[ |
|
747 |
anyFound := true. |
|
748 |
] ifFalse:[ |
|
749 |
] |
|
750 |
] |
|
751 |
]. |
|
857 | 752 |
|
879 | 753 |
anyFound ifFalse:[ |
754 |
onlyInReceiver add:aChangeInA. |
|
755 |
] |
|
857 | 756 |
]. |
757 |
||
758 |
anotherChangeSet keysAndValuesDo:[:idxB :aChangeInB | |
|
879 | 759 |
|anyFound| |
857 | 760 |
|
879 | 761 |
anyFound := false. |
857 | 762 |
|
879 | 763 |
self do:[:aChangeInA | |
764 |
|idxM| |
|
857 | 765 |
|
879 | 766 |
(aChangeInA isForSameAs:aChangeInB) ifTrue:[ |
767 |
anyFound := true. |
|
857 | 768 |
|
879 | 769 |
"/ also in B - is it different ? |
770 |
(aChangeInA sameAs:aChangeInB) ifFalse:[ |
|
771 |
"/ already there ? |
|
772 |
idxM := changedMethods findFirst:[:c | c isForSameAs:aChangeInB]. |
|
773 |
idxM == 0 ifTrue:[ |
|
774 |
changedMethods add:aChangeInB. |
|
775 |
indexFromChangedMethodsToB add:idxB. |
|
776 |
] ifFalse:[ |
|
777 |
indexFromChangedMethodsToB at:idxM put:idxB |
|
778 |
] |
|
779 |
] |
|
780 |
] ifFalse:[ |
|
781 |
(aChangeInA sameAs:aChangeInB) ifTrue:[ |
|
782 |
anyFound := true. |
|
783 |
] ifFalse:[ |
|
784 |
] |
|
785 |
] |
|
786 |
]. |
|
787 |
anyFound ifFalse:[ |
|
788 |
onlyInArg add:aChangeInB. |
|
789 |
] |
|
857 | 790 |
]. |
791 |
||
864 | 792 |
"/ info := OrderedCollection new:(changedMethods size). |
793 |
"/ changedMethods keysAndValuesDo:[:idx :changedMethod | |
|
794 |
"/ info add:(Array |
|
795 |
"/ with:(indexFromChangedMethodsToA at:idx) |
|
796 |
"/ with:(indexFromChangedMethodsToB at:idx) |
|
797 |
"/ ) |
|
798 |
"/ ]. |
|
857 | 799 |
changedMethods := (1 to:changedMethods size) collect:[:idx | |
879 | 800 |
|cA cB| |
857 | 801 |
|
879 | 802 |
cA := self at:(indexFromChangedMethodsToA at:idx). |
803 |
cB := anotherChangeSet at:(indexFromChangedMethodsToB at:idx). |
|
804 |
Array with:cA with:cB |
|
805 |
]. |
|
857 | 806 |
|
807 |
ret := IdentityDictionary new. |
|
864 | 808 |
"/ ret at:#info put:info. |
857 | 809 |
ret at:#changed put:changedMethods. |
810 |
ret at:#onlyInReceiver put:onlyInReceiver. |
|
811 |
ret at:#onlyInArg put:onlyInArg. |
|
864 | 812 |
^ret |
857 | 813 |
! ! |
814 |
||
625
06f4ed35832b
added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
378
diff
changeset
|
815 |
!ChangeSet class methodsFor:'documentation'! |
100 | 816 |
|
817 |
version |
|
924 | 818 |
^ '$Header: /cvs/stx/stx/libbasic3/ChangeSet.st,v 1.45 2000-04-12 21:40:29 cg Exp $' |
100 | 819 |
! ! |