author | Stefan Vogel <sv@exept.de> |
Sat, 10 Aug 2013 14:29:04 +0200 | |
changeset 3378 | 905a79f03901 |
parent 3376 | a0e06d192df4 |
child 3387 | b594e2d7a59e |
child 3395 | baddb3274c85 |
permissions | -rw-r--r-- |
3 | 1 |
" |
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
2376 | 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 |
" |
|
921
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
12 |
"{ Package: 'stx:libbasic3' }" |
fa4db05c887b
oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents:
916
diff
changeset
|
13 |
|
0 | 14 |
OrderedCollection subclass:#ChangeSet |
2412 | 15 |
instanceVariableNames:'changedClasses changeSelectors name' |
16 |
classVariableNames:'' |
|
17 |
poolDictionaries:'' |
|
18 |
category:'System-Changes' |
|
0 | 19 |
! |
20 |
||
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
21 |
Object subclass:#ChangeFileReader |
2412 | 22 |
instanceVariableNames:'inputStream parseTree changeAction changeSet selector receiver |
23 |
arguments receiverSelector receiverReceiver lineNumber position |
|
3246 | 24 |
className methodSelector nameSpaceOverride chunk timestamp |
25 |
classIsJava' |
|
2412 | 26 |
classVariableNames:'' |
27 |
poolDictionaries:'' |
|
28 |
privateIn:ChangeSet |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
29 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
30 |
|
2256
b98137d2aa30
changed: #changesFromStream:for:reader:do:
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
31 |
Error subclass:#ChangeProcessingError |
2412 | 32 |
instanceVariableNames:'' |
33 |
classVariableNames:'' |
|
34 |
poolDictionaries:'' |
|
35 |
privateIn:ChangeSet |
|
2256
b98137d2aa30
changed: #changesFromStream:for:reader:do:
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
36 |
! |
b98137d2aa30
changed: #changesFromStream:for:reader:do:
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
37 |
|
2881 | 38 |
SmalltalkChunkFileSourceWriter subclass:#ClassSourceWriter |
3246 | 39 |
instanceVariableNames:'changeSetBeingSaved packageName namespaceName topClassName |
40 |
classInfos metaInfos' |
|
2881 | 41 |
classVariableNames:'' |
42 |
poolDictionaries:'' |
|
43 |
privateIn:ChangeSet |
|
44 |
! |
|
45 |
||
46 |
Object subclass:#ClassInfo |
|
3246 | 47 |
instanceVariableNames:'name superclass definition comment methods methodDictionary |
48 |
namespace primitiveDefinitions primitiveVariables |
|
49 |
primitiveFunctions' |
|
2881 | 50 |
classVariableNames:'' |
51 |
poolDictionaries:'' |
|
52 |
privateIn:ChangeSet::ClassSourceWriter |
|
53 |
! |
|
54 |
||
1156
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
55 |
Object subclass:#DiffSet |
2881 | 56 |
instanceVariableNames:'changed onlyInReceiver onlyInArg same' |
2412 | 57 |
classVariableNames:'' |
58 |
poolDictionaries:'' |
|
59 |
privateIn:ChangeSet |
|
1156
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
60 |
! |
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
61 |
|
1182 | 62 |
ChangeSet::ChangeFileReader subclass:#DolphinPACFileReader |
2412 | 63 |
instanceVariableNames:'' |
64 |
classVariableNames:'' |
|
65 |
poolDictionaries:'' |
|
66 |
privateIn:ChangeSet |
|
1182 | 67 |
! |
68 |
||
2256
b98137d2aa30
changed: #changesFromStream:for:reader:do:
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
69 |
ChangeSet::ChangeProcessingError subclass:#InvalidChangeChunkError |
2412 | 70 |
instanceVariableNames:'' |
71 |
classVariableNames:'' |
|
72 |
poolDictionaries:'' |
|
73 |
privateIn:ChangeSet |
|
2256
b98137d2aa30
changed: #changesFromStream:for:reader:do:
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
74 |
! |
b98137d2aa30
changed: #changesFromStream:for:reader:do:
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
75 |
|
1176 | 76 |
ChangeSet::ChangeFileReader subclass:#SIFChangeFileReader |
2412 | 77 |
instanceVariableNames:'' |
78 |
classVariableNames:'' |
|
79 |
poolDictionaries:'' |
|
80 |
privateIn:ChangeSet |
|
1176 | 81 |
! |
82 |
||
625
06f4ed35832b
added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
378
diff
changeset
|
83 |
!ChangeSet class methodsFor:'documentation'! |
9 | 84 |
|
85 |
copyright |
|
86 |
" |
|
87 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
2376 | 88 |
All Rights Reserved |
9 | 89 |
|
90 |
This software is furnished under a license and may be used |
|
91 |
only in accordance with the terms of that license and with the |
|
92 |
inclusion of the above copyright notice. This software may not |
|
93 |
be provided or otherwise made available to, or used by, any |
|
94 |
other person. No title to or ownership of the software is |
|
95 |
hereby transferred. |
|
96 |
" |
|
97 |
! |
|
98 |
||
99 |
documentation |
|
100 |
" |
|
101 |
used in the changes management to keep track of changes |
|
235 | 102 |
|
103 |
[author:] |
|
2376 | 104 |
Claus Gittinger |
9 | 105 |
" |
106 |
! ! |
|
107 |
||
654 | 108 |
!ChangeSet class methodsFor:'instance creation'! |
109 |
||
1176 | 110 |
forExistingClass:aClass |
1869
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
111 |
"build a changeSet for some given class, all of its private classes |
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
112 |
and all extensions if any. |
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
113 |
I.e. a changeSet which represents the existing class in the image. |
1176 | 114 |
That does of course not give deltas, but instead reflects the current |
115 |
state of the given class. |
|
116 |
It is useful in conjunction with the other utility methods, |
|
1869
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
117 |
for example, when building patchLists, diffSets, comparing etc." |
1176 | 118 |
|
1954
521fa986be30
Fix if method does not exist in change
Stefan Vogel <sv@exept.de>
parents:
1920
diff
changeset
|
119 |
|changeSet s changeObject| |
1176 | 120 |
|
2633 | 121 |
"/ kludge: could do this much faster... |
1188 | 122 |
s := ReadWriteStream on:''. |
1176 | 123 |
aClass fileOutOn:s. |
1188 | 124 |
s reset. |
125 |
changeSet := self fromStream:s. |
|
1865 | 126 |
|
1869
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
127 |
"/ fetch the real package info... |
1865 | 128 |
changeSet do:[:eachChange | |
129 |
eachChange isMethodChange ifTrue:[ |
|
1954
521fa986be30
Fix if method does not exist in change
Stefan Vogel <sv@exept.de>
parents:
1920
diff
changeset
|
130 |
changeObject := eachChange changeMethod. |
521fa986be30
Fix if method does not exist in change
Stefan Vogel <sv@exept.de>
parents:
1920
diff
changeset
|
131 |
changeObject notNil ifTrue:[ |
521fa986be30
Fix if method does not exist in change
Stefan Vogel <sv@exept.de>
parents:
1920
diff
changeset
|
132 |
eachChange package:changeObject package |
521fa986be30
Fix if method does not exist in change
Stefan Vogel <sv@exept.de>
parents:
1920
diff
changeset
|
133 |
]. |
1865 | 134 |
] ifFalse:[ |
135 |
eachChange isClassChange ifTrue:[ |
|
1954
521fa986be30
Fix if method does not exist in change
Stefan Vogel <sv@exept.de>
parents:
1920
diff
changeset
|
136 |
changeObject := eachChange changeClass. |
521fa986be30
Fix if method does not exist in change
Stefan Vogel <sv@exept.de>
parents:
1920
diff
changeset
|
137 |
changeObject notNil ifTrue:[ |
521fa986be30
Fix if method does not exist in change
Stefan Vogel <sv@exept.de>
parents:
1920
diff
changeset
|
138 |
eachChange package:changeObject package |
521fa986be30
Fix if method does not exist in change
Stefan Vogel <sv@exept.de>
parents:
1920
diff
changeset
|
139 |
]. |
1865 | 140 |
]. |
141 |
]. |
|
142 |
]. |
|
143 |
||
1176 | 144 |
^ changeSet |
145 |
||
1188 | 146 |
"/ |source changeSet chunk sawExcla lastTimeStamp s change nameSpace| |
147 |
||
1176 | 148 |
"/ changeSet := self new. |
149 |
"/ |
|
150 |
"/ "/ first, a classDefinition change ... |
|
151 |
"/ changeSet addClassDefinitionChangeFor:aClass. |
|
152 |
"/ "/ are there any class-instVars ? |
|
153 |
"/ aClass class instVarNames size > 0 ifTrue:[ |
|
154 |
"/ changeSet addInstVarDefinitionChangeFor:aClass class. |
|
155 |
"/ ]. |
|
156 |
"/ "/ a comment ? |
|
157 |
"/ aClass comment size > 0 ifTrue:[ |
|
158 |
"/ changeSet addClassCommentChangeFor:aClass. |
|
159 |
"/ ]. |
|
160 |
"/ |
|
161 |
"/ "/ class methods first ... |
|
162 |
"/ aClass class methodDictionary keysAndValuesDo:[:sel :mthd | |
|
163 |
"/ changeSet addMethodChange:mthd in:aClass class. |
|
164 |
"/ ]. |
|
165 |
"/ |
|
166 |
"/ "/ instance methods ... |
|
167 |
"/ aClass methodDictionary keysAndValuesDo:[:sel :mthd | |
|
168 |
"/ changeSet addMethodChange:mthd in:aClass. |
|
169 |
"/ ]. |
|
170 |
"/ |
|
171 |
"/ ^ changeSet |
|
172 |
||
1865 | 173 |
|
1176 | 174 |
" |
175 |
ChangeSet forExistingClass:ChangeSet |
|
1869
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
176 |
ChangeSet forExistingClass:A |
1865 | 177 |
|
178 |
Rectangle hasExtensions |
|
179 |
ChangeSet forExistingClass:Rectangle |
|
1176 | 180 |
" |
181 |
||
1865 | 182 |
"Created: / 16-02-1998 / 12:19:34 / cg" |
1869
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
183 |
"Modified: / 12-10-2006 / 23:45:14 / cg" |
2633 | 184 |
"Modified (format): / 01-12-2011 / 19:10:22 / cg" |
1865 | 185 |
! |
186 |
||
2940
a81457cc5d01
added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents:
2934
diff
changeset
|
187 |
forExistingClass:aClass withExtensions:withExtensions |
a81457cc5d01
added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents:
2934
diff
changeset
|
188 |
"build a changeSet for some given full class with or without extensions. |
a81457cc5d01
added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents:
2934
diff
changeset
|
189 |
That does of course not give deltas, but instead reflects the current |
a81457cc5d01
added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents:
2934
diff
changeset
|
190 |
state of the given class. |
a81457cc5d01
added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents:
2934
diff
changeset
|
191 |
It is useful in conjunction with the other utility methods, |
a81457cc5d01
added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents:
2934
diff
changeset
|
192 |
for example, when building patchLists, diffSets etc." |
a81457cc5d01
added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents:
2934
diff
changeset
|
193 |
|
a81457cc5d01
added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents:
2934
diff
changeset
|
194 |
^ self |
a81457cc5d01
added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents:
2934
diff
changeset
|
195 |
forExistingClass:aClass |
2943 | 196 |
withExtensions:withExtensions |
197 |
withLooseMethods:false |
|
2940
a81457cc5d01
added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents:
2934
diff
changeset
|
198 |
extensionsOnly:false |
a81457cc5d01
added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents:
2934
diff
changeset
|
199 |
|
a81457cc5d01
added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents:
2934
diff
changeset
|
200 |
" |
a81457cc5d01
added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents:
2934
diff
changeset
|
201 |
Object hasExtensions |
a81457cc5d01
added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents:
2934
diff
changeset
|
202 |
Object extensions size |
a81457cc5d01
added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents:
2934
diff
changeset
|
203 |
|
2943 | 204 |
(ChangeSet forExistingClass:Object) size |
205 |
(ChangeSet forExistingClass:Object withExtensions:false) size |
|
206 |
||
207 |
(ChangeSet forExistingClass:stx_libbasic3 withExtensions:false) |
|
2940
a81457cc5d01
added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents:
2934
diff
changeset
|
208 |
" |
a81457cc5d01
added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents:
2934
diff
changeset
|
209 |
|
a81457cc5d01
added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents:
2934
diff
changeset
|
210 |
"Created: / 12-10-2006 / 18:13:02 / cg" |
a81457cc5d01
added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents:
2934
diff
changeset
|
211 |
"Modified: / 12-10-2006 / 23:46:05 / cg" |
a81457cc5d01
added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents:
2934
diff
changeset
|
212 |
! |
a81457cc5d01
added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents:
2934
diff
changeset
|
213 |
|
1865 | 214 |
forExistingClass:aClass withExtensions:withExtensions extensionsOnly:extensionsOnly |
1869
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
215 |
"build a changeSet for some given full class, the base-class or the extensions only, |
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
216 |
as specified by the with-arguments. |
1865 | 217 |
That does of course not give deltas, but instead reflects the current |
218 |
state of the given class. |
|
219 |
It is useful in conjunction with the other utility methods, |
|
220 |
for example, when building patchLists, diffSets etc." |
|
221 |
||
2943 | 222 |
^ self |
223 |
forExistingClass:aClass |
|
224 |
withExtensions:withExtensions |
|
225 |
withLooseMethods:false |
|
226 |
extensionsOnly:extensionsOnly |
|
227 |
||
228 |
" |
|
229 |
ChangeSet forExistingClass:ChangeSet |
|
230 |
||
231 |
Rectangle hasExtensions |
|
232 |
Rectangle extensions |
|
233 |
||
234 |
ChangeSet forExistingClass:Rectangle withExtensions:true extensionsOnly:false |
|
235 |
ChangeSet forExistingClass:Rectangle withExtensions:false extensionsOnly:false |
|
236 |
ChangeSet forExistingClass:Rectangle withExtensions:false extensionsOnly:true |
|
237 |
" |
|
238 |
||
239 |
"Created: / 12-10-2006 / 18:13:02 / cg" |
|
240 |
"Modified: / 12-10-2006 / 23:46:05 / cg" |
|
241 |
! |
|
242 |
||
243 |
forExistingClass:aClass withExtensions:withExtensions withLooseMethods:withLooseMethods |
|
244 |
"build a changeSet for some given full class with or without extensions. |
|
245 |
That does of course not give deltas, but instead reflects the current |
|
246 |
state of the given class. |
|
247 |
It is useful in conjunction with the other utility methods, |
|
248 |
for example, when building patchLists, diffSets etc." |
|
249 |
||
250 |
^ self |
|
251 |
forExistingClass:aClass |
|
252 |
withExtensions:withExtensions |
|
253 |
withLooseMethods:withLooseMethods |
|
254 |
extensionsOnly:false |
|
255 |
||
256 |
" |
|
257 |
Object hasExtensions |
|
258 |
Object extensions size |
|
259 |
||
260 |
(ChangeSet forExistingClass:Object) size |
|
261 |
(ChangeSet forExistingClass:Object withExtensions:false) size |
|
262 |
||
263 |
(ChangeSet forExistingClass:stx_libbasic3 withExtensions:false) |
|
264 |
" |
|
265 |
||
266 |
"Created: / 12-10-2006 / 18:13:02 / cg" |
|
267 |
"Modified: / 12-10-2006 / 23:46:05 / cg" |
|
268 |
! |
|
269 |
||
270 |
forExistingClass:aClass withExtensions:withExtensions withLooseMethods:withLooseMethods extensionsOnly:extensionsOnly |
|
271 |
"build a changeSet for some given full class, the base-class or the extensions only, |
|
272 |
as specified by the with-arguments. |
|
273 |
That does of course not give deltas, but instead reflects the current |
|
274 |
state of the given class. |
|
275 |
It is useful in conjunction with the other utility methods, |
|
276 |
for example, when building patchLists, diffSets etc." |
|
277 |
||
278 |
|changeSet classPackage notInClassesPackage realExtensions looseMethods| |
|
1865 | 279 |
|
280 |
changeSet := self forExistingClass:aClass. |
|
281 |
classPackage := aClass package. |
|
282 |
||
2943 | 283 |
notInClassesPackage := |
284 |
[:change | |
|
285 |
change isMethodChange |
|
286 |
and:[ change package ~= classPackage ] |
|
287 |
]. |
|
288 |
||
289 |
realExtensions := |
|
290 |
[:change | |
|
291 |
change isMethodChange |
|
292 |
and:[ change package ~= classPackage |
|
293 |
and:[ change package ~~ PackageId noProjectID ]] |
|
294 |
]. |
|
295 |
||
296 |
looseMethods := |
|
297 |
[:change | |
|
298 |
change isMethodChange |
|
299 |
and:[change package == PackageId noProjectID ] |
|
300 |
]. |
|
301 |
||
1865 | 302 |
extensionsOnly ifTrue:[ |
2943 | 303 |
withLooseMethods ifTrue:[ |
304 |
^ changeSet select:notInClassesPackage |
|
305 |
]. |
|
306 |
||
307 |
^ changeSet select:realExtensions. |
|
1865 | 308 |
]. |
2943 | 309 |
|
1865 | 310 |
withExtensions ifFalse:[ |
2943 | 311 |
withLooseMethods ifFalse:[ |
312 |
^ changeSet reject:notInClassesPackage |
|
313 |
]. |
|
314 |
||
315 |
^ changeSet reject:realExtensions. |
|
316 |
]. |
|
317 |
||
318 |
withLooseMethods ifFalse:[ |
|
319 |
^ changeSet reject:looseMethods. |
|
1865 | 320 |
]. |
321 |
||
322 |
^ changeSet |
|
323 |
||
324 |
" |
|
325 |
ChangeSet forExistingClass:ChangeSet |
|
326 |
||
327 |
Rectangle hasExtensions |
|
328 |
Rectangle extensions |
|
329 |
||
330 |
ChangeSet forExistingClass:Rectangle withExtensions:true extensionsOnly:false |
|
331 |
ChangeSet forExistingClass:Rectangle withExtensions:false extensionsOnly:false |
|
332 |
ChangeSet forExistingClass:Rectangle withExtensions:false extensionsOnly:true |
|
333 |
" |
|
334 |
||
335 |
"Created: / 12-10-2006 / 18:13:02 / cg" |
|
1869
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
336 |
"Modified: / 12-10-2006 / 23:46:05 / cg" |
1176 | 337 |
! |
338 |
||
1292 | 339 |
forExistingMethods:aCollectionOfMethods |
340 |
"build a changeSet for a collection of methods. |
|
341 |
That does of course not give deltas, but instead reflects the current |
|
342 |
state of the given set of methods. |
|
343 |
It is useful in conjunction with the other utility methods, |
|
344 |
for example, when building patchLists, diffSets etc." |
|
345 |
||
346 |
|changeSet stream previousPackage| |
|
347 |
||
2244
83dade66e325
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
348 |
changeSet := self new. |
1292 | 349 |
aCollectionOfMethods do:[:eachMethod | |
2524
309a3ec3f7d1
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
350 |
|change source| |
309a3ec3f7d1
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
351 |
|
309a3ec3f7d1
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
352 |
source := eachMethod source. |
309a3ec3f7d1
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
353 |
source isNil ifTrue:[ |
309a3ec3f7d1
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
354 |
Transcript showCR:'oops - no source for ',eachMethod whoString. |
309a3ec3f7d1
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
355 |
]. |
2244
83dade66e325
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
356 |
change := MethodDefinitionChange new. |
83dade66e325
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
357 |
eachMethod mclass notNil ifTrue:[ change className:eachMethod mclass name ]. |
2524
309a3ec3f7d1
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
358 |
source notNil ifTrue:[ change source:source ]. |
2244
83dade66e325
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
359 |
change selector:eachMethod selector. |
83dade66e325
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
360 |
change package:(eachMethod package). |
83dade66e325
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
361 |
change category:(eachMethod category). |
83dade66e325
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
362 |
changeSet add:change. |
1292 | 363 |
]. |
2244
83dade66e325
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
364 |
|
83dade66e325
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
365 |
"/ stream := ReadWriteStream on:''. |
83dade66e325
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
366 |
"/ aCollectionOfMethods do:[:eachMethod | |
83dade66e325
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
367 |
"/ previousPackage ~= eachMethod package ifTrue:[ |
83dade66e325
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
368 |
"/ stream nextPutAll:'"{ Package: '''. |
83dade66e325
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
369 |
"/ stream nextPutAll:eachMethod package asString. |
83dade66e325
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
370 |
"/ stream nextPutAll:''' }"'; cr; cr. |
83dade66e325
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
371 |
"/ ]. |
83dade66e325
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
372 |
"/ eachMethod mclass fileOutMethod:eachMethod on:stream |
83dade66e325
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
373 |
"/ ]. |
83dade66e325
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
374 |
"/ stream reset. |
83dade66e325
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
375 |
"/ changeSet := self fromStream:stream. |
83dade66e325
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
376 |
"/ changeSet do:[:eachChange | |
83dade66e325
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
377 |
"/ eachChange package:(eachChange changeMethod package). |
83dade66e325
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2235
diff
changeset
|
378 |
"/ ]. |
1292 | 379 |
^ changeSet |
380 |
||
381 |
" |
|
382 |
ChangeSet forExistingMethods:(Array with:(Array compiledMethodAt:#at:) |
|
383 |
with:(Object compiledMethodAt:#at:) |
|
384 |
with:(Behavior compiledMethodAt:#compiledMethodAt:) ) |
|
385 |
" |
|
1872
7a1f2a26bf90
changes for compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1869
diff
changeset
|
386 |
|
2524
309a3ec3f7d1
changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
387 |
"Modified: / 17-09-2011 / 10:26:03 / cg" |
1292 | 388 |
! |
389 |
||
2412 | 390 |
forPackage: package |
391 |
||
392 |
^self forPackage: package ignoreAutoloaded: false. |
|
393 |
||
394 |
"Created: / 20-05-2008 / 17:56:18 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
395 |
"Modified: / 12-08-2009 / 14:23:15 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
396 |
! |
|
397 |
||
398 |
forPackage: package ignoreAutoloaded: ignoreAutoloaded |
|
399 |
"build a changeSet for a given package" |
|
400 |
||
401 |
|changeSet packageClasses packageExtensions| |
|
402 |
||
403 |
packageClasses := ProjectDefinition searchForClassesWithProject: package. |
|
404 |
packageExtensions := ProjectDefinition searchForExtensionsWithProject: package. |
|
405 |
changeSet := self forExistingMethods: packageExtensions. |
|
2941
6bb8b3184650
formatting: #forPackage:ignoreAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
2940
diff
changeset
|
406 |
packageClasses do:[:cls| |
6bb8b3184650
formatting: #forPackage:ignoreAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
2940
diff
changeset
|
407 |
(ignoreAutoloaded not and:[cls isLoaded not]) ifTrue:[cls autoload]. |
6bb8b3184650
formatting: #forPackage:ignoreAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
2940
diff
changeset
|
408 |
cls isLoaded ifTrue: [ |
6bb8b3184650
formatting: #forPackage:ignoreAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
2940
diff
changeset
|
409 |
changeSet addAll: (self forExistingClass:cls withExtensions:false) |
6bb8b3184650
formatting: #forPackage:ignoreAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
2940
diff
changeset
|
410 |
] |
6bb8b3184650
formatting: #forPackage:ignoreAutoloaded:
Claus Gittinger <cg@exept.de>
parents:
2940
diff
changeset
|
411 |
]. |
2881 | 412 |
changeSet name: 'Package ' , package. |
2412 | 413 |
^changeSet |
414 |
||
415 |
"Created: / 12-08-2009 / 14:22:44 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
2881 | 416 |
"Modified: / 16-03-2012 / 15:37:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2412 | 417 |
! |
418 |
||
2321 | 419 |
fromDiffSet:aDiffSet |
2322
c5ebd3b56e54
comment/format in: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents:
2321
diff
changeset
|
420 |
"build a changeSet from a given diffSet. This can be used as a patchSet, |
c5ebd3b56e54
comment/format in: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents:
2321
diff
changeset
|
421 |
to update the first-version in the diffSet to the second-version" |
2321 | 422 |
|
423 |
|changeSet| |
|
424 |
||
425 |
changeSet := self new. |
|
2323 | 426 |
"/ class definitions first... |
427 |
changeSet addAll:((aDiffSet changed collect:[:eachPair | eachPair second]) select:[:ch | ch isClassDefinitionChange]). |
|
428 |
changeSet addAll:((aDiffSet onlyInArg) select:[:ch | ch isClassDefinitionChange]). |
|
429 |
||
2321 | 430 |
"/ first add new methods... |
2323 | 431 |
changeSet addAll:((aDiffSet onlyInArg) reject:[:ch | ch isClassDefinitionChange]). |
2321 | 432 |
"/ then, changed methods... |
2323 | 433 |
changeSet addAll:((aDiffSet changed collect:[:eachPair | eachPair second]) reject:[:ch | ch isClassDefinitionChange]). |
2321 | 434 |
"/ then, removed methods... |
435 |
aDiffSet onlyInReceiver do:[:each | |
|
436 |
|ch| |
|
437 |
||
438 |
ch := MethodRemoveChange className:(each className) selector:(each selector). |
|
439 |
changeSet add:ch. |
|
440 |
]. |
|
441 |
^ changeSet |
|
442 |
||
443 |
"Created: / 08-02-2011 / 10:48:36 / cg" |
|
444 |
! |
|
445 |
||
2412 | 446 |
fromDirectory: aStringOfFilename |
447 |
||
448 |
| d cs | |
|
449 |
d := aStringOfFilename asFilename. |
|
450 |
cs := self new. |
|
451 |
d directoryContentsAsFilenames do: |
|
452 |
[:each| |
|
453 |
each suffix = 'st' ifTrue: |
|
454 |
[cs addAll: (self fromFileOrDirectory: each)]]. |
|
2881 | 455 |
cs name: aStringOfFilename asFilename asAbsoluteFilename pathName. |
2412 | 456 |
^cs |
457 |
||
458 |
||
459 |
" |
|
460 |
ChangeSet fromDirectory: (Smalltalk getPackageDirectoryForPackage:'stx:libbasic') |
|
461 |
" |
|
462 |
||
463 |
"Created: / 02-04-2011 / 00:54:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
464 |
! |
|
465 |
||
1182 | 466 |
fromDolphinPACStream:aStream |
467 |
"build a changeSet from a stream, containing dolphin pac file chunks." |
|
468 |
||
469 |
^ self fromDolphinPACStream:aStream while:[:thisChange | true] |
|
470 |
||
471 |
! |
|
472 |
||
473 |
fromDolphinPACStream:aStream while:aConditionBlock |
|
474 |
"build a changeSet from a stream, containing dolphin pac file chunks." |
|
475 |
||
476 |
|changeSet| |
|
477 |
||
478 |
changeSet := self new. |
|
479 |
self |
|
480 |
changesFromStream:aStream |
|
481 |
for:changeSet |
|
482 |
reader:(DolphinPACFileReader new) |
|
483 |
do:[:aChange :lineNumberOrNil :posOrNil | |
|
484 |
changeSet add:aChange. |
|
485 |
(aConditionBlock value:aChange) ifFalse:[^ changeSet]. |
|
486 |
]. |
|
487 |
||
488 |
^ changeSet |
|
489 |
! |
|
490 |
||
2894 | 491 |
fromFile:filenameOrString |
492 |
|filename mime stream changeSet| |
|
493 |
||
494 |
filename := filenameOrString asFilename. |
|
495 |
||
496 |
mime := MIMETypes mimeTypeForFilename:filename. |
|
1176 | 497 |
mime isNil ifTrue:[ |
2894 | 498 |
mime := filename mimeTypeOfContents. |
1176 | 499 |
mime isNil ifTrue:[ |
2894 | 500 |
"/ self error:'unknown MIME type for file' mayProceed:true. |
501 |
||
502 |
"/ assume chunk format |
|
503 |
mime := 'text/plain'. |
|
1176 | 504 |
]. |
505 |
]. |
|
930 | 506 |
|
1176 | 507 |
[ |
2894 | 508 |
stream := filename readStream. |
1176 | 509 |
mime = 'text/xml' ifTrue:[ |
2894 | 510 |
changeSet := self fromXMLStream:stream. |
511 |
] ifFalse:[ |
|
512 |
mime = 'application/x-smalltalk-source-sif' ifTrue:[ |
|
513 |
changeSet := self fromSIFStream:stream. |
|
514 |
] ifFalse:[ |
|
515 |
mime = 'application/x-smalltalk-dolphin-package' ifTrue:[ |
|
516 |
changeSet := self fromDolphinPACStream:stream. |
|
517 |
] ifFalse:[ |
|
518 |
stream := EncodedStream decodedStreamFor:stream. |
|
519 |
changeSet := self fromStream:stream. |
|
520 |
] |
|
521 |
] |
|
522 |
] |
|
1176 | 523 |
] ensure:[ |
524 |
stream notNil ifTrue:[stream close]. |
|
525 |
]. |
|
2894 | 526 |
changeSet name: filename baseName. |
527 |
^ changeSet |
|
1176 | 528 |
|
529 |
" |
|
2894 | 530 |
ChangeSet fromFile: 'st.chg' |
531 |
ChangeSet fromFile: 'patches' |
|
1176 | 532 |
" |
533 |
||
2868 | 534 |
"Created: / 16-02-1998 / 12:19:34 / cg" |
2894 | 535 |
"Modified (comment): / 28-07-2012 / 09:41:40 / cg" |
1176 | 536 |
! |
537 |
||
2412 | 538 |
fromFileOrDirectory: fileOrDirectory |
539 |
||
540 |
| f | |
|
541 |
f := fileOrDirectory asFilename. |
|
542 |
^(f isDirectory |
|
543 |
ifTrue:[self fromDirectory: f] |
|
544 |
ifFalse:[self fromFile: f]) |
|
545 |
name: f pathName; |
|
546 |
yourself. |
|
547 |
||
548 |
" |
|
549 |
ChangeSet fromFileOrDirectory: (Smalltalk getPackageDirectoryForPackage:'stx:libbasic') |
|
550 |
" |
|
551 |
||
552 |
"Created: / 02-04-2011 / 00:50:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
553 |
! |
|
554 |
||
1176 | 555 |
fromSIFStream:aStream |
556 |
"build a changeSet from a SIF stream, containing chunks |
|
557 |
in smalltalk interchange format. |
|
558 |
Return the changeSet." |
|
559 |
||
560 |
^ self fromSIFStream:aStream while:[:thisChange | true] |
|
561 |
! |
|
562 |
||
563 |
fromSIFStream:aStream while:aConditionBlock |
|
564 |
"build a changeSet from a SIF stream, containing chunks |
|
565 |
in smalltalk interchange format. |
|
566 |
Return the changeSet." |
|
567 |
||
568 |
|changeSet| |
|
569 |
||
570 |
changeSet := self new. |
|
571 |
self |
|
572 |
changesFromStream:aStream |
|
573 |
for:changeSet |
|
1182 | 574 |
reader:(SIFChangeFileReader new) |
1176 | 575 |
do:[:aChange :lineNumberOrNil :posOrNil | |
576 |
changeSet add:aChange. |
|
577 |
(aConditionBlock value:aChange) ifFalse:[^ changeSet]. |
|
578 |
]. |
|
579 |
||
580 |
^ changeSet |
|
581 |
! |
|
582 |
||
583 |
fromStream:aStream |
|
584 |
"build a changeSet from a stream, containing chunks. |
|
585 |
(i.e. either a classes sourceFile or a change-file). |
|
586 |
Return the changeSet." |
|
587 |
||
588 |
^ self fromStream:aStream while:[:thisChange | true] |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
589 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
590 |
" |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
591 |
ChangeSet fromStream:('changes' asFilename readStream) |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
592 |
ChangeSet fromStream:('patches' asFilename readStream) |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
593 |
ChangeSet fromStream:(Object source asString readStream) |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
594 |
" |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
595 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
596 |
"Created: / 16.2.1998 / 12:19:34 / cg" |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
597 |
"Modified: / 14.12.1999 / 15:23:16 / cg" |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
598 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
599 |
|
1176 | 600 |
fromStream:aStream while:aConditionBlock |
601 |
"build a changeSet from a stream, containing chunks. |
|
602 |
(i.e. either a classes sourceFile or a change-file). |
|
603 |
Return the changeSet." |
|
604 |
||
605 |
|changeSet| |
|
606 |
||
607 |
changeSet := self new. |
|
608 |
self |
|
609 |
changesFromStream:aStream |
|
610 |
for:changeSet |
|
1182 | 611 |
reader:(ChangeFileReader new) |
1176 | 612 |
do:[:aChange :lineNumberOrNil :posOrNil | |
613 |
changeSet add:aChange. |
|
614 |
(aConditionBlock value:aChange) ifFalse:[^ changeSet]. |
|
615 |
]. |
|
616 |
||
617 |
^ changeSet |
|
618 |
||
619 |
" |
|
620 |
ChangeSet fromStream:('changes' asFilename readStream) |
|
621 |
ChangeSet fromStream:('patches' asFilename readStream) |
|
622 |
ChangeSet fromStream:(Object source asString readStream) |
|
3246 | 623 |
ChangeSet fromStream:(XWorkstation source asString readStream) |
1176 | 624 |
" |
625 |
||
3246 | 626 |
"Created: / 16-02-1998 / 12:19:34 / cg" |
627 |
"Modified: / 14-12-1999 / 15:23:16 / cg" |
|
628 |
"Modified (comment): / 01-08-2012 / 15:24:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1176 | 629 |
! |
630 |
||
631 |
fromXMLStream:aStream |
|
632 |
"build a changeSet from an XML stream, containing XML definitions. |
|
633 |
Return the changeSet." |
|
634 |
||
635 |
|changeSet builder nameSpace| |
|
636 |
||
637 |
aStream isNil ifTrue:[^ nil]. |
|
638 |
||
639 |
changeSet := self new. |
|
640 |
nameSpace := Smalltalk. |
|
641 |
||
642 |
builder := XML::SourceScannerNodeBuilder new. |
|
1475
934d20073adb
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1471
diff
changeset
|
643 |
builder scanFile:aStream do:[:change | changeSet add: change. ]. |
1176 | 644 |
^ changeSet |
645 |
||
646 |
" |
|
1247 | 647 |
ChangeSet fromXMLStream:('../../goodies/xml/vw/xmlFileInTests/XMLParser.xml' asFilename readStream) |
1176 | 648 |
ChangeSetBrowser |
1247 | 649 |
openOn:(ChangeSet fromXMLStream:('../../goodies/xml/vw/xmlFileInTests/XMLParser.xml' asFilename readStream)) |
1176 | 650 |
" |
651 |
! ! |
|
652 |
||
1281 | 653 |
!ChangeSet class methodsFor:'Compatibility-ST80'! |
1176 | 654 |
|
655 |
patches |
|
656 |
^ #() |
|
657 |
||
658 |
"Created: / 27.10.1997 / 13:52:54 / cg" |
|
659 |
! ! |
|
660 |
||
3105 | 661 |
|
1281 | 662 |
!ChangeSet class methodsFor:'Compatibility-VW'! |
1176 | 663 |
|
664 |
component: component definition: anObject change: changeSymbol |
|
665 |
"Include indication that a class/namespace was added or removed |
|
666 |
from a CodeComponent." |
|
667 |
||
668 |
self |
|
669 |
changed:#'component:definition:change:' |
|
670 |
with: |
|
671 |
( Array |
|
672 |
with: component |
|
673 |
with: anObject |
|
674 |
with: changeSymbol |
|
675 |
) |
|
676 |
||
677 |
! ! |
|
678 |
||
679 |
!ChangeSet class methodsFor:'instance creation-private'! |
|
680 |
||
1191 | 681 |
changesFromStream:aStream do:aBlock |
682 |
"enumerate changes from a stream and invoke aBlock on each. |
|
683 |
The block is invoked with the change, a lineNumberOrNil and streamPosition arguments. |
|
684 |
The lineNumber is only valid, if the underlying stream |
|
685 |
provides line-numbers; otherwise, nil is passed." |
|
686 |
||
687 |
^ self |
|
688 |
changesFromStream:aStream |
|
689 |
for:(self new) |
|
690 |
reader:nil |
|
691 |
do:aBlock |
|
692 |
||
693 |
" |
|
694 |
ChangeSet |
|
695 |
changesFromStream:('changes' asFilename readStream) |
|
696 |
do:[:chg | Transcript showCR:chg] |
|
697 |
" |
|
698 |
||
699 |
"Created: / 16.2.1998 / 12:19:34 / cg" |
|
700 |
"Modified: / 14.12.1999 / 15:23:16 / cg" |
|
701 |
! |
|
702 |
||
1182 | 703 |
changesFromStream:aStream for:aChangeSet reader:aReader do:aBlock |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
704 |
"enumerate changes from a stream and invoke aBlock on each. |
1191 | 705 |
The block is invoked with the change, a lineNumberOrNil and streamPosition arguments. |
706 |
The lineNumber is only valid, if the underlying stream |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
707 |
provides line-numbers; otherwise, nil is passed." |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
708 |
|
2881 | 709 |
|chunk s change nameSpace package |
710 |
lineNumber pos reader size | |
|
930 | 711 |
|
712 |
nameSpace := Smalltalk. |
|
1135
08323691c543
care for package directive (remember)
Claus Gittinger <cg@exept.de>
parents:
1128
diff
changeset
|
713 |
package := Class packageQuerySignal query. |
1176 | 714 |
|
1182 | 715 |
(reader := aReader) isNil ifTrue:[ |
1176 | 716 |
reader := ChangeFileReader new. |
717 |
]. |
|
2893
5dfcb7f9f0da
Fix in reading changeset from file (for EncodedStream)
vrany
parents:
2892
diff
changeset
|
718 |
|
5dfcb7f9f0da
Fix in reading changeset from file (for EncodedStream)
vrany
parents:
2892
diff
changeset
|
719 |
(aStream isKindOf: EncodedStream) ifTrue:[ |
3246 | 720 |
"JV@2012-01-30: Argh!!!!!!!!!! guessEncodingFrom does not reset the position, somehow!! |
721 |
This is a HACK, somebody should fix it." |
|
722 |
aStream position ~~ 0 ifTrue:[ |
|
723 |
self breakPoint: #cg. |
|
724 |
aStream position: 0. |
|
725 |
]. |
|
3360 | 726 |
size := aStream stream size. |
2893
5dfcb7f9f0da
Fix in reading changeset from file (for EncodedStream)
vrany
parents:
2892
diff
changeset
|
727 |
] ifFalse:[ |
3360 | 728 |
size := aStream size. |
2893
5dfcb7f9f0da
Fix in reading changeset from file (for EncodedStream)
vrany
parents:
2892
diff
changeset
|
729 |
]. |
2881 | 730 |
|
1176 | 731 |
reader changeSet:aChangeSet. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
732 |
reader changeAction:aBlock. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
733 |
reader inputStream:aStream. |
930 | 734 |
|
735 |
[aStream atEnd] whileFalse:[ |
|
1182 | 736 |
aStream skipSeparators. |
930 | 737 |
lineNumber := aStream lineNumber. |
3376 | 738 |
pos := aStream position + 1. |
2881 | 739 |
|
740 |
ProgressNotification notify: nil progress:(100 / size) * pos. |
|
741 |
||
930 | 742 |
chunk := aStream nextChunk. |
2056 | 743 |
|
1447
2ac1cf09722b
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
1428
diff
changeset
|
744 |
(chunk notEmptyOrNil) ifTrue:[ |
2279
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
745 |
Class nameSpaceQuerySignal handle:[:ex| ex proceedWith:nameSpace] do:[ |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
746 |
Class packageQuerySignal handle:[:ex| ex proceedWith:package] do:[ |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
747 |
|parser tree ns pkg| |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
748 |
|
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
749 |
parser := Parser for:chunk. |
2930
389b51389fb1
comment/format in: #changesFromStream:for:reader:do:
Claus Gittinger <cg@exept.de>
parents:
2923
diff
changeset
|
750 |
"/ parser parseForCode. |
3157 | 751 |
Parser parseErrorSignal handle:[:ex | |
752 |
Transcript showCR:'ChangeSet: error while reading: ',ex description. |
|
753 |
tree := #Error. |
|
754 |
] do:[ |
|
755 |
tree := parser |
|
2279
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
756 |
parseExpressionWithSelf:nil |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
757 |
notifying:nil |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
758 |
ignoreErrors:true |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
759 |
ignoreWarnings:true |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
760 |
inNameSpace:nameSpace. |
3157 | 761 |
]. |
2279
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
762 |
tree notNil ifTrue:[ |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
763 |
tree == #Error ifTrue:[ |
3246 | 764 |
"/Hmm....it could be package-definition chunk in extensions container... |
765 |
((pkg := parser currentPackage) notNil |
|
766 |
and:[pkg ~~ package]) ifTrue:[ |
|
767 |
package := pkg |
|
768 |
] ifFalse:[ |
|
769 |
change := DoItChange new. |
|
770 |
change source:chunk. |
|
771 |
aBlock valueWithOptionalArgument:change and:lineNumber and:pos. |
|
772 |
]. |
|
2279
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
773 |
] ifFalse:[ |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
774 |
"/ if there is any nameSpace directive in there, extract it. |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
775 |
((ns := parser currentNameSpace) notNil |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
776 |
and:[ns ~~ nameSpace]) ifTrue:[ |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
777 |
nameSpace := ns |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
778 |
]. |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
779 |
"/ if there is any package directive in there, extract it. |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
780 |
((pkg := parser currentPackage) notNil |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
781 |
and:[pkg ~~ package]) ifTrue:[ |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
782 |
package := pkg |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
783 |
]. |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
784 |
"/ |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
785 |
"/ what type of chunk is this ... |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
786 |
"/ |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
787 |
tree isConstant ifTrue:[ |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
788 |
(s := tree evaluate) isString ifTrue:[ |
2881 | 789 |
(s startsWith:'---- ') ifTrue:[ |
790 |
reader inputStream: s readStream. |
|
791 |
reader processInfo: s. |
|
792 |
reader inputStream: aStream. |
|
793 |
]. |
|
930 | 794 |
] ifFalse:[ |
2279
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
795 |
self error:'unexpected change-chunk' mayProceed:true |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
796 |
] |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
797 |
] ifFalse:[ |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
798 |
tree isMessage ifTrue:[ |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
799 |
(reader |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
800 |
changesFromParseTree:tree |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
801 |
lineNumber:lineNumber |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
802 |
position:pos |
2745
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
803 |
chunk: chunk |
2279
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
804 |
) ifFalse:[ |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
805 |
change := DoItChange new. |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
806 |
change source:chunk. |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
807 |
aBlock valueWithOptionalArgument:change and:lineNumber and:pos. |
930 | 808 |
] |
2279
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
809 |
] ifFalse:[ |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
810 |
InvalidChangeChunkError |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
811 |
raiseRequestErrorString:'unexpected change-chunk' |
a85d31a33e57
changed: #changesFromStream:for:reader:do:
Stefan Vogel <sv@exept.de>
parents:
2256
diff
changeset
|
812 |
"/ mayProceed:true. |
930 | 813 |
] |
814 |
] |
|
815 |
] |
|
816 |
] |
|
817 |
] |
|
818 |
] |
|
819 |
] |
|
820 |
]. |
|
821 |
||
822 |
" |
|
823 |
ChangeSet fromStream:('changes' asFilename readStream) |
|
824 |
ChangeSet fromStream:('patches' asFilename readStream) |
|
825 |
ChangeSet fromStream:(Object source asString readStream) |
|
826 |
" |
|
827 |
||
2745
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
828 |
"Created: / 16-02-1998 / 12:19:34 / cg" |
3246 | 829 |
"Modified: / 30-01-2013 / 10:30:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3360 | 830 |
"Modified: / 30-07-2013 / 21:34:16 / cg" |
2881 | 831 |
! ! |
832 |
||
625
06f4ed35832b
added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
378
diff
changeset
|
833 |
!ChangeSet class methodsFor:'queries'! |
27 | 834 |
|
835 |
current |
|
836 |
"ST-80 compatibility: return the current changeSet" |
|
837 |
||
838 |
|p| |
|
839 |
||
840 |
(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
|
841 |
^ p changeSet |
ca4fff926135
ChangeSet current: return empty collection if there is no changeSet
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
842 |
]. |
ca4fff926135
ChangeSet current: return empty collection if there is no changeSet
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
843 |
^ #() |
27 | 844 |
|
845 |
" |
|
846 |
ChangeSet current |
|
847 |
" |
|
848 |
! ! |
|
849 |
||
2246 | 850 |
!ChangeSet class methodsFor:'utilities'! |
851 |
||
852 |
decodedStreamFor:aStream |
|
2247 | 853 |
<resource: #obsolete> |
854 |
^ EncodedStream decodedStreamFor:aStream |
|
2246 | 855 |
! ! |
856 |
||
1264 | 857 |
!ChangeSet methodsFor:'Compatibility-ST80'! |
378 | 858 |
|
899 | 859 |
changeClass:aClass |
3246 | 860 |
|
899 | 861 |
"dummy here" |
100 | 862 |
|
3246 | 863 |
"Created: / 04-02-2000 / 18:30:59 / cg" |
864 |
"Modified (format): / 05-09-2012 / 16:39:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
901 | 865 |
! |
866 |
||
1476 | 867 |
changeSelectors |
868 |
"return a collection of all selectors for which changes are in this changeSet" |
|
869 |
||
870 |
|selectors| |
|
871 |
||
872 |
changeSelectors isNil ifTrue:[ |
|
873 |
selectors := IdentitySet new. |
|
874 |
self do:[:chg | |
|
1967 | 875 |
|sel| |
1476 | 876 |
|
877 |
chg notNil ifTrue:[ |
|
878 |
chg isMethodChange ifTrue:[ |
|
1967 | 879 |
sel := chg selector. |
880 |
sel notNil ifTrue:[ |
|
881 |
selectors add:sel |
|
882 |
] |
|
1476 | 883 |
] |
884 |
] |
|
885 |
]. |
|
886 |
changeSelectors := selectors. |
|
887 |
]. |
|
888 |
^ changeSelectors. |
|
889 |
||
890 |
" |
|
891 |
ChangeSet current changeSelectors |
|
892 |
" |
|
1967 | 893 |
|
894 |
"Modified: / 30-05-2007 / 12:12:32 / cg" |
|
1476 | 895 |
! |
896 |
||
1102 | 897 |
changedClasses |
3246 | 898 |
"return a collection of all classes for which changes are in this changeSet" |
1102 | 899 |
|
900 |
|classes| |
|
901 |
||
1128
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
902 |
changedClasses isNil ifTrue:[ |
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
903 |
classes := IdentitySet new. |
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
904 |
self do:[:chg | |
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
905 |
|cls| |
1102 | 906 |
|
1315 | 907 |
chg notNil ifTrue:[ |
908 |
cls := chg changeClass. |
|
909 |
cls notNil ifTrue:[ |
|
1898 | 910 |
cls isRealNameSpace ifFalse:[ |
1315 | 911 |
classes add:cls |
912 |
] |
|
1128
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
913 |
] |
1102 | 914 |
] |
1128
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
915 |
]. |
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
916 |
changedClasses := classes. |
1102 | 917 |
]. |
1128
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
918 |
^ changedClasses. |
1102 | 919 |
|
920 |
" |
|
921 |
ChangeSet current changedClasses |
|
1791 | 922 |
ChangeSet current flushChangedClassesCache |
1102 | 923 |
" |
1791 | 924 |
|
1898 | 925 |
"Modified: / 10-11-2006 / 17:17:26 / cg" |
1102 | 926 |
! |
927 |
||
1096 | 928 |
component:component definition:anObject change:changeSymbol |
1083 | 929 |
"Include indication that a class/namespace was added or removed |
930 |
from a CodeComponent." |
|
931 |
||
932 |
self |
|
933 |
changed:#'component:definition:change:' |
|
934 |
with: |
|
935 |
( Array |
|
936 |
with: component |
|
937 |
with: anObject |
|
938 |
with: changeSymbol |
|
939 |
) |
|
940 |
! |
|
941 |
||
901 | 942 |
reorganizeSystem |
943 |
"dummy here" |
|
944 |
||
945 |
"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
|
946 |
! ! |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
947 |
|
2235 | 948 |
!ChangeSet methodsFor:'accessing'! |
949 |
||
950 |
name |
|
951 |
^ name |
|
952 |
! |
|
953 |
||
2868 | 954 |
name:aString |
955 |
name := aString. |
|
956 |
||
957 |
"Modified (format): / 28-07-2012 / 09:34:52 / cg" |
|
2235 | 958 |
! ! |
2234 | 959 |
|
985 | 960 |
!ChangeSet methodsFor:'change & update'! |
961 |
||
1096 | 962 |
changed:anAspectSymbol with:aParameter |
963 |
"Allow objects to depend on the ChangeSet class instead of a particular instance |
|
1099 | 964 |
of ChangeSet (which may be switched using projects)." |
985 | 965 |
|
1475
934d20073adb
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1471
diff
changeset
|
966 |
self == ChangeSet current ifTrue:[ |
934d20073adb
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1471
diff
changeset
|
967 |
ChangeSet changed:anAspectSymbol with:aParameter. |
934d20073adb
more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents:
1471
diff
changeset
|
968 |
]. |
1096 | 969 |
super changed:anAspectSymbol with:aParameter |
985 | 970 |
! ! |
971 |
||
901 | 972 |
!ChangeSet methodsFor:'changes management'! |
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
973 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
974 |
addClassCommentChangeFor:aClass |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
975 |
"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
|
976 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
977 |
|newChange| |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
978 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
979 |
newChange := ClassCommentChange class:aClass. |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
980 |
newChange comment:aClass comment. |
1128
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
981 |
self rememberChangedClass:aClass. |
1111
d4f353ffaa53
oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
982 |
self addChange:newChange |
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
983 |
|
1111
d4f353ffaa53
oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
984 |
"Modified: / 14.11.2001 / 13:35:34 / cg" |
100 | 985 |
! |
986 |
||
987 |
addClassDefinitionChangeFor:aClass |
|
378 | 988 |
"add a classDefinition change to the receiver" |
989 |
||
100 | 990 |
|newChange| |
991 |
||
1096 | 992 |
newChange := ClassDefinitionChange class:aClass source:(aClass definition). |
1865 | 993 |
newChange package:aClass package. |
1128
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
994 |
self rememberChangedClass:aClass. |
1111
d4f353ffaa53
oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
995 |
self addChange:newChange |
1096 | 996 |
|
1865 | 997 |
" |
998 |
(ChangeSet new addClassDefinitionChangeFor:ChangeSet) inspect |
|
999 |
" |
|
1000 |
||
1001 |
"Modified: / 12-10-2006 / 18:17:02 / cg" |
|
1096 | 1002 |
! |
1003 |
||
1232 | 1004 |
addClassRemoveChange:oldClass |
1096 | 1005 |
"add a classRemove change to the receiver" |
1006 |
||
1007 |
|newChange| |
|
1008 |
||
1232 | 1009 |
newChange := ClassRemoveChange new className:oldClass name. |
1281 | 1010 |
self rememberChangedClass:oldClass. |
1421 | 1011 |
oldClass isPrivate ifTrue:[ |
1012 |
self rememberChangedClass:oldClass topOwningClass. |
|
1013 |
]. |
|
1232 | 1014 |
ClassRemoveChange::ClassBeingRemovedQuery |
1015 |
answer:oldClass |
|
1016 |
do:[ |
|
1017 |
self addChange:newChange |
|
1018 |
] |
|
1111
d4f353ffaa53
oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
1019 |
"Modified: / 14.11.2001 / 13:35:39 / cg" |
1096 | 1020 |
! |
1021 |
||
1022 |
addClassRenameChangeFrom:oldName to:newName |
|
1023 |
"add a classRename change to the receiver" |
|
1024 |
||
1025 |
|newChange| |
|
1026 |
||
1027 |
newChange := ClassRenameChange new oldName:oldName newName:newName. |
|
1281 | 1028 |
self rememberChangedClass:(Smalltalk at:newName). |
1111
d4f353ffaa53
oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
1029 |
self addChange:newChange |
100 | 1030 |
|
1111
d4f353ffaa53
oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
1031 |
"Modified: / 14.11.2001 / 13:35:41 / cg" |
100 | 1032 |
! |
1033 |
||
1081 | 1034 |
addDoIt:aString |
1035 |
"add a doIt to the receiver" |
|
1036 |
||
1037 |
|newChange| |
|
1038 |
||
1096 | 1039 |
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
|
1040 |
self addChange:newChange. |
d4f353ffaa53
oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
1041 |
|
d4f353ffaa53
oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
1042 |
"Modified: / 14.11.2001 / 13:35:44 / cg" |
1081 | 1043 |
! |
1044 |
||
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
1045 |
addInstVarDefinitionChangeFor:aClass |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
1046 |
"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
|
1047 |
|
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
1048 |
|newChange| |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
1049 |
|
1096 | 1050 |
newChange := ClassInstVarDefinitionChange |
1051 |
class:aClass |
|
1052 |
source:(aClass name , ' instanceVariableNames:' , aClass instanceVariableString storeString). |
|
2617
a9e632776c57
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2524
diff
changeset
|
1053 |
newChange classInstVarNames:aClass instanceVariableString asCollectionOfWords. |
1128
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1054 |
self rememberChangedClass:aClass. |
1111
d4f353ffaa53
oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
1055 |
self addChange:newChange |
d4f353ffaa53
oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
1056 |
|
2617
a9e632776c57
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2524
diff
changeset
|
1057 |
"Modified: / 25-11-2011 / 17:38:42 / cg" |
889
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
1058 |
! |
6b05401d7184
more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents:
887
diff
changeset
|
1059 |
|
16 | 1060 |
addMethodCategoryChange:aMethod category:newCategory in:aClass |
378 | 1061 |
"add a methodCategory change to the receiver" |
1062 |
||
16 | 1063 |
|newChange| |
1064 |
||
1096 | 1065 |
newChange := MethodCategoryChange |
1066 |
class:aClass |
|
1067 |
selector:(aClass selectorAtMethod:aMethod) |
|
1068 |
category:newCategory. |
|
1128
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1069 |
self rememberChangedClass:aClass. |
1111
d4f353ffaa53
oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
1070 |
self addChange:newChange |
16 | 1071 |
|
1111
d4f353ffaa53
oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
1072 |
"Modified: / 14.11.2001 / 13:35:48 / cg" |
44 | 1073 |
! |
1074 |
||
956
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
1075 |
addMethodChange:aMethod fromOld:oldMethod in:aClass |
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
1076 |
"add a method change to the receiver" |
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
1077 |
|
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
1078 |
|newChange| |
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
1079 |
|
1096 | 1080 |
newChange := MethodChange |
1081 |
class:aClass |
|
1082 |
selector:aMethod selector |
|
1083 |
source:aMethod source |
|
1084 |
category:aMethod category. |
|
956
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
1085 |
oldMethod notNil ifTrue:[ |
1232 | 1086 |
newChange previousVersion:oldMethod. |
956
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
1087 |
]. |
1128
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1088 |
self rememberChangedClass:aClass. |
1111
d4f353ffaa53
oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
1089 |
self addChange:newChange. |
956
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
1090 |
|
1111
d4f353ffaa53
oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
1091 |
"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
|
1092 |
! |
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
1093 |
|
85 | 1094 |
addMethodChange:aMethod in:aClass |
378 | 1095 |
"add a method change to the receiver" |
1096 |
||
85 | 1097 |
|newChange| |
1098 |
||
1096 | 1099 |
newChange := MethodChange |
1100 |
class:aClass |
|
1101 |
selector:aMethod selector |
|
1102 |
source:aMethod source |
|
1103 |
category:aMethod category. |
|
1865 | 1104 |
newChange package:(aMethod package). |
1128
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1105 |
self rememberChangedClass:aClass. |
1111
d4f353ffaa53
oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
1106 |
self addChange:newChange |
378 | 1107 |
|
1865 | 1108 |
"Modified: / 12-10-2006 / 18:15:28 / cg" |
85 | 1109 |
! |
1110 |
||
1842
6ca4e98df305
method-package change record added
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
1111 |
addMethodPackageChange:aMethod package:newPackage in:aClass |
6ca4e98df305
method-package change record added
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
1112 |
"add a methodPackage change to the receiver" |
6ca4e98df305
method-package change record added
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
1113 |
|
2934
487294a18ae0
changed: #addMethodPackageChange:package:in:
Claus Gittinger <cg@exept.de>
parents:
2930
diff
changeset
|
1114 |
|newChange selector| |
487294a18ae0
changed: #addMethodPackageChange:package:in:
Claus Gittinger <cg@exept.de>
parents:
2930
diff
changeset
|
1115 |
|
487294a18ae0
changed: #addMethodPackageChange:package:in:
Claus Gittinger <cg@exept.de>
parents:
2930
diff
changeset
|
1116 |
selector := (aClass selectorAtMethod:aMethod). |
487294a18ae0
changed: #addMethodPackageChange:package:in:
Claus Gittinger <cg@exept.de>
parents:
2930
diff
changeset
|
1117 |
selector isNil ifTrue:[^ self]. |
1842
6ca4e98df305
method-package change record added
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
1118 |
|
6ca4e98df305
method-package change record added
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
1119 |
newChange := MethodPackageChange |
6ca4e98df305
method-package change record added
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
1120 |
class:aClass |
2934
487294a18ae0
changed: #addMethodPackageChange:package:in:
Claus Gittinger <cg@exept.de>
parents:
2930
diff
changeset
|
1121 |
selector:selector |
1842
6ca4e98df305
method-package change record added
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
1122 |
package:newPackage. |
6ca4e98df305
method-package change record added
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
1123 |
self rememberChangedClass:aClass. |
6ca4e98df305
method-package change record added
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
1124 |
self addChange:newChange |
6ca4e98df305
method-package change record added
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
1125 |
|
6ca4e98df305
method-package change record added
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
1126 |
"Created: / 09-10-2006 / 14:02:33 / cg" |
6ca4e98df305
method-package change record added
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
1127 |
! |
6ca4e98df305
method-package change record added
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
1128 |
|
44 | 1129 |
addMethodPrivacyChange:aMethod in:aClass |
378 | 1130 |
"add a methodPrivacy change to the receiver" |
1131 |
||
44 | 1132 |
|newChange| |
1133 |
||
1096 | 1134 |
newChange := MethodPrivacyChange |
1135 |
class:aClass |
|
1136 |
selector:(aClass selectorAtMethod:aMethod) |
|
1137 |
privacy:aMethod privacy. |
|
1128
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1138 |
self rememberChangedClass:aClass. |
1111
d4f353ffaa53
oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
1139 |
self addChange:newChange |
44 | 1140 |
|
1111
d4f353ffaa53
oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
1141 |
"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
|
1142 |
"Modified: / 14.11.2001 / 13:35:55 / cg" |
235 | 1143 |
! |
1144 |
||
1145 |
addPrimitiveDefinitionsChangeFor:aClass |
|
378 | 1146 |
"add a primitiveDefinitions change to the receiver" |
1147 |
||
235 | 1148 |
|newChange| |
1149 |
||
783 | 1150 |
newChange := ClassPrimitiveDefinitionsChange new |
1287 | 1151 |
class:aClass source:(aClass primitiveDefinitionsString). |
1128
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1152 |
self rememberChangedClass:aClass. |
1111
d4f353ffaa53
oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
1153 |
self addChange:newChange |
378 | 1154 |
|
1111
d4f353ffaa53
oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
1155 |
"Modified: / 14.11.2001 / 13:35:57 / cg" |
235 | 1156 |
! |
1157 |
||
1158 |
addPrimitiveFunctionsChangeFor:aClass |
|
378 | 1159 |
"add a primitiveFunctions change to the receiver" |
1160 |
||
235 | 1161 |
|newChange| |
1162 |
||
783 | 1163 |
newChange := ClassPrimitiveFunctionsChange new |
1287 | 1164 |
class:aClass source:(aClass primitiveFunctionsString). |
1128
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1165 |
self rememberChangedClass:aClass. |
1111
d4f353ffaa53
oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
1166 |
self addChange:newChange |
378 | 1167 |
|
1111
d4f353ffaa53
oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
1168 |
"Modified: / 14.11.2001 / 13:35:59 / cg" |
235 | 1169 |
! |
1170 |
||
1171 |
addPrimitiveVariablesChangeFor:aClass |
|
378 | 1172 |
"add a primitiveVariables change to the receiver" |
1173 |
||
235 | 1174 |
|newChange| |
1175 |
||
783 | 1176 |
newChange := ClassPrimitiveVariablesChange new |
1287 | 1177 |
class:aClass source:(aClass primitiveVariablesString). |
1128
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1178 |
self rememberChangedClass:aClass. |
1111
d4f353ffaa53
oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
1179 |
self addChange:newChange |
378 | 1180 |
|
1111
d4f353ffaa53
oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
1181 |
"Modified: / 14.11.2001 / 13:36:01 / cg" |
654 | 1182 |
! |
1183 |
||
1164
cecaa2229cab
removeSelector change: remember methods previous version
Claus Gittinger <cg@exept.de>
parents:
1156
diff
changeset
|
1184 |
addRemoveSelectorChange:aSelector fromOld:oldMethod in:aClass |
654 | 1185 |
"add a method-remove change to the receiver" |
1186 |
||
1187 |
|newChange| |
|
1188 |
||
1081 | 1189 |
newChange := MethodRemoveChange class:aClass selector:aSelector. |
1164
cecaa2229cab
removeSelector change: remember methods previous version
Claus Gittinger <cg@exept.de>
parents:
1156
diff
changeset
|
1190 |
oldMethod notNil ifTrue:[ |
1232 | 1191 |
newChange previousVersion:oldMethod. |
1164
cecaa2229cab
removeSelector change: remember methods previous version
Claus Gittinger <cg@exept.de>
parents:
1156
diff
changeset
|
1192 |
]. |
1128
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1193 |
self rememberChangedClass:aClass. |
1111
d4f353ffaa53
oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
1194 |
self addChange:newChange |
654 | 1195 |
|
1196 |
"Modified: / 27.8.1995 / 22:55:22 / claus" |
|
1197 |
"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
|
1198 |
"Modified: / 14.11.2001 / 13:36:04 / cg" |
901 | 1199 |
! |
1200 |
||
1201 |
addRenameCategoryChangeIn:aClass from:oldCategory to:newCategory |
|
1202 |
"add a category rename change to the receiver" |
|
1203 |
||
1204 |
|newChange| |
|
1205 |
||
1206 |
newChange := MethodCategoryRenameChange class:aClass. |
|
1207 |
newChange oldCategoryName:oldCategory newCategoryName:newCategory. |
|
1128
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1208 |
self rememberChangedClass:aClass. |
1111
d4f353ffaa53
oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
1209 |
self addChange:newChange |
1105
b27c0d72d7d0
avoid useless change notifications from #collect:, #select: etc.
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
1210 |
|
1111
d4f353ffaa53
oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents:
1105
diff
changeset
|
1211 |
"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
|
1212 |
! ! |
b27c0d72d7d0
avoid useless change notifications from #collect:, #select: etc.
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
1213 |
|
2376 | 1214 |
!ChangeSet methodsFor:'fileOut'! |
1215 |
||
1216 |
fileOutAs: aStringOrFilename |
|
1217 |
||
1218 |
| stream | |
|
1219 |
stream := aStringOrFilename asFilename writeStream. |
|
1220 |
[ self fileOutOn: stream ] |
|
1221 |
ensure: [stream close] |
|
1222 |
||
1223 |
"Created: / 05-12-2009 / 12:33:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1224 |
! |
|
1225 |
||
1226 |
fileOutOn: stream |
|
1227 |
||
1228 |
self do:[:chg|chg fileOutOn: stream] |
|
1229 |
||
1230 |
"Created: / 05-12-2009 / 12:32:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1231 |
! ! |
|
1232 |
||
85 | 1233 |
!ChangeSet methodsFor:'misc'! |
1234 |
||
1235 |
addPatch:nameOfPatch |
|
1236 |
"ignored for now - allows fileIn of ST-80 patch stuff .." |
|
1237 |
||
1238 |
^ self |
|
1239 |
! ! |
|
1240 |
||
1263 | 1241 |
!ChangeSet methodsFor:'private-accessing'! |
1098 | 1242 |
|
1128
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1243 |
addChange:aChange |
2053 | 1244 |
|changeClass| |
1245 |
||
1898 | 1246 |
aChange timeOfChangeIfKnown isNil ifTrue:[ |
1247 |
aChange timeStamp:(Timestamp now). |
|
1248 |
]. |
|
1249 |
||
1128
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1250 |
self add:aChange. |
1471 | 1251 |
changedClasses notNil ifTrue:[ |
2053 | 1252 |
(changeClass := aChange changeClass) notNil ifTrue:[ |
1253 |
changedClasses add:changeClass. |
|
1254 |
]. |
|
1471 | 1255 |
]. |
1476 | 1256 |
changeSelectors notNil ifTrue:[ |
1257 |
aChange isMethodChange ifTrue:[ |
|
1258 |
changeSelectors add:aChange selector. |
|
1259 |
]. |
|
1260 |
]. |
|
1232 | 1261 |
|
1262 |
"/ aChange sendChangeNotificationThroughSmalltalk. |
|
1128
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1263 |
self changed:#addChange: with:aChange. |
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1264 |
|
1898 | 1265 |
"Created: / 14-11-2001 / 13:35:11 / cg" |
1266 |
"Modified: / 10-11-2006 / 16:47:13 / cg" |
|
1128
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1267 |
! |
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1268 |
|
1479 | 1269 |
flushChangedClassesCache |
1270 |
changedClasses := changeSelectors := nil |
|
1271 |
||
1272 |
" |
|
1273 |
ChangeSet current flushChangedClassesCache |
|
1274 |
" |
|
1275 |
! |
|
1276 |
||
1128
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1277 |
rememberChangedClass:aClass |
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1278 |
changedClasses notNil ifTrue:[ |
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1279 |
changedClasses add:aClass |
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1280 |
]. |
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1281 |
! |
9e213e86c212
cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1282 |
|
1098 | 1283 |
removeAll:aCollection |
1301 | 1284 |
aCollection notEmpty ifTrue:[ |
1285 |
super removeAll:aCollection. |
|
1476 | 1286 |
changedClasses := changeSelectors := nil. |
1301 | 1287 |
self changed:#removeAll: with:aCollection. |
1288 |
] |
|
1421 | 1289 |
! |
1290 |
||
1291 |
unrememberChangedClasses |
|
1292 |
changedClasses := nil |
|
1098 | 1293 |
! ! |
1294 |
||
1034
cdc9ddc19155
added query for a class being in a changeSet
Claus Gittinger <cg@exept.de>
parents:
985
diff
changeset
|
1295 |
!ChangeSet methodsFor:'queries'! |
cdc9ddc19155
added query for a class being in a changeSet
Claus Gittinger <cg@exept.de>
parents:
985
diff
changeset
|
1296 |
|
2160
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1297 |
changedPackages |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1298 |
"return a collection of all packages for which changes are in this changeSet" |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1299 |
|
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1300 |
|classes changedPackages| |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1301 |
|
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1302 |
changedPackages := Set new. |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1303 |
|
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1304 |
self do:[:chg | |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1305 |
|p mthd cls| |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1306 |
|
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1307 |
p := chg package. |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1308 |
p isNil ifTrue:[ |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1309 |
chg isMethodChange ifTrue:[ |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1310 |
mthd := chg changeMethod. |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1311 |
mthd notNil ifTrue:[ |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1312 |
p := mthd package. |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1313 |
] ifFalse:[ |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1314 |
cls := chg changeClass. |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1315 |
cls notNil ifTrue:[ |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1316 |
p := cls package. |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1317 |
] |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1318 |
] |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1319 |
] ifFalse:[ |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1320 |
chg isClassChange ifTrue:[ |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1321 |
cls := chg changeClass. |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1322 |
cls notNil ifTrue:[ |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1323 |
p := cls package. |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1324 |
] |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1325 |
] |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1326 |
]. |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1327 |
]. |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1328 |
p notNil ifTrue:[ |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1329 |
changedPackages add:p. |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1330 |
] |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1331 |
]. |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1332 |
|
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1333 |
"/ self changedClasses do:[:cls | |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1334 |
"/ |p| |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1335 |
"/ |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1336 |
"/ (p := cls package) notNil ifTrue:[ |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1337 |
"/ changedPackages add:p. |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1338 |
"/ ] |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1339 |
"/ ]. |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1340 |
^ changedPackages. |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1341 |
|
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1342 |
" |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1343 |
ChangeSet current changedPackages |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1344 |
" |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1345 |
|
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1346 |
"Created: / 22-09-2006 / 16:37:40 / cg" |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1347 |
"Modified: / 13-10-2006 / 01:20:48 / cg" |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1348 |
! |
831832c4c164
oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
1349 |
|
2412 | 1350 |
changesForPackage:aPackageSymbol |
2852 | 1351 |
^(self select:[:aChange | |
1352 |
|includeThis mClass mthd| |
|
1353 |
||
1354 |
includeThis := false. |
|
1355 |
(aChange isMethodChange or:[aChange isMethodRemoveChange]) ifTrue:[ |
|
1356 |
mClass := aChange changeClass. |
|
1357 |
mClass notNil ifTrue:[ |
|
1358 |
mthd := mClass compiledMethodAt:(aChange selector). |
|
1359 |
mthd isNil ifTrue:[ |
|
1360 |
aChange isMethodRemoveChange ifTrue:[ |
|
1361 |
includeThis := (mClass package = aPackageSymbol) |
|
1362 |
]. |
|
1363 |
] ifFalse:[ |
|
1364 |
includeThis := (mthd package = aPackageSymbol) |
|
1365 |
] |
|
1366 |
]. |
|
1367 |
] ifFalse:[ |
|
1368 |
(aChange isClassChange) ifTrue:[ |
|
1369 |
(aChange changeClass notNil) ifTrue:[ |
|
1370 |
includeThis := (aChange changeClass package = aPackageSymbol) |
|
1371 |
]. |
|
1372 |
]. |
|
1373 |
]. |
|
1374 |
includeThis |
|
1375 |
]) |
|
2412 | 1376 |
|
1377 |
" |
|
2852 | 1378 |
ChangeSet current changesForPackage:#'stx:goodies/libsvn' |
1379 |
" |
|
2412 | 1380 |
|
1381 |
"Created: / 05-11-2001 / 14:21:17 / cg" |
|
1382 |
"Modified: / 12-10-2006 / 16:51:27 / cg" |
|
1383 |
"Modified: / 22-10-2008 / 13:25:02 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
2852 | 1384 |
"Modified (comment): / 26-07-2012 / 11:54:00 / cg" |
2412 | 1385 |
! |
1386 |
||
1034
cdc9ddc19155
added query for a class being in a changeSet
Claus Gittinger <cg@exept.de>
parents:
985
diff
changeset
|
1387 |
includesChangeForClass:aClass |
1096 | 1388 |
|nameOfClass| |
1085 | 1389 |
|
1390 |
nameOfClass := aClass theNonMetaclass name. |
|
3309 | 1391 |
^ self includesChangeForClassNamed:nameOfClass |
1085 | 1392 |
|
1393 |
" |
|
1394 |
ChangeSet current includesChangeForClass:ChangeSet |
|
1096 | 1395 |
ChangeSet current includesChangeForClass:ChangeSet class |
1686 | 1396 |
ChangeSet current includesChangeForClass:SourceCodeManagerUtilities |
1918
1f3fcb411307
do not check for identical class being in changeSet -
boris
parents:
1898
diff
changeset
|
1397 |
ChangeSet current includesChangeForClass:(Expecco::ExpeccoXMLDecoder::ObjectCreator) |
1085 | 1398 |
" |
1399 |
||
1842
6ca4e98df305
method-package change record added
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
1400 |
"Modified: / 09-10-2006 / 13:39:22 / cg" |
1085 | 1401 |
! |
1402 |
||
1403 |
includesChangeForClass:aClass selector:selector |
|
1918
1f3fcb411307
do not check for identical class being in changeSet -
boris
parents:
1898
diff
changeset
|
1404 |
|nameOfNonMetaClass nameOfClass| |
1f3fcb411307
do not check for identical class being in changeSet -
boris
parents:
1898
diff
changeset
|
1405 |
|
1478 | 1406 |
(self changeSelectors includes:selector) ifFalse:[^ false]. |
1476 | 1407 |
|
1918
1f3fcb411307
do not check for identical class being in changeSet -
boris
parents:
1898
diff
changeset
|
1408 |
nameOfNonMetaClass := aClass theNonMetaclass name. |
2973 | 1409 |
(self changedClasses contains:[:someClass | someClass theNonMetaclass name = nameOfNonMetaClass]) ifFalse:[^ false]. |
1918
1f3fcb411307
do not check for identical class being in changeSet -
boris
parents:
1898
diff
changeset
|
1410 |
|
1096 | 1411 |
nameOfClass := aClass name. |
1085 | 1412 |
|
1096 | 1413 |
^ self contains:[:aChange | |
1232 | 1414 |
selector = aChange selector |
1096 | 1415 |
ifFalse:[ |
1416 |
false |
|
1417 |
] ifTrue:[ |
|
1232 | 1418 |
nameOfClass = aChange className |
1096 | 1419 |
] |
1085 | 1420 |
] |
1421 |
||
1422 |
" |
|
1423 |
ChangeSet current includesChangeForClass:ChangeSet selector:#includesChangeForClass: |
|
1424 |
" |
|
1425 |
||
1426 |
"Created: / 31.10.2001 / 10:26:31 / cg" |
|
1427 |
"Modified: / 31.10.2001 / 10:59:49 / cg" |
|
1096 | 1428 |
! |
1429 |
||
3309 | 1430 |
includesChangeForClassNamed:aClassName |
1431 |
(self changedClasses contains:[:aClass | aClass theNonMetaclass name = aClassName]) ifFalse:[^ false]. |
|
1432 |
^ self contains:[:aChange | aChange className = aClassName] |
|
1433 |
||
1434 |
" |
|
1435 |
ChangeSet current includesChangeForClassNamed:'ChangeSet' |
|
1436 |
" |
|
1437 |
! |
|
1438 |
||
1096 | 1439 |
includesChangeForClassOrMetaclass:aClass |
1440 |
|nameOfClass nameOfMetaclass| |
|
1441 |
||
1442 |
nameOfClass := aClass theNonMetaclass name. |
|
1443 |
nameOfMetaclass := aClass theMetaclass name. |
|
1444 |
||
1920 | 1445 |
(self changedClasses contains:[:eachClass | eachClass theNonMetaclass name = nameOfClass]) ifFalse:[ |
1918
1f3fcb411307
do not check for identical class being in changeSet -
boris
parents:
1898
diff
changeset
|
1446 |
^ false. |
1f3fcb411307
do not check for identical class being in changeSet -
boris
parents:
1898
diff
changeset
|
1447 |
]. |
1f3fcb411307
do not check for identical class being in changeSet -
boris
parents:
1898
diff
changeset
|
1448 |
|
1f3fcb411307
do not check for identical class being in changeSet -
boris
parents:
1898
diff
changeset
|
1449 |
|
1920 | 1450 |
^ self contains:[:eachChange | |
1096 | 1451 |
|changeClassName| |
1452 |
||
1920 | 1453 |
changeClassName := eachChange className. |
1096 | 1454 |
changeClassName = nameOfClass or:[changeClassName = nameOfMetaclass] |
1455 |
] |
|
1842
6ca4e98df305
method-package change record added
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
1456 |
|
6ca4e98df305
method-package change record added
Claus Gittinger <cg@exept.de>
parents:
1830
diff
changeset
|
1457 |
"Modified: / 09-10-2006 / 13:40:29 / cg" |
1127
b009373b0feb
+includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1458 |
! |
b009373b0feb
+includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1459 |
|
b009373b0feb
+includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1460 |
includesChangeForClassOrMetaclassOrPrivateClassOf:aClass |
b009373b0feb
+includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1461 |
|nameOfClass nameOfMetaclass| |
b009373b0feb
+includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1462 |
|
b009373b0feb
+includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1463 |
nameOfClass := aClass theNonMetaclass name. |
b009373b0feb
+includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1464 |
nameOfMetaclass := aClass theMetaclass name. |
b009373b0feb
+includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1465 |
|
b009373b0feb
+includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1466 |
self do:[:aChange | |
b009373b0feb
+includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1467 |
|changeClassName changeClass| |
b009373b0feb
+includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1468 |
|
b009373b0feb
+includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1469 |
changeClassName := aChange className. |
b009373b0feb
+includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1470 |
(changeClassName = nameOfClass) ifTrue:[^ true]. |
b009373b0feb
+includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1471 |
(changeClassName = nameOfMetaclass) ifTrue:[^ true]. |
2845
914991e2dbd7
added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2819
diff
changeset
|
1472 |
|
1127
b009373b0feb
+includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1473 |
changeClass := aChange changeClass. |
b009373b0feb
+includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1474 |
(changeClass notNil |
b009373b0feb
+includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1475 |
and:[changeClass isPrivate |
b009373b0feb
+includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1476 |
and:[changeClass owningClass == aClass]]) ifTrue:[ |
b009373b0feb
+includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1477 |
^ true |
b009373b0feb
+includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1478 |
] |
b009373b0feb
+includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1479 |
]. |
b009373b0feb
+includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1480 |
^ false |
2845
914991e2dbd7
added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2819
diff
changeset
|
1481 |
|
914991e2dbd7
added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2819
diff
changeset
|
1482 |
"Modified (format): / 25-07-2012 / 16:50:26 / cg" |
1885 | 1483 |
! |
1484 |
||
2519 | 1485 |
includesChangeForClassOrMetaclassOrPrivateClassOfAny:aCollectionOfClasses |
1486 |
|namesOfClasses namesOfMetaclasses| |
|
1487 |
||
3176
bf3e3ac08152
Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents:
3174
diff
changeset
|
1488 |
namesOfClasses := (aCollectionOfClasses collect:[:eachClass | eachClass theNonMetaclass name]) asArray. |
bf3e3ac08152
Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents:
3174
diff
changeset
|
1489 |
namesOfMetaclasses := (aCollectionOfClasses collect:[:eachClass | eachClass theMetaclass name]) asArray. |
2519 | 1490 |
|
1491 |
self do:[:aChange | |
|
1492 |
|changeClassName changeClass| |
|
1493 |
||
1494 |
changeClassName := aChange className. |
|
1495 |
(namesOfClasses includes:changeClassName) ifTrue:[^ true]. |
|
1496 |
(namesOfMetaclasses includes:changeClassName) ifTrue:[^ true]. |
|
1497 |
||
1498 |
changeClass := aChange changeClass. |
|
1499 |
(changeClass notNil and:[changeClass isPrivate]) ifTrue:[ |
|
1500 |
(aCollectionOfClasses includes:changeClass owningClass) ifTrue:[ |
|
1501 |
^ true |
|
1502 |
]. |
|
1503 |
] |
|
1504 |
]. |
|
1505 |
^ false |
|
1506 |
||
1507 |
"Created: / 08-09-2011 / 04:24:26 / cg" |
|
1508 |
! |
|
1509 |
||
1885 | 1510 |
includesChangeForPackage:aPackageID |
1511 |
^ self changedPackages includes:aPackageID |
|
1512 |
||
1513 |
"/ ^ self contains:[:aChange | aChange package = aPackageID] |
|
1514 |
||
1515 |
" |
|
1516 |
ChangeSet current includesChangeForPackage:'stx:libbasic' |
|
1517 |
" |
|
1518 |
||
1519 |
"Created: / 25-10-2006 / 18:06:55 / cg" |
|
2519 | 1520 |
! |
1521 |
||
3378 | 1522 |
selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:aCollectionOfClasses |
1523 |
"return the set of classes from a given collection, for which I have changes." |
|
1524 |
||
2845
914991e2dbd7
added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2819
diff
changeset
|
1525 |
|selected alreadyProcessed classes prev| |
914991e2dbd7
added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2819
diff
changeset
|
1526 |
|
3378 | 1527 |
classes := (aCollectionOfClasses |
1528 |
collect:[:eachClass | eachClass theNonMetaclass]) as:IdentitySet. |
|
1529 |
||
1530 |
selected := IdentitySet new. |
|
1531 |
alreadyProcessed := IdentitySet new. |
|
2845
914991e2dbd7
added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2819
diff
changeset
|
1532 |
|
914991e2dbd7
added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2819
diff
changeset
|
1533 |
self do:[:eachChange | |
914991e2dbd7
added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2819
diff
changeset
|
1534 |
|changeClassName changeClass isIn| |
914991e2dbd7
added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2819
diff
changeset
|
1535 |
|
914991e2dbd7
added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2819
diff
changeset
|
1536 |
changeClass := eachChange changeClass. |
3378 | 1537 |
(changeClass notNil and:[changeClass ~~ prev]) ifTrue:[ |
2845
914991e2dbd7
added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2819
diff
changeset
|
1538 |
changeClass := changeClass theNonMetaclass. |
3378 | 1539 |
(alreadyProcessed includes:changeClass) ifFalse:[ |
1540 |
(classes includes:changeClass) ifTrue:[ |
|
1541 |
selected add:changeClass |
|
2845
914991e2dbd7
added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2819
diff
changeset
|
1542 |
]. |
3378 | 1543 |
|
1544 |
"/ Care for private classes. If one of its owningClass |
|
1545 |
"/ is in the given collection, add **that owningClass** into |
|
1546 |
"/ result too!!!! |
|
1547 |
||
1548 |
changeClass isPrivate ifTrue:[ |
|
1549 |
|owner| |
|
1550 |
||
1551 |
owner := changeClass owningClass. |
|
1552 |
[owner notNil] whileTrue:[ |
|
1553 |
(classes includes:owner) ifTrue:[ |
|
1554 |
selected add:owner. |
|
1555 |
owner := nil. |
|
1556 |
] ifFalse:[ |
|
1557 |
owner := owner owningClass. |
|
1558 |
]. |
|
1559 |
]. |
|
1560 |
]. |
|
1561 |
alreadyProcessed add: changeClass. |
|
2845
914991e2dbd7
added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2819
diff
changeset
|
1562 |
]. |
914991e2dbd7
added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2819
diff
changeset
|
1563 |
prev := changeClass. |
3378 | 1564 |
]. |
2845
914991e2dbd7
added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2819
diff
changeset
|
1565 |
]. |
914991e2dbd7
added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2819
diff
changeset
|
1566 |
^ selected. |
2519 | 1567 |
|
2907
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1568 |
"Created: / 04-09-2012 / 14:01:37 / cg" |
3378 | 1569 |
"Modified: / 09-08-2013 / 12:40:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2907
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1570 |
! |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1571 |
|
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1572 |
selectForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:aCollectionOfClasses |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1573 |
"select changes for one of a given class. |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1574 |
Returns a collection of changes" |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1575 |
|
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1576 |
|selected classes | |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1577 |
|
3176
bf3e3ac08152
Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents:
3174
diff
changeset
|
1578 |
classes := (aCollectionOfClasses collect:[:eachClass | eachClass theNonMetaclass]) asArray. |
2907
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1579 |
|
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1580 |
selected := ChangeSet new. |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1581 |
|
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1582 |
self do:[:eachChange | |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1583 |
|changeClassName changeClass isIn| |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1584 |
|
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1585 |
changeClass := eachChange changeClass. |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1586 |
(changeClass notNil) ifTrue:[ |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1587 |
changeClass := changeClass theNonMetaclass. |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1588 |
((classes includes:changeClass) |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1589 |
or: [ |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1590 |
changeClass isPrivate |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1591 |
and: [ (classes includes:changeClass owningClass) ] |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1592 |
] |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1593 |
) ifTrue:[ |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1594 |
selected add: eachChange |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1595 |
]. |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1596 |
] |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1597 |
]. |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1598 |
^ selected. |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1599 |
|
2519 | 1600 |
"Created: / 08-09-2011 / 04:38:32 / cg" |
1034
cdc9ddc19155
added query for a class being in a changeSet
Claus Gittinger <cg@exept.de>
parents:
985
diff
changeset
|
1601 |
! ! |
cdc9ddc19155
added query for a class being in a changeSet
Claus Gittinger <cg@exept.de>
parents:
985
diff
changeset
|
1602 |
|
857 | 1603 |
!ChangeSet methodsFor:'utilities'! |
1604 |
||
878 | 1605 |
apply |
3222 | 1606 |
"apply all changes in the receiver's changeSet" |
878 | 1607 |
|
1608 |
self do:[:aChange | |
|
2376 | 1609 |
aChange apply |
878 | 1610 |
] |
1611 |
! |
|
1612 |
||
2412 | 1613 |
condenseChanges |
1614 |
| changesToRemove changesToKeep | |
|
2951 | 1615 |
|
2412 | 1616 |
changesToKeep := self class new. |
1617 |
changesToRemove := self class new. |
|
2951 | 1618 |
self reverseDo:[:change| |
1619 |
(changesToKeep anySatisfy:[:each|each isForSameAs: change]) |
|
1620 |
ifTrue:[changesToRemove add: change] |
|
1621 |
ifFalse:[changesToKeep add: change] |
|
1622 |
]. |
|
2412 | 1623 |
self condenseChanges: changesToRemove. |
1624 |
||
1625 |
"Created: / 22-10-2008 / 13:05:13 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1626 |
! |
|
1627 |
||
1865 | 1628 |
condenseChanges:changesToRemove |
1629 |
"remove the given changes - a helper for the rest of the condense protocol" |
|
1630 |
||
1631 |
changesToRemove notEmpty ifTrue:[ |
|
1632 |
changedClasses := changeSelectors := nil. |
|
1633 |
self removeAll:changesToRemove. |
|
2953
70c659738d00
comment/format in: #condenseChangesForRemoved
Claus Gittinger <cg@exept.de>
parents:
2952
diff
changeset
|
1634 |
"/ self changed. "/ -- removeAll already sends out a notification |
1865 | 1635 |
Smalltalk changed:#currentChangeSet with:self. |
1636 |
]. |
|
1637 |
||
1638 |
"Created: / 12-10-2006 / 16:51:11 / cg" |
|
1639 |
! |
|
1640 |
||
1096 | 1641 |
condenseChangesForClass:aClass |
1642 |
"remove all changes for aClass |
|
1643 |
(i.e. leave changes for other classes)." |
|
1644 |
||
1645 |
self condenseChangesForClass:aClass package:nil |
|
1646 |
! |
|
1647 |
||
878 | 1648 |
condenseChangesForClass:aClass package:aPackageSymbol |
1649 |
"remove all changes for aClass and aPackageSymbol |
|
1087
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1650 |
(i.e. leave methodChanges for other packages). |
956
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
1651 |
This is invoked when a class is checked into the repository." |
878 | 1652 |
|
1186
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1653 |
self condenseChangesForClass:aClass selector:nil package:aPackageSymbol |
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1654 |
|
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1655 |
"Modified: / 5.11.2001 / 14:29:22 / cg" |
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1656 |
! |
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1657 |
|
1830 | 1658 |
condenseChangesForClass:aClass selector:aSelector |
1659 |
"remove all changes for aClass >> selector." |
|
1660 |
||
1661 |
self condenseChangesForClass:aClass selector:aSelector package:nil |
|
1662 |
||
1663 |
"Created: / 26-09-2006 / 17:22:59 / cg" |
|
1664 |
! |
|
1665 |
||
1186
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1666 |
condenseChangesForClass:aClass selector:selectorOrNil package:aPackageSymbol |
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1667 |
"remove all changes for aClass/selector and aPackageSymbol |
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1668 |
(i.e. leave methodChanges for other packages). |
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1669 |
If selectorOrNil is nil, all changes for that class are removed; |
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1670 |
otherwise, only changes for the given selector. |
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1671 |
This is invoked when a class is checked into the repository." |
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1672 |
|
945
f9e349d38d49
care for metaclasses when condensing changeSet
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
1673 |
|changesToRemove className metaClassName chgCls| |
878 | 1674 |
|
945
f9e349d38d49
care for metaclasses when condensing changeSet
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
1675 |
className := aClass theNonMetaclass name. |
f9e349d38d49
care for metaclasses when condensing changeSet
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
1676 |
metaClassName := aClass theMetaclass name. |
1865 | 1677 |
|
1678 |
changesToRemove := self select:[:aChange | |
|
1087
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1679 |
|chgClassName chgClass removeThis mClass mthd| |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1680 |
|
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1681 |
removeThis := false. |
945
f9e349d38d49
care for metaclasses when condensing changeSet
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
1682 |
chgClassName := aChange className. |
1168 | 1683 |
(chgClassName = className or:[chgClassName = metaClassName]) ifTrue:[ |
1187
f63ecc7dbaff
condenseChange fixes (if baseClass or extensions are checked in)
Claus Gittinger <cg@exept.de>
parents:
1186
diff
changeset
|
1684 |
removeThis := true |
944
f4cb7e9b034b
when condensing, also care for private classes
Claus Gittinger <cg@exept.de>
parents:
939
diff
changeset
|
1685 |
] ifFalse:[ |
f4cb7e9b034b
when condensing, also care for private classes
Claus Gittinger <cg@exept.de>
parents:
939
diff
changeset
|
1686 |
chgCls := aChange changeClass. |
1718 | 1687 |
chgCls isNil ifTrue:[ |
1688 |
(chgClassName startsWith:(aClass name,':')) ifTrue:[ |
|
1689 |
"a change for a private class of a no-longer present one..." |
|
1690 |
removeThis := true |
|
1691 |
]. |
|
1692 |
]. |
|
1693 |
||
944
f4cb7e9b034b
when condensing, also care for private classes
Claus Gittinger <cg@exept.de>
parents:
939
diff
changeset
|
1694 |
(chgCls notNil |
f4cb7e9b034b
when condensing, also care for private classes
Claus Gittinger <cg@exept.de>
parents:
939
diff
changeset
|
1695 |
and:[chgCls isPrivate |
1190
02e2436893b6
condense after checkin: also condense sub-sub-private classes
Claus Gittinger <cg@exept.de>
parents:
1188
diff
changeset
|
1696 |
and:[chgCls topOwningClass == aClass]]) ifTrue:[ |
1087
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1697 |
removeThis := true |
944
f4cb7e9b034b
when condensing, also care for private classes
Claus Gittinger <cg@exept.de>
parents:
939
diff
changeset
|
1698 |
] |
1087
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1699 |
]. |
1186
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1700 |
selectorOrNil notNil ifTrue:[ |
1187
f63ecc7dbaff
condenseChange fixes (if baseClass or extensions are checked in)
Claus Gittinger <cg@exept.de>
parents:
1186
diff
changeset
|
1701 |
(aChange isMethodChange or:[aChange isMethodRemoveChange]) ifFalse:[ |
1186
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1702 |
removeThis := false. |
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1703 |
] ifTrue:[ |
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1704 |
aChange selector = selectorOrNil ifFalse:[ |
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1705 |
removeThis := false. |
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1706 |
]. |
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1707 |
] |
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1708 |
]. |
1187
f63ecc7dbaff
condenseChange fixes (if baseClass or extensions are checked in)
Claus Gittinger <cg@exept.de>
parents:
1186
diff
changeset
|
1709 |
|
1087
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1710 |
removeThis ifTrue:[ |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1711 |
aChange isMethodChange ifTrue:[ |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1712 |
mClass := aChange changeClass. |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1713 |
mClass notNil ifTrue:[ |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1714 |
mthd := mClass compiledMethodAt:(aChange selector). |
1096 | 1715 |
mthd isNil ifTrue:[ |
1716 |
"/ mthd does no longer exist |
|
1168 | 1717 |
"/ I no longer understand what this was meant for .. (sigh) |
1718 |
"/ aPackageSymbol notNil ifTrue:[ |
|
1719 |
"/ removeThis := false |
|
1720 |
"/ ] |
|
1096 | 1721 |
] ifFalse:[ |
1722 |
(aPackageSymbol notNil and:[mthd package ~= aPackageSymbol]) ifTrue:[ |
|
1723 |
removeThis := false |
|
1724 |
] |
|
1087
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1725 |
] |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1726 |
] |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1727 |
]. |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1728 |
]. |
1865 | 1729 |
removeThis |
1301 | 1730 |
]. |
1087
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1731 |
|
1865 | 1732 |
self condenseChanges:changesToRemove |
1733 |
||
1734 |
"Modified: / 12-10-2006 / 16:51:38 / cg" |
|
1087
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1735 |
! |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1736 |
|
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1737 |
condenseChangesForExtensionsInPackage:aPackageSymbol |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1738 |
"remove all changes for aClass and aPackageSymbol |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1739 |
(i.e. leave methodChanges for other packages). |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1740 |
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
|
1741 |
|
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1742 |
|changesToRemove| |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1743 |
|
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1744 |
changesToRemove := OrderedCollection new. |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1745 |
|
1865 | 1746 |
changesToRemove := self select:[:aChange | |
1087
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1747 |
|removeThis mClass mthd| |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1748 |
|
1187
f63ecc7dbaff
condenseChange fixes (if baseClass or extensions are checked in)
Claus Gittinger <cg@exept.de>
parents:
1186
diff
changeset
|
1749 |
(aChange isMethodChange or:[aChange isMethodRemoveChange]) ifTrue:[ |
1087
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1750 |
removeThis := false. |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1751 |
mClass := aChange changeClass. |
2954
610092201d2c
changed: #condenseChangesForExtensionsInPackage:
Claus Gittinger <cg@exept.de>
parents:
2953
diff
changeset
|
1752 |
(mClass notNil and:[mClass package ~= aPackageSymbol]) ifTrue:[ |
1087
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1753 |
mthd := mClass compiledMethodAt:(aChange selector). |
1187
f63ecc7dbaff
condenseChange fixes (if baseClass or extensions are checked in)
Claus Gittinger <cg@exept.de>
parents:
1186
diff
changeset
|
1754 |
mthd isNil ifTrue:[ |
f63ecc7dbaff
condenseChange fixes (if baseClass or extensions are checked in)
Claus Gittinger <cg@exept.de>
parents:
1186
diff
changeset
|
1755 |
aChange isMethodRemoveChange ifTrue:[ |
f63ecc7dbaff
condenseChange fixes (if baseClass or extensions are checked in)
Claus Gittinger <cg@exept.de>
parents:
1186
diff
changeset
|
1756 |
removeThis := true |
f63ecc7dbaff
condenseChange fixes (if baseClass or extensions are checked in)
Claus Gittinger <cg@exept.de>
parents:
1186
diff
changeset
|
1757 |
]. |
f63ecc7dbaff
condenseChange fixes (if baseClass or extensions are checked in)
Claus Gittinger <cg@exept.de>
parents:
1186
diff
changeset
|
1758 |
] ifFalse:[ |
f63ecc7dbaff
condenseChange fixes (if baseClass or extensions are checked in)
Claus Gittinger <cg@exept.de>
parents:
1186
diff
changeset
|
1759 |
mthd package = aPackageSymbol ifTrue:[ |
f63ecc7dbaff
condenseChange fixes (if baseClass or extensions are checked in)
Claus Gittinger <cg@exept.de>
parents:
1186
diff
changeset
|
1760 |
removeThis := true |
f63ecc7dbaff
condenseChange fixes (if baseClass or extensions are checked in)
Claus Gittinger <cg@exept.de>
parents:
1186
diff
changeset
|
1761 |
] |
1087
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1762 |
] |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1763 |
]. |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1764 |
]. |
1865 | 1765 |
removeThis |
1087
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1766 |
]. |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
1767 |
|
1865 | 1768 |
self condenseChanges:changesToRemove |
1769 |
||
1770 |
"Created: / 05-11-2001 / 14:21:17 / cg" |
|
1771 |
"Modified: / 12-10-2006 / 16:51:32 / cg" |
|
1772 |
! |
|
1773 |
||
1774 |
condenseChangesForPackage:aPackageSymbol |
|
1775 |
"remove all changes for aPackageSymbol |
|
1776 |
This is invoked when a project is checked into the repository." |
|
1777 |
||
1778 |
|changesToRemove| |
|
1779 |
||
1780 |
changesToRemove := self select:[:aChange | |
|
1781 |
|removeThis mClass mthd| |
|
1782 |
||
1783 |
removeThis := false. |
|
1784 |
(aChange isMethodChange or:[aChange isMethodRemoveChange]) ifTrue:[ |
|
1785 |
mClass := aChange changeClass. |
|
1786 |
mClass notNil ifTrue:[ |
|
1787 |
mthd := mClass compiledMethodAt:(aChange selector). |
|
1788 |
mthd isNil ifTrue:[ |
|
1789 |
aChange isMethodRemoveChange ifTrue:[ |
|
1790 |
removeThis := (mClass package = aPackageSymbol) |
|
1791 |
]. |
|
1792 |
] ifFalse:[ |
|
1793 |
removeThis := (mthd package = aPackageSymbol) |
|
1794 |
] |
|
1795 |
]. |
|
1796 |
] ifFalse:[ |
|
1797 |
(aChange isClassChange) ifTrue:[ |
|
1883 | 1798 |
(aChange changeClass notNil) ifTrue:[ |
1799 |
removeThis := (aChange changeClass package = aPackageSymbol) |
|
1800 |
]. |
|
1865 | 1801 |
]. |
1802 |
]. |
|
1803 |
removeThis |
|
1521
ea6cb41e4523
send out a change notification, when I condensed
Claus Gittinger <cg@exept.de>
parents:
1479
diff
changeset
|
1804 |
]. |
ea6cb41e4523
send out a change notification, when I condensed
Claus Gittinger <cg@exept.de>
parents:
1479
diff
changeset
|
1805 |
|
1865 | 1806 |
self condenseChanges:changesToRemove |
1807 |
||
1521
ea6cb41e4523
send out a change notification, when I condensed
Claus Gittinger <cg@exept.de>
parents:
1479
diff
changeset
|
1808 |
"Created: / 05-11-2001 / 14:21:17 / cg" |
1865 | 1809 |
"Modified: / 12-10-2006 / 16:51:27 / cg" |
878 | 1810 |
! |
1811 |
||
857 | 1812 |
diffSetsAgainst:anotherChangeSet |
1813 |
"walk over the receiver and anotherChangeSet, |
|
1814 |
add all changes to one of the tree lists: |
|
946 | 1815 |
onlyInReceiver, onlyInArg or changed, |
1816 |
each being a changeSet containing corresponding changes. |
|
1867 | 1817 |
WARNING: |
1818 |
destructive; could modify both the receiver and the argument by possibly |
|
2633 | 1819 |
changing methodChanges into categoryChanges" |
857 | 1820 |
|
1200
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1821 |
|otherChangeIndicesBySelector otherNonMethodChangeIndices changeIndicesBySelector nonMethodChangeIndices |
2881 | 1822 |
onlyInReceiver onlyInArg changedMethods same |
857 | 1823 |
indexFromChangedMethodsToA indexFromChangedMethodsToB |
864 | 1824 |
"info" ret| |
857 | 1825 |
|
1826 |
onlyInReceiver := ChangeSet new. |
|
1827 |
onlyInArg := ChangeSet new. |
|
1828 |
changedMethods := ChangeSet new. |
|
2881 | 1829 |
same := ChangeSet new. |
857 | 1830 |
|
1831 |
indexFromChangedMethodsToA := OrderedCollection new. |
|
1832 |
indexFromChangedMethodsToB := OrderedCollection new. |
|
1833 |
||
1200
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1834 |
otherChangeIndicesBySelector := Dictionary new. |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1835 |
otherNonMethodChangeIndices := OrderedCollection new. |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1836 |
|
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1837 |
"/ these caches reduces square runtime to almost linear... |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1838 |
anotherChangeSet keysAndValuesDo:[:idxB :aChangeInB | |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1839 |
|setOfOtherChangeIndicesForThisSelector| |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1840 |
|
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1841 |
aChangeInB isMethodChange ifTrue:[ |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1842 |
setOfOtherChangeIndicesForThisSelector := otherChangeIndicesBySelector at:(aChangeInB selector) ifAbsentPut:[OrderedCollection new]. |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1843 |
setOfOtherChangeIndicesForThisSelector add:idxB. |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1844 |
] ifFalse:[ |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1845 |
otherNonMethodChangeIndices add:idxB |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1846 |
]. |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1847 |
]. |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1848 |
|
857 | 1849 |
self keysAndValuesDo:[:idxA :aChangeInA | |
1200
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1850 |
|indicesOfChangesToExplore anyFound ch| |
857 | 1851 |
|
946 | 1852 |
anyFound := false. |
857 | 1853 |
|
1200
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1854 |
aChangeInA isMethodChange ifTrue:[ |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1855 |
indicesOfChangesToExplore := otherChangeIndicesBySelector at:(aChangeInA selector) ifAbsent:#() |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1856 |
] ifFalse:[ |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1857 |
indicesOfChangesToExplore := otherNonMethodChangeIndices. |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1858 |
]. |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1859 |
|
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1860 |
indicesOfChangesToExplore do:[:idxB | |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1861 |
|aChangeInB| |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1862 |
|
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1863 |
aChangeInB := anotherChangeSet at:idxB. |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1864 |
|
946 | 1865 |
(aChangeInA isForSameAs:aChangeInB) ifTrue:[ |
1866 |
anyFound := true. |
|
857 | 1867 |
|
946 | 1868 |
"/ also in B - is it different ? |
1869 |
(aChangeInA sameAs:aChangeInB) ifFalse:[ |
|
1870 |
changedMethods add:aChangeInA. |
|
1871 |
indexFromChangedMethodsToA add:idxA. |
|
1872 |
indexFromChangedMethodsToB add:idxB. |
|
1873 |
] ifTrue:[ |
|
1874 |
aChangeInA isMethodChange ifTrue:[ |
|
1875 |
aChangeInA methodCategory ~= aChangeInB methodCategory ifTrue:[ |
|
1876 |
"/ only the category is different; |
|
1877 |
"/ make it a MethodCategory changes. |
|
857 | 1878 |
|
946 | 1879 |
ch := MethodCategoryChange new |
1880 |
className:aChangeInA className |
|
1881 |
selector:aChangeInA selector |
|
2881 | 1882 |
category:aChangeInA methodCategory; |
1883 |
"JV@2012-03-20: Also keeps origin, required by merge tool" |
|
1884 |
origin: aChangeInA. |
|
946 | 1885 |
self at:idxA put:ch. |
857 | 1886 |
|
946 | 1887 |
ch := MethodCategoryChange new |
1888 |
className:aChangeInB className |
|
1889 |
selector:aChangeInB selector |
|
2881 | 1890 |
category:aChangeInB methodCategory; |
1891 |
"JV@2012-03-20: Also keeps origin, required by merge tool" |
|
1892 |
origin: aChangeInB. |
|
946 | 1893 |
anotherChangeSet at:idxB put:ch. |
857 | 1894 |
|
946 | 1895 |
changedMethods add:aChangeInA. |
1896 |
indexFromChangedMethodsToA add:idxA. |
|
1897 |
indexFromChangedMethodsToB add:idxB. |
|
1898 |
] |
|
1899 |
]. |
|
1900 |
] |
|
1901 |
] ifFalse:[ |
|
1902 |
(aChangeInA sameAs:aChangeInB) ifTrue:[ |
|
1903 |
anyFound := true. |
|
1904 |
] ifFalse:[ |
|
1905 |
] |
|
1906 |
] |
|
1907 |
]. |
|
857 | 1908 |
|
946 | 1909 |
anyFound ifFalse:[ |
1910 |
onlyInReceiver add:aChangeInA. |
|
1911 |
] |
|
857 | 1912 |
]. |
1913 |
||
1200
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1914 |
"/ these caches reduces square runtime to almost linear... |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1915 |
changeIndicesBySelector := Dictionary new. |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1916 |
nonMethodChangeIndices := OrderedCollection new. |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1917 |
|
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1918 |
self keysAndValuesDo:[:idxA :aChangeInA | |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1919 |
|setOfChangeIndicesForThisSelector| |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1920 |
|
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1921 |
aChangeInA isMethodChange ifTrue:[ |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1922 |
setOfChangeIndicesForThisSelector := changeIndicesBySelector at:(aChangeInA selector) ifAbsentPut:[OrderedCollection new]. |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1923 |
setOfChangeIndicesForThisSelector add:idxA. |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1924 |
] ifFalse:[ |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1925 |
nonMethodChangeIndices add:idxA |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1926 |
]. |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1927 |
]. |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1928 |
|
857 | 1929 |
anotherChangeSet keysAndValuesDo:[:idxB :aChangeInB | |
1200
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1930 |
|anyFound indicesOfChangesToExplore| |
857 | 1931 |
|
946 | 1932 |
anyFound := false. |
857 | 1933 |
|
1200
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1934 |
aChangeInB isMethodChange ifTrue:[ |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1935 |
indicesOfChangesToExplore := changeIndicesBySelector at:(aChangeInB selector) ifAbsent:#() |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1936 |
] ifFalse:[ |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1937 |
indicesOfChangesToExplore := nonMethodChangeIndices. |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1938 |
]. |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1939 |
|
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1940 |
indicesOfChangesToExplore do:[:idxA | |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1941 |
|aChangeInA idxM| |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1942 |
|
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1943 |
aChangeInA := self at:idxA. |
857 | 1944 |
|
946 | 1945 |
(aChangeInA isForSameAs:aChangeInB) ifTrue:[ |
1946 |
anyFound := true. |
|
857 | 1947 |
|
946 | 1948 |
"/ also in B - is it different ? |
1949 |
(aChangeInA sameAs:aChangeInB) ifFalse:[ |
|
1950 |
"/ already there ? |
|
1951 |
idxM := changedMethods findFirst:[:c | c isForSameAs:aChangeInB]. |
|
1952 |
idxM == 0 ifTrue:[ |
|
1953 |
changedMethods add:aChangeInB. |
|
1954 |
indexFromChangedMethodsToB add:idxB. |
|
1955 |
] ifFalse:[ |
|
1956 |
indexFromChangedMethodsToB at:idxM put:idxB |
|
1957 |
] |
|
1958 |
] |
|
1959 |
] ifFalse:[ |
|
1960 |
(aChangeInA sameAs:aChangeInB) ifTrue:[ |
|
1961 |
anyFound := true. |
|
1962 |
] ifFalse:[ |
|
1963 |
] |
|
1964 |
] |
|
1965 |
]. |
|
1966 |
anyFound ifFalse:[ |
|
1967 |
onlyInArg add:aChangeInB. |
|
1968 |
] |
|
857 | 1969 |
]. |
1970 |
||
864 | 1971 |
"/ info := OrderedCollection new:(changedMethods size). |
1972 |
"/ changedMethods keysAndValuesDo:[:idx :changedMethod | |
|
1973 |
"/ info add:(Array |
|
1974 |
"/ with:(indexFromChangedMethodsToA at:idx) |
|
1975 |
"/ with:(indexFromChangedMethodsToB at:idx) |
|
1976 |
"/ ) |
|
1977 |
"/ ]. |
|
1450 | 1978 |
changedMethods := (1 to:changedMethods size) asOrderedCollection collect:[:idx | |
946 | 1979 |
|cA cB| |
857 | 1980 |
|
946 | 1981 |
cA := self at:(indexFromChangedMethodsToA at:idx). |
1982 |
cB := anotherChangeSet at:(indexFromChangedMethodsToB at:idx). |
|
1983 |
Array with:cA with:cB |
|
1984 |
]. |
|
857 | 1985 |
|
2881 | 1986 |
same := self reject:[:chg|(changedMethods contains:[:pair|pair first == chg]) or:[onlyInReceiver includes: chg]]. |
1987 |
||
1156
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
1988 |
ret := DiffSet new |
1450 | 1989 |
changed:changedMethods |
1156
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
1990 |
onlyInReceiver:onlyInReceiver |
2881 | 1991 |
onlyInArg:onlyInArg |
1992 |
same: same. |
|
1156
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
1993 |
"/ ret info:info. |
864 | 1994 |
^ret |
1867 | 1995 |
|
1996 |
"Modified: / 12-10-2006 / 22:22:39 / cg" |
|
2633 | 1997 |
"Modified (comment): / 01-12-2011 / 19:12:55 / cg" |
2881 | 1998 |
"Modified: / 20-03-2012 / 22:05:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2323 | 1999 |
! |
2000 |
||
2412 | 2001 |
diffSetsAgainstImage |
2002 |
||
2003 |
|imageChangeSet| |
|
2004 |
||
2005 |
imageChangeSet := self class new. |
|
2006 |
self changedClasses do: |
|
2007 |
[:class| |
|
2008 |
(class isMetaclass or:[class isPrivate]) ifFalse: |
|
2009 |
[imageChangeSet addAll: |
|
2010 |
(self class fromStream: class source asString readStream)]]. |
|
2011 |
^self diffSetsAgainst: imageChangeSet |
|
2012 |
||
2013 |
"Created: / 04-12-2007 / 16:03:28 / janfrog" |
|
2014 |
! |
|
2015 |
||
2376 | 2016 |
flatten |
2017 |
||
2018 |
| flatten | |
|
2019 |
flatten := self class new: self size. |
|
2020 |
self do:[:ea|ea do:[:ea2|flatten add: ea2]]. |
|
2021 |
^flatten |
|
2022 |
||
2023 |
"Created: / 29-10-2010 / 14:40:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2024 |
! |
|
2025 |
||
2026 |
groupBy: groupBlock labelAs: labelBlock |
|
2027 |
||
2028 |
" |
|
2029 |
returns a new changeset consisting of CompositeChanges. |
|
2030 |
Changes are grouped together by value (tag) of groupBlock. |
|
2031 |
Each composite change is then labeled using label |
|
2032 |
returned by labelBlock (called with the tag returned |
|
2033 |
by groupBlock as arg) |
|
2034 |
" |
|
2035 |
||
2491
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2036 |
^ self groupBy: groupBlock labelAs: labelBlock sort: false |
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2037 |
|
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2038 |
"Created: / 24-07-2009 / 23:17:38 / Jan Vrany <vranyj1@fel.cvut.cz>" |
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2039 |
"Modified: / 25-07-2009 / 19:40:16 / Jan Vrany <vranyj1@fel.cvut.cz>" |
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2040 |
"Modified: / 29-10-2010 / 12:45:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2041 |
"Modified: / 30-08-2011 / 16:07:30 / cg" |
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2042 |
! |
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2043 |
|
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2044 |
groupBy: groupBlock labelAs: labelBlock sort: doSort |
2626
0ac000060c44
changed: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2617
diff
changeset
|
2045 |
"returns a new changeset consisting of CompositeChanges. |
0ac000060c44
changed: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2617
diff
changeset
|
2046 |
Changes are grouped together by value (tag) of groupBlock. |
0ac000060c44
changed: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2617
diff
changeset
|
2047 |
Each composite change is then labeled using label |
0ac000060c44
changed: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2617
diff
changeset
|
2048 |
returned by labelBlock (called with the tag returned |
0ac000060c44
changed: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2617
diff
changeset
|
2049 |
by groupBlock as arg)" |
2491
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2050 |
|
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2051 |
| buckets newChangeset keys | |
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2052 |
|
2376 | 2053 |
buckets := OrderedDictionary new. |
2852 | 2054 |
self do:[:change| |
2055 |
| tag | |
|
2056 |
||
2376 | 2057 |
tag := groupBlock value: change. |
2852 | 2058 |
(buckets at: tag ifAbsentPut: [self class new:4]) add: change |
2059 |
]. |
|
2060 |
newChangeset := self class new: buckets size. |
|
2491
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2061 |
|
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2062 |
keys := buckets keys select:[:k | k notNil]. |
2852 | 2063 |
doSort ifTrue:[ keys sort ]. |
2491
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2064 |
keys do:[:tag | |
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2065 |
|changes classDefs| |
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2066 |
|
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2067 |
changes := buckets at:tag. |
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2068 |
|
2852 | 2069 |
"Move class definition to the front" |
2070 |
classDefs := changes select:[:chg|chg isClassDefinitionChange]. |
|
2071 |
changes removeAll: classDefs. |
|
2072 |
changes addAllFirst: classDefs. |
|
2073 |
||
2074 |
tag notNil ifTrue:[ |
|
2075 |
newChangeset add: |
|
2076 |
(CompositeChange |
|
2077 |
name: (labelBlock value: tag) |
|
2078 |
changes: changes) |
|
2079 |
] |
|
2080 |
]. |
|
2626
0ac000060c44
changed: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2617
diff
changeset
|
2081 |
(buckets includesKey: nil) ifTrue:[ |
0ac000060c44
changed: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2617
diff
changeset
|
2082 |
newChangeset addAll: (buckets at: nil) |
0ac000060c44
changed: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2617
diff
changeset
|
2083 |
]. |
2376 | 2084 |
^newChangeset |
2085 |
||
2086 |
"Created: / 24-07-2009 / 23:17:38 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
2087 |
"Modified: / 25-07-2009 / 19:40:16 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
2088 |
"Modified: / 29-10-2010 / 12:45:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2491
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2089 |
"Created: / 30-08-2011 / 16:07:01 / cg" |
2376 | 2090 |
! |
2091 |
||
2092 |
groupByClass |
|
2491
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2093 |
|nm| |
2376 | 2094 |
|
2095 |
^self |
|
2491
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2096 |
groupBy: [:change| |
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2097 |
change isClassChange ifTrue: [ |
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2098 |
nm := change className. |
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2099 |
(nm endsWith:' class') ifTrue:[nm := nm copyTo: nm size - 6]. |
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2100 |
nm |
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2101 |
] ifFalse: [ |
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2102 |
nil |
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2103 |
] |
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2104 |
] |
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2105 |
labelAs: [:className| |
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2106 |
className |
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2107 |
] |
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2108 |
sort: true |
2376 | 2109 |
|
2110 |
"Created: / 25-07-2009 / 19:43:14 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
2111 |
"Modified: / 24-10-2009 / 18:49:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2491
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2112 |
"Modified: / 30-08-2011 / 16:08:38 / cg" |
2376 | 2113 |
! |
2114 |
||
2323 | 2115 |
saveSignedToFile:aFilename |
2116 |
"write the changeSet to a signed file in chunk format" |
|
2117 |
||
2118 |
self saveSignedToFile:aFilename format:nil |
|
2119 |
||
2120 |
"Created: / 08-02-2011 / 11:18:54 / cg" |
|
2121 |
! |
|
2122 |
||
2123 |
saveSignedToFile:aFilename format:formatSymbolOrNil |
|
2124 |
"write the changeSet to a signed file in some format. |
|
2125 |
Sign with the exept key (which you do not have outside of exept!!). |
|
2852 | 2126 |
Nil is chunk format (currently, the only supported)" |
2323 | 2127 |
|
2128 |
|s pkcs7SignedData| |
|
2129 |
||
2852 | 2130 |
self assert: (Smalltalk at:#'Expecco::KeyFileGenerator') notNil. |
2131 |
||
2323 | 2132 |
s := WriteStream on:(String new:2000). |
2133 |
self saveToStream:s format:formatSymbolOrNil. |
|
2134 |
||
2852 | 2135 |
pkcs7SignedData := (Smalltalk at:#'Expecco::KeyFileGenerator') new signExpeccoCode:s contents. |
2323 | 2136 |
aFilename asFilename contents:pkcs7SignedData. |
2137 |
||
2852 | 2138 |
"Modified (comment): / 26-07-2012 / 12:15:58 / cg" |
2323 | 2139 |
! |
2140 |
||
2141 |
saveToFile:aFilename |
|
2142 |
"write the changeSet to a regular file in chunk format" |
|
2143 |
||
2144 |
self saveToFile:aFilename format:nil |
|
2145 |
||
2146 |
"Created: / 08-02-2011 / 11:18:46 / cg" |
|
2147 |
! |
|
2148 |
||
2149 |
saveToFile:aFilename format:formatSymbolOrNil |
|
2881 | 2150 |
"Writes the changeSet to a regular file in some format. |
2151 |
Supported formats are: |
|
2152 |
nil ............ chunk changeset file |
|
2153 |
#classSource ... class fileout format, assumes that |
|
2154 |
the receiver is a changeset containing |
|
2155 |
single class (possibly with its private |
|
2156 |
classes) |
|
2157 |
" |
|
2323 | 2158 |
|
2159 |
|s| |
|
2160 |
||
2161 |
s := aFilename asFilename writeStream. |
|
2162 |
self saveToStream:s format:formatSymbolOrNil. |
|
2163 |
s close. |
|
2164 |
||
2165 |
"Created: / 08-02-2011 / 11:20:06 / cg" |
|
2881 | 2166 |
"Modified (comment): / 31-07-2012 / 13:38:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2323 | 2167 |
! |
2168 |
||
2169 |
saveToStream:aStream format:formatSymbolOrNil |
|
2881 | 2170 |
"Writes the changeSet to a stream in some format. |
2171 |
Supported formats are: |
|
2172 |
nil ............ chunk changeset file |
|
2173 |
#classSource ... class fileout format, assumes that |
|
2174 |
the receiver is a changeset containing |
|
2175 |
single class (possibly with its private |
|
2176 |
classes) |
|
2177 |
" |
|
2178 |
||
2323 | 2179 |
|
2180 |
formatSymbolOrNil isNil ifTrue:[ |
|
2181 |
self do:[:eachChange | |
|
2182 |
eachChange isMethodCodeChange ifTrue:[ |
|
3174 | 2183 |
aStream nextPutAll:'!!'; nextPutAll:(eachChange className); nextPutAll:' methodsFor: '. |
2323 | 2184 |
aStream nextPutAll:(eachChange methodCategory storeString). |
2185 |
aStream nextPutLine:'!!'. |
|
2186 |
aStream cr. |
|
2187 |
aStream nextPutAll:(eachChange source). |
|
2188 |
aStream nextPutLine:'!! !!'. |
|
2189 |
] ifFalse:[ |
|
2190 |
aStream nextPutAll:(eachChange source). |
|
2191 |
aStream nextPutLine:'!!'. |
|
2192 |
]. |
|
2469
4a02caf1782d
changed: #saveToStream:format:
Claus Gittinger <cg@exept.de>
parents:
2412
diff
changeset
|
2193 |
aStream cr. |
2323 | 2194 |
]. |
2852 | 2195 |
^ self |
2323 | 2196 |
]. |
2197 |
||
2881 | 2198 |
formatSymbolOrNil == #classSource ifTrue:[ |
2199 |
ClassSourceWriter new |
|
2200 |
fileOut:self |
|
2201 |
on:aStream |
|
2202 |
withTimeStamp:false |
|
2203 |
withInitialize:true |
|
2204 |
withDefinition:true |
|
2205 |
methodFilter:nil encoder:nil. |
|
2206 |
^self. |
|
2207 |
]. |
|
2208 |
||
2209 |
self error:'Unknown format, possible formats are { nil, #classSource }' |
|
2323 | 2210 |
|
2211 |
"Created: / 08-02-2011 / 11:25:16 / cg" |
|
2881 | 2212 |
"Modified: / 20-03-2012 / 14:06:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2213 |
"Modified (comment): / 31-07-2012 / 13:38:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
857 | 2214 |
! ! |
2215 |
||
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2216 |
!ChangeSet::ChangeFileReader methodsFor:'accessing'! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2217 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2218 |
changeAction:aBlock |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2219 |
changeAction := aBlock. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2220 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2221 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2222 |
changeSet:something |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2223 |
"set the value of the instance variable 'changeSet' (automatically generated)" |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2224 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2225 |
changeSet := something. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2226 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2227 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2228 |
inputStream:aStream |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2229 |
inputStream := aStream. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2230 |
! ! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2231 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2232 |
!ChangeSet::ChangeFileReader methodsFor:'helpers'! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2233 |
|
1176 | 2234 |
addChange:change |
2881 | 2235 |
|
2236 |
timestamp notNil ifTrue:[change timeStamp: timestamp]. |
|
2237 |
timestamp := nil. |
|
3246 | 2238 |
change isClassChange ifTrue:[ |
2239 |
change package: Class packageQuerySignal query. |
|
2240 |
]. |
|
2881 | 2241 |
|
2008 | 2242 |
changeAction |
2243 |
valueWithOptionalArgument:change |
|
2244 |
and:lineNumber |
|
2245 |
and:position. |
|
2246 |
||
3246 | 2247 |
"Modified: / 29-01-2013 / 19:32:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1176 | 2248 |
! |
2249 |
||
2250 |
checkReceiverIsGlobalNamed:expectedName |
|
2251 |
^ self variableNameOfReceiver = expectedName |
|
2252 |
! |
|
2253 |
||
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2254 |
classNameOf:aReceiver |
3184 | 2255 |
"old" |
2376 | 2256 |
|
3246 | 2257 |
| nameSpace isMeta clsNode clsName | |
2376 | 2258 |
nameSpace := Class nameSpaceQuerySignal query. |
2259 |
||
3246 | 2260 |
isMeta := false. |
2261 |
classIsJava := false. |
|
2262 |
||
2263 |
||
2264 |
(aReceiver isUnaryMessage and:[aReceiver selector == #class]) ifTrue:[ |
|
2265 |
isMeta := true. |
|
2266 |
clsNode := aReceiver receiver. |
|
2267 |
] ifFalse:[ |
|
2268 |
clsNode := aReceiver. |
|
2269 |
]. |
|
2270 |
||
2271 |
clsNode isMessage ifFalse:[ |
|
2272 |
"Normal smalltalk method on Smalltalk class" |
|
2273 |
clsName := clsNode name |
|
2274 |
] ifTrue:[ |
|
2275 |
"Maybe a Java class?" |
|
2276 |
((clsNode selector == #classForName:) and:[clsNode receiver name = 'Java']) ifTrue:[ |
|
2277 |
clsName := '(Java classForName:''%1'')' bindWith: clsNode arguments first value. |
|
2278 |
classIsJava := true. |
|
2279 |
]. |
|
2280 |
]. |
|
2281 |
||
2282 |
isMeta ifTrue:[ |
|
2283 |
clsName := clsName , ' class'. |
|
2284 |
]. |
|
2376 | 2285 |
|
3184 | 2286 |
(nameSpace ~~ Smalltalk and:[(clsName startsWith: nameSpace name) not]) |
2287 |
ifTrue:[ |
|
2288 |
^ nameSpace name , '::' , clsName |
|
2289 |
] ifFalse:[ |
|
2290 |
^ clsName |
|
2291 |
]. |
|
2292 |
||
3246 | 2293 |
"Modified: / 30-01-2013 / 10:02:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3184 | 2294 |
! |
2295 |
||
2296 |
classNameOfRememberingNamespace:aReceiver |
|
2297 |
"new" |
|
2298 |
||
3247
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2299 |
| nameSpace isMeta clsNode clsName | |
3184 | 2300 |
nameSpace := Class nameSpaceQuerySignal query. |
3195 | 2301 |
|
3247
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2302 |
isMeta := false. |
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2303 |
classIsJava := false. |
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2304 |
|
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2305 |
|
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2306 |
(aReceiver isUnaryMessage and:[aReceiver selector == #class]) ifTrue:[ |
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2307 |
isMeta := true. |
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2308 |
clsNode := aReceiver receiver. |
3197 | 2309 |
] ifFalse:[ |
3247
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2310 |
clsNode := aReceiver. |
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2311 |
]. |
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2312 |
|
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2313 |
clsNode isMessage ifFalse:[ |
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2314 |
"Normal smalltalk method on Smalltalk class" |
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2315 |
clsName := clsNode name |
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2316 |
] ifTrue:[ |
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2317 |
"Maybe a Java class?" |
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2318 |
((clsNode selector == #classForName:) and:[clsNode receiver name = 'Java']) ifTrue:[ |
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2319 |
clsName := '(Java classForName:''%1'')' bindWith: clsNode arguments first value. |
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2320 |
classIsJava := true. |
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2321 |
]. |
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2322 |
]. |
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2323 |
|
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2324 |
isMeta ifTrue:[ |
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2325 |
clsName := clsName , ' class'. |
3195 | 2326 |
]. |
3184 | 2327 |
|
2328 |
(nameSpace ~~ Smalltalk and:[(clsName startsWith: nameSpace name) not]) |
|
2329 |
ifTrue:[ |
|
2330 |
"/ old: remember namespace in name |
|
2331 |
"/ ^ nameSpace name , '::' , clsName |
|
2332 |
"/ new: remember in override |
|
2333 |
nameSpaceOverride := nameSpace. |
|
2334 |
^ clsName |
|
2335 |
] ifFalse:[ |
|
2336 |
nameSpaceOverride := nil. |
|
2337 |
^ clsName |
|
2338 |
]. |
|
2745
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2339 |
|
3247
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2340 |
"Modified: / 01-05-2013 / 17:57:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2341 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2342 |
|
2892 | 2343 |
extractMethodsClassAndSelectorFromReceiver |
2344 |
"helper for all changes which are of the form: |
|
2345 |
(className compiledMethodAt:#methodSelector) something: ... |
|
2346 |
" |
|
2347 |
||
2348 |
(receiver isMessage |
|
2349 |
and:[receiverSelector == #'compiledMethodAt:']) ifFalse:[ |
|
2350 |
self error:'unexpected change' mayProceed:true. |
|
2351 |
^ false. |
|
2352 |
]. |
|
3184 | 2353 |
|
2354 |
"/ className := self classNameOf:receiverReceiver. |
|
2355 |
className := self classNameOfRememberingNamespace:receiverReceiver. |
|
2892 | 2356 |
self assert:className notNil. |
2357 |
||
2358 |
methodSelector := (receiver arguments at:1) evaluate. |
|
2359 |
self assert:methodSelector notNil. |
|
2360 |
^ true. |
|
2361 |
||
2362 |
"Created: / 27-07-2012 / 21:33:47 / cg" |
|
2363 |
! |
|
2364 |
||
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2365 |
receiversClassName |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2366 |
^ self classNameOf:receiver |
1176 | 2367 |
! |
2368 |
||
3184 | 2369 |
receiversClassNameRememberingNamespace |
2370 |
^ self classNameOfRememberingNamespace:receiver |
|
2371 |
! |
|
2372 |
||
1176 | 2373 |
variableNameOfReceiver |
2374 |
||
2375 |
receiver isVariable ifFalse:[ ^ nil ]. |
|
2376 |
^ receiver name |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2377 |
! ! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2378 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2379 |
!ChangeSet::ChangeFileReader methodsFor:'reading'! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2380 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2381 |
changesFromParseTree:aTree lineNumber:initialLineNumberOrNil position:initialPositionOrNil |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2382 |
"given a parse-tree (from parsing some changes source/chunk), |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2383 |
create changes and evaluate changeAction on each. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2384 |
The chnageAction-block is invoked with the change and a lineNumberOrNil as |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2385 |
arg; the lineNumber is only valid, if the underlying inputStream |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2386 |
provides line-numbers; otherwise, nil is passed." |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2387 |
|
2745
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2388 |
^self changesFromParseTree:aTree lineNumber:initialLineNumberOrNil position:initialPositionOrNil chunk: nil |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2389 |
|
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2390 |
"Modified: / 24-01-2012 / 17:29:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2391 |
! |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2392 |
|
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2393 |
changesFromParseTree:aTree lineNumber:initialLineNumberOrNil position:initialPositionOrNil chunk: initialChunkOrNil |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2394 |
"given a parse-tree (from parsing some changes source/chunk), |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2395 |
create changes and evaluate changeAction on each. |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2396 |
The chnageAction-block is invoked with the change and a lineNumberOrNil as |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2397 |
arg; the lineNumber is only valid, if the underlying inputStream |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2398 |
provides line-numbers; otherwise, nil is passed." |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2399 |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2400 |
lineNumber := initialLineNumberOrNil. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2401 |
position := initialPositionOrNil. |
2745
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2402 |
chunk := initialChunkOrNil. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2403 |
parseTree := aTree. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2404 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2405 |
selector := aTree selector. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2406 |
receiver := aTree receiver. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2407 |
arguments := aTree arguments. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2408 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2409 |
receiver isMessage ifTrue:[ |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2410 |
receiverSelector := receiver selector. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2411 |
receiverReceiver := receiver receiver. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2412 |
]. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2413 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2414 |
^ self processChange |
2745
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2415 |
|
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2416 |
"Created: / 24-01-2012 / 17:28:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2417 |
! ! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2418 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2419 |
!ChangeSet::ChangeFileReader methodsFor:'reading-private'! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2420 |
|
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2421 |
handleCategoriesForChange |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2422 |
|selector category categories attributes change| |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2423 |
|
2256
b98137d2aa30
changed: #changesFromStream:for:reader:do:
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
2424 |
selector := arguments first value. |
3184 | 2425 |
className := self receiversClassNameRememberingNamespace. |
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2426 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2427 |
categories := OrderedCollection new. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2428 |
attributes := OrderedCollection new. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2429 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2430 |
[ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2431 |
inputStream skipSeparators. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2432 |
category := inputStream nextChunk. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2433 |
category notEmptyOrNil |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2434 |
] whileTrue:[ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2435 |
( #( 'public' 'private' ) includes: category) ifTrue:[ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2436 |
attributes add:category |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2437 |
] ifFalse:[ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2438 |
categories add:category |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2439 |
]. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2440 |
]. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2441 |
categories size == 1 ifTrue:[ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2442 |
"/ easy |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2443 |
change := MethodCategoryChange |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2444 |
className:className |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2445 |
selector:selector |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2446 |
source:(parseTree printString) |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2447 |
category:(categories first). |
3184 | 2448 |
change nameSpaceOverride:nameSpaceOverride. |
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2449 |
self addChange:change. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2450 |
] ifFalse:[ |
2298 | 2451 |
self halt:'multiple/missing categories not supported'. |
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2452 |
]. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2453 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2454 |
attributes size == 1 ifTrue:[ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2455 |
"/ easy |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2456 |
(attributes first = 'public') ifTrue:[ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2457 |
"/ default anyway - ignore |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2458 |
] ifFalse:[ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2459 |
change := MethodPrivacyChange |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2460 |
className:className |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2461 |
selector:selector |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2462 |
privacy:(attributes first asSymbol). |
3184 | 2463 |
change nameSpaceOverride:nameSpaceOverride. |
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2464 |
change source:(parseTree printString). |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2465 |
self addChange:change. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2466 |
]. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2467 |
] ifFalse:[ |
2298 | 2468 |
self halt:'multiple/missing attributes not supported'. |
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2469 |
]. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2470 |
^ true |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2471 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2472 |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2473 |
handleClassCommentChange |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2474 |
|change| |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2475 |
|
3184 | 2476 |
className := self receiversClassNameRememberingNamespace. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2477 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2478 |
change := ClassCommentChange new. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2479 |
change className:className comment:(arguments at:1) evaluate. |
3184 | 2480 |
change nameSpaceOverride:nameSpaceOverride. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2481 |
change source:(parseTree printString). |
1176 | 2482 |
self addChange:change. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2483 |
^ true |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2484 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2485 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2486 |
handleClassDefinitionChange |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2487 |
|nameSpace change| |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2488 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2489 |
className := (arguments at:1) evaluate. |
3184 | 2490 |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2491 |
nameSpace := Class nameSpaceQuerySignal query. |
3184 | 2492 |
(nameSpace == Smalltalk) ifTrue:[ nameSpace := nil ]. |
2493 |
||
2494 |
"/ old: remember namespace in className |
|
2495 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
|
2496 |
"/ className := nameSpace name , '::' , className |
|
2497 |
"/ ]. |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2498 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2499 |
change := ClassDefinitionChange new. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2500 |
change className:className; source:(parseTree printString). |
3184 | 2501 |
"/ new: remember in override |
2502 |
change nameSpaceOverride:nameSpace. |
|
1453 | 2503 |
receiver isVariable ifTrue:[ |
2504 |
change superClassName:receiver name. |
|
2505 |
]. |
|
1428
807f0bc05504
more state in classdefinition change
Claus Gittinger <cg@exept.de>
parents:
1422
diff
changeset
|
2506 |
selector keywords with:arguments do:[:kw :arg | |
807f0bc05504
more state in classdefinition change
Claus Gittinger <cg@exept.de>
parents:
1422
diff
changeset
|
2507 |
kw = #'instanceVariableNames:' ifTrue:[ |
807f0bc05504
more state in classdefinition change
Claus Gittinger <cg@exept.de>
parents:
1422
diff
changeset
|
2508 |
change instanceVariableNames:arg evaluate. |
807f0bc05504
more state in classdefinition change
Claus Gittinger <cg@exept.de>
parents:
1422
diff
changeset
|
2509 |
]. |
807f0bc05504
more state in classdefinition change
Claus Gittinger <cg@exept.de>
parents:
1422
diff
changeset
|
2510 |
kw = #'classVariableNames:' ifTrue:[ |
807f0bc05504
more state in classdefinition change
Claus Gittinger <cg@exept.de>
parents:
1422
diff
changeset
|
2511 |
change classVariableNames:arg evaluate. |
807f0bc05504
more state in classdefinition change
Claus Gittinger <cg@exept.de>
parents:
1422
diff
changeset
|
2512 |
]. |
807f0bc05504
more state in classdefinition change
Claus Gittinger <cg@exept.de>
parents:
1422
diff
changeset
|
2513 |
kw = #'poolDictionaries:' ifTrue:[ |
807f0bc05504
more state in classdefinition change
Claus Gittinger <cg@exept.de>
parents:
1422
diff
changeset
|
2514 |
change poolDictionaries:arg evaluate. |
807f0bc05504
more state in classdefinition change
Claus Gittinger <cg@exept.de>
parents:
1422
diff
changeset
|
2515 |
]. |
807f0bc05504
more state in classdefinition change
Claus Gittinger <cg@exept.de>
parents:
1422
diff
changeset
|
2516 |
kw = #'category:' ifTrue:[ |
807f0bc05504
more state in classdefinition change
Claus Gittinger <cg@exept.de>
parents:
1422
diff
changeset
|
2517 |
change category:arg evaluate. |
807f0bc05504
more state in classdefinition change
Claus Gittinger <cg@exept.de>
parents:
1422
diff
changeset
|
2518 |
]. |
2125 | 2519 |
kw = #'privateIn:' ifTrue:[ |
2290 | 2520 |
change className:(arg name ,'::',change classNameWithoutNamespace). |
2521 |
change owningClassName:(arg name). |
|
2522 |
change private:true. |
|
2125 | 2523 |
]. |
1428
807f0bc05504
more state in classdefinition change
Claus Gittinger <cg@exept.de>
parents:
1422
diff
changeset
|
2524 |
]. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2525 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2526 |
change package:(Class packageQuerySignal query). |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2527 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2528 |
"/ change nameSpaceName:(nameSpace name). |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2529 |
"/ ]. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2530 |
"/ |
1176 | 2531 |
self addChange:change. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2532 |
^ true |
2290 | 2533 |
|
2534 |
"Modified: / 30-08-2010 / 13:56:32 / cg" |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2535 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2536 |
|
3197 | 2537 |
handleClassInitializeChange |
2538 |
|change| |
|
2539 |
||
2540 |
change := DoItChange new source: chunk. |
|
2541 |
self addChange: change. |
|
2542 |
^ true |
|
2543 |
! |
|
2544 |
||
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2545 |
handleClassInstanceVariableDefinitionChange |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2546 |
|change| |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2547 |
|
3184 | 2548 |
className := self receiversClassNameRememberingNamespace. |
2549 |
||
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2550 |
change := ClassInstVarDefinitionChange new. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2551 |
change className:className. |
3184 | 2552 |
change nameSpaceOverride:nameSpaceOverride. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2553 |
change source:(parseTree printString). |
2617
a9e632776c57
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2524
diff
changeset
|
2554 |
change classInstVarNames:(parseTree arguments first value asCollectionOfWords asArray). |
1176 | 2555 |
self addChange:change. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2556 |
^ true |
2617
a9e632776c57
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2524
diff
changeset
|
2557 |
|
a9e632776c57
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2524
diff
changeset
|
2558 |
"Modified: / 25-11-2011 / 17:40:49 / cg" |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2559 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2560 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2561 |
handleMethodCategoryChange |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2562 |
|change| |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2563 |
|
2867
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
2564 |
self extractMethodsClassAndSelectorFromReceiver ifFalse:[ |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2565 |
^ false. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2566 |
]. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2567 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2568 |
change := MethodCategoryChange new. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2569 |
change |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2570 |
className:className |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2571 |
selector:methodSelector |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2572 |
category:(arguments at:1) evaluate. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2573 |
|
3184 | 2574 |
change nameSpaceOverride:nameSpaceOverride. |
1176 | 2575 |
self addChange:change. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2576 |
^ true |
2867
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
2577 |
|
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
2578 |
"Modified: / 27-07-2012 / 21:34:42 / cg" |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2579 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2580 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2581 |
handleMethodCategoryRenameChange |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2582 |
|change| |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2583 |
|
3184 | 2584 |
className := self receiversClassNameRememberingNamespace. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2585 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2586 |
change := MethodCategoryRenameChange new. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2587 |
change |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2588 |
className:className; |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2589 |
oldCategoryName:(arguments at:1) evaluate |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2590 |
newCategoryName:(arguments at:2) evaluate. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2591 |
|
3184 | 2592 |
change nameSpaceOverride:nameSpaceOverride. |
1176 | 2593 |
self addChange:change. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2594 |
^ true |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2595 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2596 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2597 |
handleMethodChange |
2745
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2598 |
[ |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2599 |
^ self handleMethodChangeUnsafe |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2600 |
] on: Error do:[:ex| |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2601 |
| change | |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2602 |
|
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2603 |
change := InvalidChange new source: chunk. |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2604 |
self addChange: change. |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2605 |
|
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2606 |
"Read methods that may follow" |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2607 |
|
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2608 |
[ (chunk := inputStream nextChunk) notEmptyOrNil ] whileTrue:[ |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2609 |
change := InvalidChange new source: chunk. |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2610 |
self addChange: change. |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2611 |
] |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2612 |
]. |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2613 |
|
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2614 |
^ true |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2615 |
|
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2616 |
"Modified (comment): / 24-01-2012 / 17:32:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2617 |
! |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2618 |
|
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2619 |
handleMethodChangeUnsafe |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2620 |
|priv categoryName methodSource changes change parser | |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2621 |
|
3184 | 2622 |
className := self receiversClassNameRememberingNamespace. |
2623 |
||
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2624 |
(selector == #'ignoredMethodsFor:') ifTrue:[ |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2625 |
priv := #ignored. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2626 |
] ifFalse:[ |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2627 |
priv := nil |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2628 |
]. |
3246 | 2629 |
classIsJava := false. |
1977 | 2630 |
((selector == #'methods') |
2631 |
or:[(selector == #'publicMethods') |
|
2632 |
or:[(selector == #'methodsFor')]]) ifTrue:[ |
|
2633 |
categoryName := 'uncategorized public' |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2634 |
] ifFalse:[ |
1977 | 2635 |
(selector == #'privateMethods') ifTrue:[ |
2636 |
categoryName := 'uncategorized private' |
|
2637 |
] ifFalse:[ |
|
2638 |
categoryName := (arguments at:1) evaluate. |
|
2639 |
] |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2640 |
]. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2641 |
inputStream skipSeparators. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2642 |
lineNumber := inputStream lineNumber. |
3376 | 2643 |
position := inputStream position + 1. |
1176 | 2644 |
|
2745
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2645 |
methodSource := chunk := inputStream nextChunk. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2646 |
changes := OrderedCollection new. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2647 |
|
1395
6ea99b157f6b
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
1389
diff
changeset
|
2648 |
[methodSource notEmptyOrNil] whileTrue:[ |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2649 |
parser := Parser |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2650 |
parseMethodArgAndVarSpecification:methodSource |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2651 |
in:nil |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2652 |
ignoreErrors:true |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2653 |
ignoreWarnings:true |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2654 |
parseBody:false. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2655 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2656 |
parser isNil ifTrue:[ |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2657 |
"/ something wierd ... |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2658 |
methodSelector := '????'. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2659 |
] ifFalse:[ |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2660 |
methodSelector := parser selector. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2661 |
]. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2662 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2663 |
change := MethodChange new. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2664 |
change |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2665 |
className:className |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2666 |
selector:methodSelector |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2667 |
source:methodSource |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2668 |
category:categoryName |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2669 |
privacy:priv. |
3248 | 2670 |
"/ huh - where is classIsJava: implemented??? |
2671 |
classIsJava ifTrue:[ change classIsJava: classIsJava ]. |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2672 |
|
3184 | 2673 |
change nameSpaceOverride:nameSpaceOverride. |
1176 | 2674 |
self addChange:change. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2675 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2676 |
inputStream skipSeparators. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2677 |
lineNumber := inputStream lineNumber. |
3376 | 2678 |
position := inputStream position + 1. |
2745
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2679 |
methodSource := chunk := inputStream nextChunk. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2680 |
]. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2681 |
^ true |
2745
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2682 |
|
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2683 |
"Created: / 24-01-2012 / 16:52:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3246 | 2684 |
"Modified: / 30-01-2013 / 09:57:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2685 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2686 |
|
2892 | 2687 |
handleMethodPackageChange |
2688 |
|change| |
|
2689 |
||
2690 |
self extractMethodsClassAndSelectorFromReceiver ifFalse:[ |
|
2691 |
^ false. |
|
2692 |
]. |
|
2693 |
||
2694 |
change := MethodPackageChange new. |
|
2695 |
change |
|
2696 |
className:className |
|
2697 |
selector:methodSelector |
|
2698 |
package:(arguments at:1) evaluate. |
|
2699 |
||
3184 | 2700 |
change nameSpaceOverride:nameSpaceOverride. |
2892 | 2701 |
self addChange:change. |
2702 |
^ true |
|
2703 |
||
2704 |
"Created: / 27-07-2012 / 21:31:25 / cg" |
|
2705 |
! |
|
2706 |
||
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2707 |
handleMethodPrivacyChange |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2708 |
|change| |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2709 |
|
2867
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
2710 |
self extractMethodsClassAndSelectorFromReceiver ifFalse:[ |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2711 |
^ false. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2712 |
]. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2713 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2714 |
change := MethodPrivacyChange new. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2715 |
change |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2716 |
className:className |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2717 |
selector:methodSelector |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2718 |
privacy:(arguments at:1) evaluate. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2719 |
|
3184 | 2720 |
change nameSpaceOverride:nameSpaceOverride. |
1176 | 2721 |
self addChange:change. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2722 |
^ true |
2867
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
2723 |
|
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
2724 |
"Modified: / 27-07-2012 / 21:35:20 / cg" |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2725 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2726 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2727 |
handleNameSpaceCreationChange |
1176 | 2728 |
|change| |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2729 |
|
1176 | 2730 |
(self checkReceiverIsGlobalNamed:#Namespace) ifFalse:[ |
2731 |
(self checkReceiverIsGlobalNamed:#NameSpace) ifFalse:[ |
|
2732 |
self error:'unexpected receiver in nameSpace message' mayProceed:true. |
|
2733 |
^ false |
|
2734 |
]. |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2735 |
]. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2736 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2737 |
className := (arguments at:1) evaluate. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2738 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2739 |
change := NameSpaceCreationChange new. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2740 |
change name:className. |
1176 | 2741 |
self addChange:change. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2742 |
^ true |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2743 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2744 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2745 |
handlePrimitiveChange |
3184 | 2746 |
self handlePrimitiveChange:nil |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2747 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2748 |
|
2892 | 2749 |
handlePrimitiveChange: sourceOrNil |
2750 |
"if sourceOrNil is nil, the def has not been read and must be read from |
|
2751 |
the next chunk. Otherwise, it has been already read as argument." |
|
2752 |
||
2753 |
|change primSource| |
|
2754 |
||
3184 | 2755 |
className := self receiversClassNameRememberingNamespace. |
2756 |
||
2892 | 2757 |
sourceOrNil notNil ifTrue:[ |
2758 |
primSource := sourceOrNil |
|
2759 |
] ifFalse:[ |
|
2760 |
inputStream skipSeparators. |
|
2761 |
primSource := inputStream nextChunk. |
|
2762 |
]. |
|
2763 |
||
2764 |
(selector == #'primitiveDefinitions' or:[ selector == #'primitiveDefinitions:' ]) ifTrue:[ |
|
2765 |
change := ClassPrimitiveDefinitionsChange new |
|
2766 |
] ifFalse:[ |
|
2767 |
(selector == #'primitiveFunctions' or:[ selector == #'primitiveFunctions:' ]) ifTrue:[ |
|
2768 |
change := ClassPrimitiveFunctionsChange new |
|
2769 |
] ifFalse:[ |
|
2770 |
change := ClassPrimitiveVariablesChange new |
|
2771 |
] |
|
2772 |
]. |
|
2773 |
change className:className source:primSource. |
|
3184 | 2774 |
change nameSpaceOverride:nameSpaceOverride. |
2892 | 2775 |
self addChange:change. |
2776 |
^ true |
|
2777 |
||
2778 |
"Created: / 27-07-2012 / 21:39:55 / cg" |
|
2779 |
! |
|
2780 |
||
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2781 |
handleRemoveClassChange |
1176 | 2782 |
|change| |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2783 |
|
1176 | 2784 |
(self checkReceiverIsGlobalNamed:#Smalltalk) ifFalse:[ |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2785 |
self error:'unexpected receiver in remove-class message' mayProceed:true. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2786 |
^ false |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2787 |
]. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2788 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2789 |
className := (arguments at:1) name. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2790 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2791 |
"/ className := nameSpace name , '::' , className |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2792 |
"/ ]. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2793 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2794 |
change := ClassRemoveChange new. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2795 |
change className:className. |
1176 | 2796 |
self addChange:change. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2797 |
^ true |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2798 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2799 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2800 |
handleRemoveMethodChange |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2801 |
|change| |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2802 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2803 |
className := self receiversClassName. |
3184 | 2804 |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2805 |
methodSelector := (arguments at:1) evaluate. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2806 |
change := MethodRemoveChange new. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2807 |
change className:className selector:methodSelector. |
1176 | 2808 |
self addChange:change. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2809 |
^ true |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2810 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2811 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2812 |
handleRenameClassChange |
1176 | 2813 |
|oldName newName change| |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2814 |
|
1176 | 2815 |
(self checkReceiverIsGlobalNamed:#Smalltalk) ifFalse:[ |
2816 |
self error:'unexpected receiver in rename-class message' mayProceed:true. |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2817 |
^ false. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2818 |
]. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2819 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2820 |
oldName := (arguments at:1) name. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2821 |
newName := (arguments at:2) evaluate. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2822 |
|
1176 | 2823 |
change := ClassRenameChange new oldName:oldName newName:newName. |
2824 |
self addChange:change. |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2825 |
^ true |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2826 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2827 |
|
1181
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
2828 |
handleSqueakCommentStamp |
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
2829 |
|comment change| |
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
2830 |
|
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
2831 |
inputStream skipSeparators. |
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
2832 |
|
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
2833 |
comment := inputStream nextChunk. |
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
2834 |
|
3184 | 2835 |
className := self receiversClassNameRememberingNamespace. |
2836 |
||
1181
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
2837 |
change := ClassCommentChange new. |
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
2838 |
change className:className comment:comment. |
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
2839 |
change source:(parseTree printString). |
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
2840 |
self addChange:change. |
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
2841 |
^ true |
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
2842 |
! |
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
2843 |
|
1183 | 2844 |
handleVW7ClassDefinitionChange |
2845 |
|nameSpace change| |
|
2846 |
||
2847 |
nameSpace := receiver. |
|
2848 |
className := (arguments at:1) evaluate. |
|
2849 |
||
2850 |
"/ nameSpace := Class nameSpaceQuerySignal query. |
|
2851 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
|
2852 |
"/ className := nameSpace name , '::' , className |
|
2853 |
"/ ]. |
|
2854 |
||
2855 |
change := ClassDefinitionChange new. |
|
2856 |
change className:className; source:(parseTree printString). |
|
2857 |
||
2858 |
change package:(Class packageQuerySignal query). |
|
2859 |
self addChange:change. |
|
2860 |
^ true |
|
2861 |
! |
|
2862 |
||
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2863 |
processChange |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2864 |
"given a parse-tree (from parsing some changes source/chunk), |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2865 |
create changes and evaluate changeAction on each. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2866 |
The block is invoked with the change and a lineNumberOrNil as |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2867 |
arg; the lineNumber is only valid, if the underlying stream |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2868 |
provides line-numbers; otherwise, nil is passed." |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2869 |
|
2745
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2870 |
[ |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2871 |
^ self processChangeUnsafe |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2872 |
] on: Error do:[:ex| |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2873 |
| change | |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2874 |
|
3197 | 2875 |
change := DoItChange new source: chunk. |
2745
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2876 |
self addChange: change. |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2877 |
]. |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2878 |
|
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2879 |
^true |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2880 |
|
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2881 |
"Modified: / 24-01-2012 / 17:34:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2882 |
! |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2883 |
|
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2884 |
processChangeUnsafe |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2885 |
"given a parse-tree (from parsing some changes source/chunk), |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2886 |
create changes and evaluate changeAction on each. |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2887 |
The block is invoked with the change and a lineNumberOrNil as |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2888 |
arg; the lineNumber is only valid, if the underlying stream |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2889 |
provides line-numbers; otherwise, nil is passed." |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2890 |
|
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2891 |
|dispatchSelector| |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2892 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2893 |
dispatchSelector := ('process_',(selector copyReplaceAll:$: with:$_)) asSymbol. |
2122 | 2894 |
"/ Transcript showCR:dispatchSelector. |
2179 | 2895 |
(self respondsTo:dispatchSelector) ifTrue:[ |
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2896 |
^ self perform:dispatchSelector. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2897 |
]. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2898 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2899 |
"/ any subclass definiton selector ? |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2900 |
(Behavior definitionSelectors includes:selector) |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2901 |
ifTrue:[ |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2902 |
^ self handleClassDefinitionChange. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2903 |
]. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2904 |
|
3195 | 2905 |
self error:'unhandled change selector: ',selector. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2906 |
^ false |
2745
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2907 |
|
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2908 |
"Created: / 24-01-2012 / 17:33:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2909 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2910 |
|
2881 | 2911 |
processInfo: string |
2912 |
"Processes 'info record' - an info record consist of a chunk containing |
|
2913 |
single string literal starting with ----, such as: |
|
2914 |
||
2915 |
'---- timestamp jv@neso 12-03-2012 10:49:40 ----' |
|
2916 |
'---- snapshot st.img 30-03-2012 11:40:24 ----' |
|
2917 |
'---- checkin SVN::ConfigurationApp into stx:libsvn (1.12) 12-03-2012 10:51:15 ----' |
|
2918 |
'---- rake update 30-03-2012 11:40:24 ----' |
|
2919 |
'---- start 30-03-2012 11:40:24 ----' |
|
2920 |
||
2921 |
timestamp info records are (for historical reasons) processed in ChangeSet |
|
2922 |
" |
|
2923 |
||
2924 |
| kind sel | |
|
2925 |
inputStream skip: 5. |
|
2926 |
kind := inputStream upTo: Character space. |
|
3184 | 2927 |
(kind endsWith:$:) ifTrue:[ |
3229
de46a97e1a0c
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
3222
diff
changeset
|
2928 |
kind := kind copyButLast:1 |
3184 | 2929 |
]. |
2881 | 2930 |
sel := ('process_', kind) asSymbolIfInterned. |
2931 |
sel notNil ifTrue:[ |
|
3184 | 2932 |
MessageNotUnderstood handle:[ |
2933 |
self process_otherInfo:kind |
|
2881 | 2934 |
] do:[ |
2935 |
self perform: sel. |
|
2936 |
] |
|
3184 | 2937 |
] ifFalse:[ |
2938 |
self process_otherInfo:kind |
|
2881 | 2939 |
] |
2940 |
||
2941 |
"Created: / 30-03-2012 / 16:44:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2942 |
! |
|
2943 |
||
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2944 |
process_categoriesFor_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2945 |
"'categoriesFor:' chunk (Dolphin)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2946 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2947 |
^ self handleCategoriesForChange. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2948 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2949 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2950 |
process_category_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2951 |
"'category:' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2952 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2953 |
^ self handleMethodCategoryChange. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2954 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2955 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2956 |
process_commentStamp_prior_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2957 |
"'commentStamp:prior::' chunk (Squeak)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2958 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2959 |
^ self handleSqueakCommentStamp. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2960 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2961 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2962 |
process_comment_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2963 |
"'comment:' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2964 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2965 |
^ self handleClassCommentChange. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2966 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2967 |
|
3184 | 2968 |
process_encoding |
2969 |
"St/X encoding info record. Ignored" |
|
2970 |
! |
|
2971 |
||
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2972 |
process_ignoredMethodsFor_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2973 |
"'ignoredMethodsFor:' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2974 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2975 |
^ self handleMethodChange. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2976 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2977 |
|
3197 | 2978 |
process_initialize |
2979 |
"'class initialize' chunk" |
|
2980 |
||
2981 |
^ self handleClassInitializeChange |
|
2982 |
! |
|
2983 |
||
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2984 |
process_instanceVariableNames_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2985 |
"'instanceVariableNames:' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2986 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2987 |
^ self handleClassInstanceVariableDefinitionChange. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2988 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2989 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2990 |
process_methods |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2991 |
"'methods' chunk (ST/V and dolphin)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2992 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2993 |
^ self handleMethodChange. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2994 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2995 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2996 |
process_methodsFor |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2997 |
"'methodsFor' chunk (ST/V and dolphin)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2998 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2999 |
^ self handleMethodChange. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3000 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3001 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3002 |
process_methodsForUndefined_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3003 |
"'methodsForUndefined:' chunk (?)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3004 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3005 |
^ self handleMethodChange. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3006 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3007 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3008 |
process_methodsFor_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3009 |
"'methodsFor:' chunk (ST/80, Squeak, ST/X, VW, ...)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3010 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3011 |
^ self handleMethodChange. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3012 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3013 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3014 |
process_methodsFor_stamp_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3015 |
"'methodsFor:stamp:' chunk (Squeak)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3016 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3017 |
^ self handleMethodChange. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3018 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3019 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3020 |
process_name_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3021 |
"'name:' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3022 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3023 |
^ self handleNameSpaceCreationChange. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3024 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3025 |
|
3184 | 3026 |
process_otherInfo:what |
3027 |
"'---- <what> 12-03-2012 10:49:40 ----' |
|
3028 |
||
3029 |
'<what>' is already read from inputStream. |
|
3030 |
" |
|
3031 |
||
3032 |
"/ inputStream skipSeparators. |
|
3033 |
self addChange: (InfoChange type: what data: (inputStream upToEnd) timestamp: nil) |
|
3034 |
||
3035 |
"Created: / 18-05-2012 / 17:03:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3036 |
! |
|
3037 |
||
2892 | 3038 |
process_package_ |
3039 |
"'package:' chunk (ST/X)" |
|
3040 |
||
3041 |
^ self handleMethodPackageChange. |
|
3042 |
||
3043 |
"Created: / 27-07-2012 / 21:36:30 / cg" |
|
3044 |
! |
|
3045 |
||
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3046 |
process_primitiveDefinitions |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3047 |
"'primitiveDefinitions' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3048 |
|
2867
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3049 |
^ self handlePrimitiveChange:nil. |
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3050 |
|
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3051 |
"Modified: / 27-07-2012 / 21:40:33 / cg" |
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3052 |
! |
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3053 |
|
2892 | 3054 |
process_primitiveDefinitions_ |
3055 |
"'primitiveDefinitions:' chunk (ST/X)" |
|
3056 |
||
3057 |
^ self handlePrimitiveChange: (arguments at:1) evaluate. |
|
3058 |
||
3059 |
"Created: / 27-07-2012 / 21:42:03 / cg" |
|
3060 |
! |
|
3061 |
||
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3062 |
process_primitiveFunctions |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3063 |
"'primitiveFunctions' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3064 |
|
2867
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3065 |
^ self handlePrimitiveChange:nil. |
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3066 |
|
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3067 |
"Modified: / 27-07-2012 / 21:40:23 / cg" |
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3068 |
! |
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3069 |
|
2892 | 3070 |
process_primitiveFunctions_ |
3071 |
"'primitiveFunctions:' chunk (ST/X)" |
|
3072 |
||
3073 |
^ self handlePrimitiveChange: (arguments at:1) evaluate. |
|
3074 |
||
3075 |
"Created: / 27-07-2012 / 21:37:21 / cg" |
|
3076 |
! |
|
3077 |
||
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3078 |
process_primitiveVariables |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3079 |
"'primitiveVariables' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3080 |
|
2867
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3081 |
^ self handlePrimitiveChange:nil. |
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3082 |
|
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3083 |
"Modified: / 27-07-2012 / 21:40:35 / cg" |
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3084 |
! |
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3085 |
|
2892 | 3086 |
process_primitiveVariables_ |
3087 |
"'primitiveVariables:' chunk (ST/X)" |
|
3088 |
||
3089 |
^ self handlePrimitiveChange: (arguments at:1) evaluate. |
|
3090 |
||
3091 |
"Created: / 27-07-2012 / 21:41:49 / cg" |
|
3092 |
! |
|
3093 |
||
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3094 |
process_privacy_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3095 |
"'privacy:' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3096 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3097 |
^ self handleMethodPrivacyChange. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3098 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3099 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3100 |
process_privateMethods |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3101 |
"'privateMethods' chunk (ST/V and dolphin)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3102 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3103 |
^ self handleMethodChange. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3104 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3105 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3106 |
process_privateMethodsFor_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3107 |
"'privateMethodsFor:' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3108 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3109 |
^ self handleMethodChange. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3110 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3111 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3112 |
process_protectedMethodsFor_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3113 |
"'protectedMethodsFor:' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3114 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3115 |
^ self handleMethodChange. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3116 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3117 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3118 |
process_publicMethods |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3119 |
"'publicMethods' chunk (ST/V and dolphin)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3120 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3121 |
^ self handleMethodChange. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3122 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3123 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3124 |
process_publicMethodsFor_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3125 |
"'publicMethodsFor:' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3126 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3127 |
^ self handleMethodChange. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3128 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3129 |
|
3246 | 3130 |
process_rake |
3131 |
"Rake build system info record |
|
3132 |
||
3133 |
'---- rake update st.img 12-03-2012 10:49:40 ----'!! |
|
3134 |
'---- rake compile st.img 12-03-2012 10:49:40 ----'!! |
|
3135 |
||
3136 |
'rake' is already read from inputStream. |
|
3137 |
" |
|
3138 |
||
3139 |
| ts what | |
|
3140 |
||
3141 |
inputStream skipSeparators. |
|
3142 |
what := inputStream through: Character space. "/read snapshot name |
|
3143 |
inputStream through: Character space. "/skip username@host |
|
3144 |
ts := Timestamp readFrom: inputStream. |
|
3145 |
self addChange: (InfoChange type: #rake data: what timestamp: ts) |
|
3146 |
||
3147 |
"Created: / 01-08-2012 / 19:33:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3148 |
! |
|
3149 |
||
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3150 |
process_removeClass_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3151 |
"'removeClass:' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3152 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3153 |
^ self handleRemoveClassChange. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3154 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3155 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3156 |
process_removeSelector_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3157 |
"'removeSelector:' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3158 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3159 |
^ self handleRemoveMethodChange. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3160 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3161 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3162 |
process_renameCategory_to_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3163 |
"'renameCategory:to:' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3164 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3165 |
^ self handleMethodCategoryRenameChange. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3166 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3167 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3168 |
process_renameClass_to_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3169 |
"'renameClass:to:' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3170 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3171 |
^ self handleRenameClassChange. |
2881 | 3172 |
! |
3173 |
||
3174 |
process_snapshot |
|
3175 |
"St/X system start info record |
|
3176 |
||
3177 |
'---- snapshot st.img 12-03-2012 10:49:40 ----'!! |
|
3178 |
||
3179 |
'start' is already read from inputStream. |
|
3180 |
" |
|
3181 |
||
3182 |
| ts file | |
|
3183 |
||
3184 |
inputStream skipSeparators. |
|
3185 |
file := inputStream through: Character space. "/read snapshot name |
|
3186 |
ts := Timestamp readFrom: inputStream. |
|
3187 |
self addChange: (InfoChange type: #snapshot data: file timestamp: ts) |
|
3188 |
||
3189 |
"Created: / 18-05-2012 / 17:04:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3190 |
! |
|
3191 |
||
3192 |
process_start |
|
3193 |
"St/X system start info record |
|
3194 |
||
3195 |
'---- start 12-03-2012 10:49:40 ----'!! |
|
3196 |
||
3197 |
'start' is already read from inputStream. |
|
3198 |
" |
|
3199 |
||
3200 |
| ts | |
|
3201 |
||
3202 |
inputStream skipSeparators. |
|
3203 |
ts := Timestamp readFrom: inputStream. |
|
3204 |
self addChange: (InfoChange type: #start data: nil timestamp: ts) |
|
3205 |
||
3206 |
"Created: / 18-05-2012 / 17:03:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3207 |
! |
|
3208 |
||
3209 |
process_timestamp |
|
3210 |
"St/X timestamp info record. Example: |
|
3211 |
||
3212 |
'---- timestamp jv@neso 12-03-2012 10:49:40 ----'!! |
|
3213 |
||
3214 |
'timestamp' is already read from inputStream. |
|
3215 |
" |
|
3216 |
||
3217 |
inputStream skipSeparators; through: Character space. "/read username@host |
|
3218 |
timestamp := Timestamp readFrom: inputStream. |
|
3219 |
||
3220 |
"Created: / 02-04-2012 / 19:08:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3221 |
! ! |
|
3222 |
||
3223 |
!ChangeSet::ClassSourceWriter methodsFor:'private'! |
|
3224 |
||
3225 |
analyze |
|
3226 |
"Analyzes changeset an build some index" |
|
3227 |
||
3228 |
classInfos := Dictionary new. |
|
3229 |
metaInfos := Dictionary new. |
|
3230 |
topClassName := nil. |
|
3231 |
"Pass 1 - collect classes" |
|
3232 |
changeSetBeingSaved do:[:change| |
|
3246 | 3233 |
| pkg | |
3234 |
pkg := change package. |
|
3235 |
packageName isNil ifTrue:[ |
|
3236 |
packageName := pkg. |
|
3237 |
] ifFalse:[ |
|
3238 |
"/Just a defensive check... |
|
3239 |
self assert: (pkg isNil or:[pkg = packageName]) description: 'STC does not support multiple packages in source files'. |
|
3240 |
]. |
|
3241 |
||
2881 | 3242 |
change isClassDefinitionChange ifTrue:[ |
3243 |
| nm ns | |
|
3244 |
||
3246 | 3245 |
|
3246 |
||
2881 | 3247 |
nm := change className. |
3248 |
(nm endsWith:' class') ifFalse:[ |
|
3249 |
(classInfos includesKey: nm) ifTrue:[ |
|
3250 |
self error:'Multiple definitions of class ', nm. |
|
3251 |
^self. |
|
3252 |
]. |
|
3253 |
classInfos at: nm put: (ClassInfo new name: nm). |
|
3254 |
metaInfos at: nm put: (ClassInfo new name: nm , ' class'). |
|
3255 |
change isPrivateClassDefinitionChange ifFalse:[ |
|
3256 |
topClassName notNil ifTrue:[ |
|
3257 |
self error: ('Multiple top class definitions (%1 vs %2)' bindWith: topClassName with: nm). |
|
3258 |
^self. |
|
3259 |
]. |
|
3260 |
topClassName := nm. |
|
3261 |
namespaceName := change nameSpaceName. |
|
3246 | 3262 |
|
2881 | 3263 |
] |
3246 | 3264 |
] |
2881 | 3265 |
] |
3266 |
]. |
|
3267 |
||
3246 | 3268 |
"/ Could be an extension container... |
3269 |
topClassName isNil ifTrue:[ |
|
3270 |
^self |
|
3271 |
]. |
|
3272 |
||
2881 | 3273 |
"Pass 2: fill in infos" |
3274 |
changeSetBeingSaved do:[:change| |
|
3275 |
change isClassChange ifTrue:[ |
|
3276 |
| nm info | |
|
3277 |
||
3278 |
nm := change className. |
|
3279 |
(nm endsWith: ' class') ifTrue:[ |
|
3269 | 3280 |
info := metaInfos at: (nm copyButLast:(' class' size)). |
2881 | 3281 |
] ifFalse:[ |
3282 |
info := classInfos at: nm. |
|
3283 |
"Fill superclass info..." |
|
3284 |
change isClassDefinitionChange ifTrue:[ |
|
3285 |
| superNm | |
|
3286 |
superNm := change superClassName. |
|
3287 |
(classInfos includesKey: superNm) ifTrue:[ |
|
3288 |
info superclass: (classInfos at: superNm). |
|
3289 |
(metaInfos at: nm) superclass: (classInfos at: superNm). |
|
3290 |
]. |
|
3291 |
]. |
|
3292 |
]. |
|
3293 |
info addChange: change. |
|
3294 |
] |
|
3295 |
]. |
|
3296 |
||
3297 |
classInfos do:[:info|info namespace: namespaceName]. |
|
3298 |
metaInfos do:[:info|info namespace: namespaceName]. |
|
3299 |
||
3300 |
||
3301 |
" |
|
3302 |
ChangeSet::ClassSourceWriter new |
|
3303 |
changeSetBeingSaved: (ChangeSet forExistingClass: ChangeSet); |
|
3304 |
analyze; |
|
3305 |
yourself |
|
3306 |
||
3307 |
" |
|
3308 |
||
3309 |
"Created: / 15-03-2012 / 17:51:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3246 | 3310 |
"Modified: / 01-04-2013 / 11:44:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2881 | 3311 |
! |
3312 |
||
3313 |
changeSetBeingSaved:something |
|
3314 |
changeSetBeingSaved := something. |
|
3315 |
! |
|
3316 |
||
3317 |
privateClassesOf: classInfo |
|
3318 |
||
3319 |
| classInfoNameSz | |
|
3320 |
||
3321 |
classInfoNameSz := classInfo name size. |
|
3322 |
^classInfos values select:[:info| |
|
3323 |
info name size > classInfoNameSz and:[ |
|
3324 |
(info name startsWith: classInfo name) |
|
3325 |
and:[(info name at:classInfoNameSz + 1) == $: |
|
3326 |
and:[(info name at:classInfoNameSz + 2) == $: |
|
3327 |
and:[(info name indexOf: $: startingAt: classInfo name size + 3) == 0]]]] |
|
3328 |
] |
|
3329 |
||
3330 |
"Created: / 15-03-2012 / 19:31:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3331 |
! |
|
3332 |
||
3333 |
privateClassesSortedOf: classInfo |
|
3334 |
||
3335 |
|classes| |
|
3336 |
||
3337 |
classes := self privateClassesOf: classInfo. |
|
3338 |
(classes size > 0) ifTrue:[ |
|
3339 |
classes := classes asOrderedCollection. |
|
3340 |
classes sort:[:a :b | a name < b name]. |
|
3341 |
||
3342 |
classes topologicalSort:[:a :b | |
|
3343 |
"/ a must come before b iff: |
|
3344 |
"/ b is a subclass of a |
|
3345 |
"/ b has a private class which is a subclass of a |
|
3346 |
||
3347 |
|mustComeBefore privateClassesOfB| |
|
3348 |
mustComeBefore := (b isSubclassOf:a) or:[b isPrivateClassOf: a]. |
|
3349 |
mustComeBefore |
|
3350 |
]. |
|
3351 |
]. |
|
3352 |
^ classes. |
|
3353 |
||
3354 |
" |
|
3355 |
Object privateClassesSorted |
|
3356 |
NewSystemBrowser privateClassesSorted |
|
3357 |
NewSystemBrowser privateClasses |
|
3358 |
" |
|
3359 |
||
3360 |
"Created: / 15-03-2012 / 19:45:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3361 |
! ! |
|
3362 |
||
3363 |
!ChangeSet::ClassSourceWriter methodsFor:'source writing'! |
|
3364 |
||
3365 |
fileOut:aChangeSet on:outStreamArg withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition methodFilter:methodFilter encoder:encoderOrNil |
|
3366 |
||
3246 | 3367 |
|collectionOfCategories versionMethods comment |
2881 | 3368 |
nonMeta meta classesImplementingInitialize outStream| |
3369 |
||
3370 |
changeSetBeingSaved := aChangeSet. |
|
3371 |
self analyze. |
|
3372 |
||
3373 |
encoderOrNil isNil ifTrue:[ |
|
3374 |
outStream := outStreamArg. |
|
3375 |
] ifFalse:[ |
|
3376 |
outStream := EncodedStream stream:outStreamArg encoder:encoderOrNil. |
|
3377 |
outStream nextPutAll:'"{ Encoding: ' , encoderOrNil nameOfEncoding , ' }"'; cr; cr. |
|
3378 |
]. |
|
3379 |
||
3246 | 3380 |
"/ Just a bunch of extensions? |
3381 |
topClassName isNil ifTrue:[ |
|
3382 |
self fileOutMethodsOn: outStream. |
|
3383 |
^self. |
|
3384 |
]. |
|
3385 |
||
3386 |
nonMeta := classInfos at: topClassName. |
|
3387 |
meta := metaInfos at: topClassName. |
|
3388 |
||
3389 |
methodsAlreadySaved := Set new. |
|
3390 |
||
3391 |
||
3392 |
||
2881 | 3393 |
" |
3394 |
if there is a copyright method, add a copyright comment |
|
3395 |
at the beginning, taking the string from the copyright method. |
|
3396 |
We cannot do this unconditionally - that would lead to my copyrights |
|
3397 |
being put on your code ;-). |
|
3398 |
On the other hand: I want every file created by myself to have the |
|
3399 |
copyright string at the beginning be preserved .... even if the |
|
3400 |
code was edited in the browser and filedOut. |
|
3401 |
" |
|
3402 |
self generateHeaderWithCopyrightOn:outStream. |
|
3403 |
||
3404 |
stampIt ifTrue:[ |
|
3405 |
"/ |
|
3406 |
"/ first, a timestamp |
|
3407 |
"/ |
|
3408 |
outStream nextPutAll:(Smalltalk timeStamp). |
|
3409 |
outStream nextPutChunkSeparator. |
|
3410 |
outStream cr; cr. |
|
3411 |
]. |
|
3412 |
||
3413 |
withDefinition ifTrue:[ |
|
3414 |
"/ |
|
3415 |
"/ then the definition(s) |
|
3416 |
"/ |
|
3417 |
self fileOutAllDefinitionsOf:nonMeta on:outStream. |
|
3418 |
"/ |
|
3419 |
"/ a comment - if any |
|
3420 |
"/ |
|
3421 |
||
3246 | 3422 |
(comment := nonMeta comment) notNil ifTrue:[ |
3423 |
nonMeta printClassNameOn: outStream. |
|
3424 |
outStream nextPutAll:' comment:'. |
|
3425 |
comment comment storeOn: outStream. |
|
3426 |
outStream cr. |
|
3427 |
outStream nextPut:$!!; cr; cr. |
|
3428 |
]. |
|
2881 | 3429 |
"/ |
3430 |
"/ ST/X primitive definitions - if any |
|
3431 |
"/ |
|
3432 |
self fileOutPrimitiveSpecsOf: nonMeta on:outStream. |
|
3433 |
]. |
|
3434 |
||
3435 |
"/ |
|
3436 |
"/ methods from all categories in metaclass (i.e. class methods) |
|
3437 |
"/ EXCEPT: the version method is placed at the very end, to |
|
3438 |
"/ avoid sourcePosition-shifts when checked out later. |
|
3439 |
"/ (RCS expands this string, so its size is not constant) |
|
3440 |
"/ |
|
3441 |
collectionOfCategories := meta categories asSortedCollection. |
|
3442 |
versionMethods := meta methods select:[:change |AbstractSourceCodeManager isVersionMethodSelector:change selector]. |
|
3443 |
||
3444 |
collectionOfCategories notNil ifTrue:[ |
|
3445 |
"/ |
|
3446 |
"/ documentation first (if any), but not the version method |
|
3447 |
"/ |
|
3448 |
(collectionOfCategories includes:'documentation') ifTrue:[ |
|
3449 |
||
3450 |
"/ versionMethods do:[:versionMethod | |
|
3451 |
"/ |source| |
|
3452 |
"/ |
|
3453 |
"/ source := versionMethod source. |
|
3454 |
"/ (source isEmptyOrNil or:[(source startsWith:nonMeta nameOfOldVersionMethod) not]) ifTrue:[ |
|
3455 |
"/ "something bad happend to the classes code" |
|
3456 |
"/ |
|
3457 |
"/ Class fileOutErrorSignal |
|
3458 |
"/ raiseRequestWith:aClass |
|
3459 |
"/ errorString:' - bad source for version method (uncompiled class file?): ', (versionMethod displayString) |
|
3460 |
"/ ]. |
|
3461 |
"/ ]. |
|
3462 |
||
3463 |
self fileOutCategory:'documentation' of:meta except:versionMethods only:nil methodFilter:methodFilter on:outStream. |
|
3464 |
]. |
|
3465 |
||
3466 |
"/ |
|
3467 |
"/ initialization next (if any) |
|
3468 |
"/ |
|
3469 |
(collectionOfCategories includes:'initialization') ifTrue:[ |
|
3470 |
self fileOutCategory:'initialization' of:meta methodFilter:methodFilter on:outStream. |
|
3471 |
]. |
|
3472 |
||
3473 |
"/ |
|
3474 |
"/ instance creation next (if any) |
|
3475 |
"/ |
|
3476 |
(collectionOfCategories includes:'instance creation') ifTrue:[ |
|
3477 |
self fileOutCategory:'instance creation' of:meta methodFilter:methodFilter on:outStream. |
|
3478 |
]. |
|
3479 |
collectionOfCategories do:[:aCategory | |
|
3480 |
((aCategory ~= 'documentation') |
|
3481 |
and:[(aCategory ~= 'initialization') |
|
3482 |
and:[aCategory ~= 'instance creation']]) ifTrue:[ |
|
3483 |
self fileOutCategory:aCategory of:meta methodFilter:methodFilter on:outStream. |
|
3484 |
] |
|
3485 |
] |
|
3486 |
]. |
|
3487 |
||
3488 |
"/ if there are any primitive definitions (vw-like ffi-primitives), |
|
3489 |
"/ file them out first in the order: defines, types. |
|
3490 |
"/ Otherwise, we might have trouble when filing in later, because the types are needed |
|
3491 |
"/ for the primitive calls. |
|
3492 |
nonMeta methodDictionary keysAndValuesDo:[:sel :m | |
|
3493 |
m isVisualWorksTypedef ifTrue:[ |
|
3494 |
self fileOutCategory:m category of:nonMeta except:nil only:(Array with:m) methodFilter:methodFilter on:outStream. |
|
3495 |
]. |
|
3496 |
]. |
|
3497 |
||
3498 |
"/ |
|
3499 |
"/ methods from all categories |
|
3500 |
"/ |
|
3501 |
collectionOfCategories := nonMeta categories asSortedCollection. |
|
3502 |
collectionOfCategories notNil ifTrue:[ |
|
3503 |
collectionOfCategories do:[:aCategory | |
|
3504 |
self fileOutCategory:aCategory of:nonMeta methodFilter:methodFilter on:outStream. |
|
3505 |
] |
|
3506 |
]. |
|
3507 |
||
3508 |
"/ |
|
3509 |
"/ any private classes' methods |
|
3510 |
"/ |
|
3511 |
(self privateClassesSortedOf: nonMeta) do:[:aClass | |
|
3512 |
self fileOutAllMethodsOf:aClass on:outStream methodFilter:methodFilter |
|
3513 |
]. |
|
3514 |
||
3515 |
||
3516 |
"/ |
|
3517 |
"/ finally, the previously skipped version method |
|
3518 |
"/ |
|
3519 |
versionMethods notEmpty ifTrue: [ |
|
3520 |
self fileOutCategory:'documentation' of:meta except:nil only:versionMethods methodFilter:methodFilter on:outStream. |
|
3521 |
]. |
|
3522 |
||
3523 |
initIt ifTrue:[ |
|
3524 |
"/ |
|
3525 |
"/ optionally an initialize message |
|
3526 |
"/ |
|
3527 |
classesImplementingInitialize := OrderedCollection new. |
|
3528 |
||
3529 |
classInfos values with: metaInfos values do:[:class :meta| |
|
3530 |
(meta includesSelector: #initialize) ifTrue:[ |
|
3531 |
classesImplementingInitialize add: class. |
|
3532 |
] |
|
3533 |
]. |
|
3534 |
||
3535 |
classesImplementingInitialize size ~~ 0 ifTrue:[ |
|
3536 |
classesImplementingInitialize topologicalSort:[:a :b | b isSubclassOf:a]. |
|
3537 |
outStream cr. |
|
3538 |
classesImplementingInitialize do:[:eachClass | |
|
3539 |
eachClass printClassNameOn:outStream. outStream nextPutAll:' initialize'. |
|
3540 |
outStream nextPutChunkSeparator. |
|
3541 |
outStream cr. |
|
3542 |
]. |
|
3543 |
]. |
|
3544 |
] |
|
3545 |
||
3546 |
"Created: / 15-11-1995 / 12:53:06 / cg" |
|
3547 |
"Modified: / 01-04-1997 / 16:01:05 / stefan" |
|
3548 |
"Modified: / 29-09-2011 / 14:53:49 / cg" |
|
3549 |
"Created: / 15-03-2012 / 17:39:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3246 | 3550 |
"Modified: / 01-05-2013 / 09:17:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2881 | 3551 |
! |
3552 |
||
3553 |
fileOutAllDefinitionsOf:nonMetaInfo on:aStream |
|
3554 |
"append expressions on aStream, which defines myself and all of my private classes." |
|
3555 |
||
3556 |
| metaInfo | |
|
3557 |
||
3558 |
nonMetaInfo definition isPrivateClassDefinitionChange ifFalse:[ |
|
3559 |
nonMetaInfo definition package notNil ifTrue:[ |
|
3560 |
aStream nextPutAll: ('"{ Package: ''%1'' }"' bindWith: nonMetaInfo definition package). |
|
3561 |
aStream cr; cr. |
|
3562 |
]. |
|
3563 |
namespaceName notNil ifTrue:[ |
|
3564 |
aStream nextPutAll: ('"{ NameSpace: %1 }"' bindWith: namespaceName). |
|
3565 |
aStream cr; cr. |
|
3566 |
]. |
|
3567 |
]. |
|
3568 |
||
3218 | 3569 |
aStream nextChunkPut: (nonMetaInfo definition definitionStringInNamespace: namespaceName). |
2881 | 3570 |
aStream cr; cr. |
3571 |
||
3572 |
"/ |
|
3573 |
"/ optional classInstanceVariables |
|
3574 |
"/ |
|
3575 |
metaInfo := metaInfos at: nonMetaInfo name. |
|
3576 |
metaInfo definition notNil ifTrue:[ |
|
3577 |
| anySuperClassInstVar myClass | |
|
3578 |
aStream |
|
3579 |
nextPutAll: metaInfo definition className; |
|
3580 |
nextPutAll:' instanceVariableNames:'; |
|
3581 |
nextPutAll: (metaInfo definition classInstVarNames asStringWith:' ') storeString. |
|
3582 |
"mhmh - good idea; saw this in SmallDraw sourcecode ..." |
|
3583 |
||
3584 |
anySuperClassInstVar := false. |
|
3585 |
myClass := metaInfo definition changeClass. |
|
3586 |
myClass notNil ifTrue:[myClass := myClass theNonMetaclass]. |
|
3587 |
myClass notNil ifTrue:[ |
|
3588 |
myClass allSuperclassesDo:[:aSuperClass | |
|
3589 |
aSuperClass class instVarNames do:[:ignored | anySuperClassInstVar := true]. |
|
3590 |
]. |
|
3591 |
||
3592 |
aStream cr; cr; nextPut:(Character doubleQuote); cr; space. |
|
3593 |
anySuperClassInstVar ifFalse:[ |
|
3594 |
aStream |
|
3595 |
nextPutLine:'No other class instance variables are inherited by this class.'. |
|
3596 |
] ifTrue:[ |
|
3597 |
aStream |
|
3598 |
nextPutLine:'The following class instance variables are inherited by this class:'. |
|
3599 |
aStream cr. |
|
3600 |
myClass allSuperclassesDo:[:aSuperClass | |
|
3601 |
aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '. |
|
3602 |
aStream nextPutLine:(aSuperClass class instanceVariableString). |
|
3603 |
]. |
|
3604 |
||
3605 |
]. |
|
3606 |
]. |
|
3607 |
aStream nextPut:(Character doubleQuote); cr. |
|
3608 |
aStream nextPut:$!!; cr; cr |
|
3609 |
]. |
|
3610 |
||
3611 |
"/ here, the full nameSpace prefixes are output, |
|
3612 |
"/ to avoid confusing stc |
|
3613 |
"/ (which otherwise could not find the correct superclass) |
|
3614 |
"/ |
|
3615 |
Class fileOutNameSpaceQuerySignal answer:false do:[ |
|
3616 |
Class forceNoNameSpaceQuerySignal answer:true do:[ |
|
3617 |
(self privateClassesSortedOf: nonMetaInfo) do:[:i | |
|
3618 |
self fileOutAllDefinitionsOf:i on:aStream |
|
3619 |
] |
|
3620 |
] |
|
3621 |
]. |
|
3622 |
||
3623 |
"Created: / 15-10-1996 / 11:15:19 / cg" |
|
3624 |
"Modified: / 22-03-1997 / 16:11:56 / cg" |
|
3625 |
"Created: / 15-03-2012 / 19:18:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3626 |
! |
|
3627 |
||
3628 |
fileOutAllMethodsOf:aClass on:aStream methodFilter:methodFilter |
|
3629 |
| collectionOfCategories meta | |
|
3630 |
||
3631 |
meta := metaInfos at: aClass name. |
|
3632 |
||
3633 |
collectionOfCategories := meta categories asSortedCollection. |
|
3634 |
collectionOfCategories notNil ifTrue:[ |
|
3635 |
collectionOfCategories do:[:aCategory | |
|
3636 |
self fileOutCategory:aCategory of:meta methodFilter:methodFilter on:aStream. |
|
3246 | 3637 |
"/ aStream cr. |
2881 | 3638 |
] |
3639 |
]. |
|
3640 |
collectionOfCategories := aClass categories asSortedCollection. |
|
3641 |
collectionOfCategories notNil ifTrue:[ |
|
3642 |
collectionOfCategories do:[:aCategory | |
|
3643 |
self fileOutCategory:aCategory of:aClass methodFilter:methodFilter on:aStream. |
|
3246 | 3644 |
"/ aStream cr. |
2881 | 3645 |
] |
3646 |
]. |
|
3647 |
||
3648 |
(self privateClassesSortedOf: aClass) do:[:privateClass | |
|
3649 |
self fileOutAllMethodsOf:privateClass on:aStream methodFilter:methodFilter |
|
3650 |
]. |
|
3651 |
||
3652 |
"Created: / 15-10-1996 / 11:13:00 / cg" |
|
3653 |
"Modified: / 22-03-1997 / 16:12:17 / cg" |
|
3654 |
"Created: / 19-03-2012 / 18:21:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3246 | 3655 |
"Modified: / 01-05-2013 / 09:06:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2881 | 3656 |
! |
3657 |
||
3658 |
fileOutMethod:change on:aStream |
|
3659 |
"file a single method onto aStream." |
|
3660 |
||
3661 |
| changeToFileOut | |
|
3662 |
||
3663 |
change isMethodCategoryChange ifTrue:[ |
|
3664 |
self assert: change origin notNil. |
|
3665 |
changeToFileOut := change origin copy. |
|
3666 |
changeToFileOut category: change category. |
|
3667 |
] ifFalse:[ |
|
3668 |
changeToFileOut := change. |
|
3669 |
]. |
|
3670 |
changeToFileOut source notEmptyOrNil ifTrue:[ |
|
3671 |
super fileOutMethod:changeToFileOut on:aStream |
|
3672 |
] ifFalse:[ |
|
3673 |
"/ self error: 'Should not happen' mayProceed: true. |
|
3674 |
] |
|
3675 |
||
3676 |
"Created: / 20-03-2012 / 22:33:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3677 |
! |
|
3678 |
||
3246 | 3679 |
fileOutMethodsOn:stream |
3680 |
"Writes a set of methods in changesetBeingSaved in same format as |
|
3681 |
extensions.st created by source code management. Code stolen from |
|
3682 |
||
3683 |
AbstractSourceCodeManager class>>fileOutSourceCodeExtensions:package:on:version: |
|
3684 |
" |
|
3685 |
||
3686 |
| methodsSortedByName | |
|
3687 |
||
3688 |
||
3689 |
stream nextPutAll:'"{ Package: '''. |
|
3690 |
stream nextPutAll:packageName asString. |
|
3691 |
stream nextPutAll:''' }"'; nextPutChunkSeparator; cr; cr. |
|
3692 |
||
3693 |
"/ s nextPutAll:(Smalltalk timeStamp). |
|
3694 |
"/ s nextPutChunkSeparator. |
|
3695 |
"/ s cr; cr. |
|
3696 |
||
3697 |
"/ sort them by name (to avoid conflict due to CVS merge) |
|
3698 |
methodsSortedByName := changeSetBeingSaved. |
|
3699 |
methodsSortedByName sort:[:a :b | |
|
3700 |
|clsA clsB| |
|
3701 |
||
3702 |
clsA := a className. |
|
3703 |
clsB := b className. |
|
3704 |
clsA < clsB ifTrue:[ |
|
3705 |
true |
|
3706 |
] ifFalse:[ |
|
3707 |
clsA > clsB ifTrue:[ |
|
3708 |
false |
|
3709 |
] ifFalse:[ |
|
3710 |
a selector < b selector |
|
3711 |
] |
|
3712 |
] |
|
3713 |
]. |
|
3714 |
methodsSortedByName do:[:aMethod | |
|
3715 |
|cat source privacy| |
|
3716 |
||
3717 |
self assert: aMethod package = packageName. |
|
3718 |
"/self assert: aMethod programmingLanguage isSmalltalk. |
|
3719 |
||
3720 |
||
3721 |
stream nextPutChunkSeparator. |
|
3722 |
aMethod className printOn: stream. |
|
3723 |
||
3724 |
(privacy := aMethod privacy) ~~ #public ifTrue:[ |
|
3725 |
stream space; nextPutAll:privacy; nextPutAll:'MethodsFor:'. |
|
3726 |
] ifFalse:[ |
|
3727 |
stream nextPutAll:' methodsFor:'. |
|
3728 |
]. |
|
3729 |
||
3730 |
cat := aMethod category ? ''. |
|
3731 |
stream nextPutAll:cat asString storeString. |
|
3732 |
stream nextPutChunkSeparator; cr; cr. |
|
3733 |
||
3734 |
source := aMethod source. |
|
3735 |
source isNil ifTrue:[ |
|
3736 |
"FileOutErrorSignal"Error |
|
3737 |
raiseRequestWith:self |
|
3738 |
errorString:(' - no source for method: ' , |
|
3739 |
self className , '>>' , |
|
3740 |
aMethod selector) |
|
3741 |
] ifFalse:[ |
|
3742 |
stream nextChunkPut:source. |
|
3743 |
]. |
|
3744 |
stream space. |
|
3745 |
stream nextPutChunkSeparator. |
|
3746 |
stream cr. |
|
3747 |
]. |
|
3748 |
||
3749 |
"Created: / 30-01-2013 / 09:35:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3750 |
! |
|
3751 |
||
2881 | 3752 |
fileOutPrimitiveSpecsOf: nonMeta on:aStream |
3753 |
"append primitive defs (if any) to aStream." |
|
3754 |
||
3755 |
|s| |
|
3756 |
||
3757 |
" |
|
3758 |
primitive definitions - if any |
|
3759 |
" |
|
3760 |
(s := nonMeta primitiveDefinitionsString) notNil ifTrue:[ |
|
3761 |
aStream nextPutChunkSeparator. |
|
3762 |
nonMeta printClassNameOn:aStream. |
|
3763 |
aStream nextPutAll:' primitiveDefinitions'; |
|
3764 |
nextPutChunkSeparator; |
|
3765 |
cr. |
|
3766 |
aStream nextPutAll:s. |
|
3767 |
aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr |
|
3768 |
]. |
|
3769 |
(s := nonMeta primitiveVariablesString) notNil ifTrue:[ |
|
3770 |
aStream nextPutChunkSeparator. |
|
3771 |
nonMeta printClassNameOn:aStream. |
|
3772 |
aStream nextPutAll:' primitiveVariables'; |
|
3773 |
nextPutChunkSeparator; |
|
3774 |
cr. |
|
3775 |
aStream nextPutAll:s. |
|
3776 |
aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr |
|
3777 |
]. |
|
3778 |
||
3779 |
"Created: / 15-03-2012 / 19:48:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3780 |
! |
|
3781 |
||
3782 |
generateHeaderWithCopyrightOn:outStream |
|
3783 |
|copyrightChange copyrightText| |
|
3784 |
||
3785 |
copyrightChange := |
|
3786 |
(metaInfos at: topClassName) methodAt: #copyright. |
|
3787 |
||
3788 |
||
3789 |
copyrightChange notNil ifTrue:[ |
|
3790 |
" |
|
3791 |
get the copyright method's comment-text, strip off empty and blank lines |
|
3792 |
and insert at beginning. |
|
3793 |
" |
|
3794 |
copyrightText := Parser methodCommentFromSource: copyrightChange source. |
|
3795 |
copyrightText notEmptyOrNil ifTrue:[ |
|
3796 |
copyrightText := copyrightText asCollectionOfLines asStringCollection. |
|
3797 |
copyrightText := copyrightText withoutLeadingBlankLines. |
|
3798 |
copyrightText := copyrightText withoutTrailingBlankLines. |
|
3799 |
copyrightText notEmpty ifTrue:[ |
|
3800 |
copyrightText addFirst:'"'. |
|
3801 |
copyrightText addLast:'"'. |
|
3802 |
copyrightText := copyrightText asString. |
|
3803 |
outStream nextPutAllAsChunk:copyrightText. |
|
3804 |
]. |
|
3805 |
]. |
|
3806 |
]. |
|
3807 |
||
3808 |
"Created: / 15-03-2012 / 19:01:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3809 |
! ! |
|
3810 |
||
3246 | 3811 |
!ChangeSet::ClassSourceWriter::ClassInfo class methodsFor:'documentation'! |
3812 |
||
3813 |
copyright |
|
3814 |
" |
|
3815 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
3816 |
All Rights Reserved |
|
3817 |
||
3818 |
This software is furnished under a license and may be used |
|
3819 |
only in accordance with the terms of that license and with the |
|
3820 |
inclusion of the above copyright notice. This software may not |
|
3821 |
be provided or otherwise made available to, or used by, any |
|
3822 |
other person. No title to or ownership of the software is |
|
3823 |
hereby transferred. |
|
3824 |
" |
|
3825 |
! |
|
3826 |
||
3827 |
version_SVN |
|
3378 | 3828 |
^ '$Id: ChangeSet.st,v 1.234 2013-08-10 12:29:04 stefan Exp $' |
3246 | 3829 |
! ! |
3830 |
||
2881 | 3831 |
!ChangeSet::ClassSourceWriter::ClassInfo class methodsFor:'instance creation'! |
3832 |
||
3833 |
new |
|
3834 |
"return an initialized instance" |
|
3835 |
||
3836 |
^ self basicNew initialize. |
|
3837 |
! ! |
|
3838 |
||
3839 |
!ChangeSet::ClassSourceWriter::ClassInfo methodsFor:'accessing'! |
|
3840 |
||
3841 |
categories |
|
3246 | 3842 |
|
3843 |
^ (methods collect:[:e|e category]) asSet |
|
2881 | 3844 |
|
3845 |
"Created: / 19-03-2012 / 18:03:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3846 |
! |
|
3847 |
||
3246 | 3848 |
comment |
3849 |
^ comment |
|
3850 |
! |
|
3851 |
||
3852 |
comment:something |
|
3853 |
comment := something. |
|
3854 |
! |
|
3855 |
||
2881 | 3856 |
definition |
3857 |
^ definition |
|
3858 |
! |
|
3859 |
||
3860 |
definition:something |
|
3861 |
definition := something. |
|
3862 |
! |
|
3863 |
||
3864 |
methodAt: selector |
|
3865 |
^methods detect:[:each|each selector == selector] ifNone:[nil]. |
|
3866 |
||
3867 |
"Created: / 15-03-2012 / 19:11:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3868 |
! |
|
3869 |
||
3870 |
methodDictionary |
|
3871 |
||
3872 |
methodDictionary isNil ifTrue:[ |
|
3873 |
methodDictionary := Dictionary new. |
|
3874 |
]. |
|
3875 |
^methodDictionary |
|
3876 |
||
3877 |
"Created: / 19-03-2012 / 18:11:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3878 |
! |
|
3879 |
||
3880 |
methods |
|
3881 |
^ methods |
|
3882 |
! |
|
3883 |
||
3884 |
methods:something |
|
3885 |
methods := something. |
|
3886 |
methodDictionary := Dictionary new. |
|
3887 |
methods do:[:m|methodDictionary at: m selector put: m]. |
|
3888 |
||
3889 |
"Modified: / 19-03-2012 / 18:12:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3890 |
! |
|
3891 |
||
3892 |
name |
|
3893 |
^ name |
|
3894 |
! |
|
3895 |
||
3896 |
name:something |
|
3897 |
name := something. |
|
3898 |
! |
|
3899 |
||
3900 |
namespace |
|
3901 |
^ namespace |
|
3902 |
! |
|
3903 |
||
3904 |
namespace:aString |
|
3905 |
namespace := aString. |
|
3906 |
! |
|
3907 |
||
3908 |
primitiveDefinitions |
|
3909 |
^ primitiveDefinitions |
|
3910 |
! |
|
3911 |
||
3912 |
primitiveDefinitionsString |
|
3913 |
^ primitiveDefinitions isNil |
|
3914 |
ifTrue:[nil] |
|
3915 |
ifFalse:[primitiveDefinitions source] |
|
3916 |
||
3917 |
"Created: / 13-04-2012 / 13:14:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3918 |
! |
|
3919 |
||
3920 |
primitiveFunctions |
|
3921 |
^ primitiveFunctions |
|
3922 |
! |
|
3923 |
||
3924 |
primitiveFunctionsString |
|
3925 |
^ primitiveFunctions isNil |
|
3926 |
ifTrue:[nil] |
|
3927 |
ifFalse:[primitiveFunctions source] |
|
3928 |
||
3929 |
"Created: / 13-04-2012 / 13:15:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3930 |
! |
|
3931 |
||
3932 |
primitiveVariables |
|
3933 |
^ primitiveVariables |
|
3934 |
! |
|
3935 |
||
3936 |
primitiveVariablesString |
|
3937 |
^ primitiveVariables isNil |
|
3938 |
ifTrue:[nil] |
|
3939 |
ifFalse:[primitiveVariables source] |
|
3940 |
||
3941 |
"Created: / 13-04-2012 / 13:15:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3942 |
! |
|
3943 |
||
3944 |
selectorAtMethod: m |
|
3945 |
^m selector |
|
3946 |
||
3947 |
"Created: / 19-03-2012 / 18:14:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3948 |
! |
|
3949 |
||
3950 |
superclass |
|
3951 |
^ superclass |
|
3952 |
! |
|
3953 |
||
3954 |
superclass:something |
|
3955 |
superclass := something. |
|
3956 |
! ! |
|
3957 |
||
3958 |
!ChangeSet::ClassSourceWriter::ClassInfo methodsFor:'adding'! |
|
3959 |
||
3960 |
addChange: change |
|
3961 |
||
3962 |
change isClassDefinitionChange ifTrue:[ |
|
3963 |
self assert: definition isNil. |
|
3964 |
definition := change. |
|
3965 |
^self. |
|
3966 |
]. |
|
3967 |
change isMethodCodeChange ifTrue:[ |
|
3968 |
methods add: change. |
|
3969 |
^self. |
|
3970 |
]. |
|
3971 |
change isMethodCategoryChange ifTrue:[ |
|
3972 |
methods add: change. |
|
3973 |
^self. |
|
3974 |
]. |
|
3975 |
||
3976 |
change isClassInstVarDefinitionChange ifTrue:[ |
|
3977 |
self assert: definition isNil. |
|
3978 |
definition := change. |
|
3979 |
^self |
|
3980 |
]. |
|
3981 |
||
3982 |
change isPrimitiveDefinitionsChange ifTrue:[ |
|
3983 |
primitiveDefinitions := change. |
|
3984 |
^self |
|
3985 |
]. |
|
3986 |
||
3987 |
change isPrimitiveVariablesChange ifTrue:[ |
|
3988 |
primitiveVariables := change. |
|
3989 |
^self |
|
3990 |
]. |
|
3991 |
||
3992 |
change isPrimitiveFunctionsChange ifTrue:[ |
|
3993 |
primitiveFunctions := change. |
|
3994 |
^self |
|
3995 |
]. |
|
3996 |
||
3246 | 3997 |
change isClassCommentChange ifTrue:[ |
3998 |
comment := change. |
|
3999 |
^self |
|
4000 |
]. |
|
4001 |
||
2881 | 4002 |
self error: 'Unknown change' |
4003 |
||
4004 |
"Created: / 15-03-2012 / 19:12:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4005 |
! ! |
|
4006 |
||
4007 |
!ChangeSet::ClassSourceWriter::ClassInfo methodsFor:'enumerating'! |
|
4008 |
||
4009 |
methodsDo: aBlock |
|
4010 |
||
4011 |
methods do: aBlock |
|
4012 |
||
4013 |
"Created: / 19-03-2012 / 18:14:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4014 |
! ! |
|
4015 |
||
4016 |
!ChangeSet::ClassSourceWriter::ClassInfo methodsFor:'initialization'! |
|
4017 |
||
4018 |
initialize |
|
4019 |
"Invoked when a new instance is created." |
|
4020 |
||
4021 |
"/ please change as required (and remove this comment) |
|
4022 |
"/ name := nil. |
|
4023 |
"/ instDefinition := nil. |
|
4024 |
"/ classDefinition := nil. |
|
4025 |
methods := OrderedCollection new. |
|
4026 |
||
4027 |
"/ super initialize. -- commented since inherited method does nothing |
|
4028 |
||
4029 |
"Modified: / 15-03-2012 / 19:12:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4030 |
! ! |
|
4031 |
||
4032 |
!ChangeSet::ClassSourceWriter::ClassInfo methodsFor:'printing & storing'! |
|
4033 |
||
4034 |
printClassNameOn:aStream |
|
4035 |
| nameWithoutNs | |
|
4036 |
||
4037 |
nameWithoutNs := name. |
|
4038 |
namespace notNil ifTrue:[ |
|
4039 |
self assert: (name startsWith:namespace). |
|
4040 |
nameWithoutNs := nameWithoutNs copyFrom: namespace size + 3. |
|
4041 |
]. |
|
4042 |
||
4043 |
aStream nextPutAll: nameWithoutNs |
|
4044 |
||
4045 |
"Created: / 19-03-2012 / 18:17:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4046 |
! |
|
4047 |
||
4048 |
printOn:aStream |
|
4049 |
"append a printed representation if the receiver to the argument, aStream" |
|
4050 |
||
4051 |
aStream nextPutAll: self class nameWithoutPrefix. |
|
4052 |
aStream nextPutAll:'('. |
|
4053 |
name printOn:aStream. |
|
4054 |
aStream nextPutAll:')'. |
|
4055 |
||
4056 |
"Modified: / 19-03-2012 / 19:43:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4057 |
! ! |
|
4058 |
||
4059 |
!ChangeSet::ClassSourceWriter::ClassInfo methodsFor:'queries'! |
|
4060 |
||
4061 |
includesSelector: selector |
|
4062 |
||
4063 |
^methods anySatisfy:[:m|m selector == selector]. |
|
4064 |
||
4065 |
"Created: / 19-03-2012 / 18:22:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4066 |
! |
|
4067 |
||
4068 |
isPrivateClassOf: classInfo |
|
4069 |
||
4070 |
^(name startsWith: classInfo name) |
|
4071 |
and:[ (name at: (classInfo name size + 1)) == $: |
|
4072 |
and:[ (name at: (classInfo name size + 2)) == $:]] |
|
4073 |
||
4074 |
"Created: / 15-03-2012 / 19:42:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4075 |
! |
|
4076 |
||
4077 |
isSubclassOf: classInfo |
|
4078 |
||
4079 |
^superclass notNil and: |
|
4080 |
[superclass == classInfo or:[superclass isSubclassOf: classInfo]] |
|
4081 |
||
4082 |
"Created: / 15-03-2012 / 19:41:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
4083 |
! ! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
4084 |
|
2321 | 4085 |
!ChangeSet::DiffSet class methodsFor:'documentation'! |
4086 |
||
4087 |
documentation |
|
4088 |
" |
|
4089 |
I represent the differences between two change sets. |
|
4090 |
As such, I can be used by a VersionDiffBrowser and to generate patchSets. |
|
4091 |
" |
|
4092 |
! ! |
|
4093 |
||
1156
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4094 |
!ChangeSet::DiffSet methodsFor:'accessing'! |
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4095 |
|
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4096 |
changed |
1867 | 4097 |
"return the set of methods which were different" |
1156
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4098 |
|
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4099 |
^ changed |
1867 | 4100 |
|
4101 |
"Modified: / 12-10-2006 / 22:06:55 / cg" |
|
1156
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4102 |
! |
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4103 |
|
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4104 |
changed:something |
1867 | 4105 |
"set the set of changed methods" |
1156
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4106 |
|
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4107 |
changed := something. |
1867 | 4108 |
|
4109 |
"Modified: / 12-10-2006 / 22:06:03 / cg" |
|
1156
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4110 |
! |
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4111 |
|
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4112 |
changed:changedArg onlyInReceiver:onlyInReceiverArg onlyInArg:onlyInArgArg |
3338 | 4113 |
self changed:changedArg onlyInReceiver:onlyInReceiverArg onlyInArg:onlyInArgArg same:nil |
1156
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4114 |
! |
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4115 |
|
2881 | 4116 |
changed:changedArg onlyInReceiver:onlyInReceiverArg onlyInArg:onlyInArgArg same: sameArg |
4117 |
"set instance variables (automatically generated)" |
|
4118 |
||
4119 |
changed := changedArg. |
|
4120 |
changed isNil ifTrue:[changed := OrderedCollection new]. |
|
4121 |
||
4122 |
onlyInReceiver := onlyInReceiverArg. |
|
4123 |
onlyInReceiver isNil ifTrue:[onlyInReceiver := ChangeSet new]. |
|
4124 |
||
4125 |
onlyInArg := onlyInArgArg. |
|
4126 |
onlyInArg isNil ifTrue:[onlyInArg := ChangeSet new]. |
|
4127 |
||
4128 |
same := sameArg. |
|
4129 |
same isNil ifTrue:[same := ChangeSet new]. |
|
4130 |
||
4131 |
"Created: / 19-03-2012 / 21:35:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4132 |
! |
|
4133 |
||
1156
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4134 |
onlyInArg |
1867 | 4135 |
"return the set of methods which were only present in the argument of the diffset" |
4136 |
||
1156
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4137 |
^ onlyInArg |
1867 | 4138 |
|
4139 |
"Modified: / 12-10-2006 / 22:07:02 / cg" |
|
1156
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4140 |
! |
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4141 |
|
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4142 |
onlyInArg:something |
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4143 |
onlyInArg := something. |
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4144 |
! |
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4145 |
|
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4146 |
onlyInReceiver |
1867 | 4147 |
"return the set of methods which were only present in the receiver of the diffset" |
4148 |
||
1156
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4149 |
^ onlyInReceiver |
1867 | 4150 |
|
4151 |
"Modified: / 12-10-2006 / 22:07:12 / cg" |
|
1156
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4152 |
! |
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4153 |
|
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4154 |
onlyInReceiver:something |
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4155 |
onlyInReceiver := something. |
2881 | 4156 |
! |
4157 |
||
4158 |
same |
|
4159 |
^ same |
|
4160 |
! |
|
4161 |
||
4162 |
same:something |
|
4163 |
same := something. |
|
1156
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4164 |
! ! |
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4165 |
|
1869
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4166 |
!ChangeSet::DiffSet methodsFor:'merging'! |
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4167 |
|
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4168 |
addDiffSet:anotherDiffset |
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4169 |
changed addAll:(anotherDiffset changed). |
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4170 |
onlyInReceiver addAll:(anotherDiffset onlyInReceiver). |
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4171 |
onlyInArg addAll:(anotherDiffset onlyInArg). |
2881 | 4172 |
same addAll: (anotherDiffset same). |
1869
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4173 |
|
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4174 |
"Created: / 12-10-2006 / 22:49:30 / cg" |
2881 | 4175 |
"Modified: / 19-03-2012 / 21:36:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1869
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4176 |
! |
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4177 |
|
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4178 |
copy |
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4179 |
^ self class new |
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4180 |
changed:changed copy |
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4181 |
onlyInReceiver:onlyInReceiver copy |
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4182 |
onlyInArg:onlyInArg copy |
2881 | 4183 |
same:same copy |
1869
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4184 |
|
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4185 |
"Created: / 12-10-2006 / 22:50:56 / cg" |
2881 | 4186 |
"Modified: / 19-03-2012 / 21:36:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1869
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4187 |
! ! |
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4188 |
|
2186 | 4189 |
!ChangeSet::DiffSet methodsFor:'misc'! |
4190 |
||
4191 |
removeAllVersionMethods |
|
4192 |
changed := changed |
|
4193 |
reject:[:pair | |
|
4194 |
pair first isMethodChangeForVersionMethod |
|
4195 |
]. |
|
4196 |
onlyInReceiver := onlyInReceiver |
|
4197 |
reject:[:chg | |
|
4198 |
chg isMethodChangeForVersionMethod |
|
4199 |
]. |
|
4200 |
onlyInArg := onlyInArg |
|
4201 |
reject:[:chg | |
|
4202 |
chg isMethodChangeForVersionMethod |
|
4203 |
]. |
|
4204 |
! ! |
|
4205 |
||
1292 | 4206 |
!ChangeSet::DiffSet methodsFor:'queries'! |
4207 |
||
2914
8d837a083e9b
query for changedClasses added
Claus Gittinger <cg@exept.de>
parents:
2907
diff
changeset
|
4208 |
changedClasses |
8d837a083e9b
query for changedClasses added
Claus Gittinger <cg@exept.de>
parents:
2907
diff
changeset
|
4209 |
|allChangedClasses| |
8d837a083e9b
query for changedClasses added
Claus Gittinger <cg@exept.de>
parents:
2907
diff
changeset
|
4210 |
|
2923 | 4211 |
allChangedClasses := Set new. |
2914
8d837a083e9b
query for changedClasses added
Claus Gittinger <cg@exept.de>
parents:
2907
diff
changeset
|
4212 |
allChangedClasses addAll:(onlyInArg changedClasses). |
8d837a083e9b
query for changedClasses added
Claus Gittinger <cg@exept.de>
parents:
2907
diff
changeset
|
4213 |
allChangedClasses addAll:(onlyInReceiver changedClasses). |
2923 | 4214 |
changed do:[:eachChangePair | |
4215 |
allChangedClasses add:(eachChangePair first changeClass). |
|
4216 |
allChangedClasses add:(eachChangePair second changeClass). |
|
4217 |
]. |
|
4218 |
allChangedClasses remove:nil ifAbsent:[]. |
|
2914
8d837a083e9b
query for changedClasses added
Claus Gittinger <cg@exept.de>
parents:
2907
diff
changeset
|
4219 |
^ allChangedClasses |
8d837a083e9b
query for changedClasses added
Claus Gittinger <cg@exept.de>
parents:
2907
diff
changeset
|
4220 |
|
8d837a083e9b
query for changedClasses added
Claus Gittinger <cg@exept.de>
parents:
2907
diff
changeset
|
4221 |
"Created: / 26-09-2012 / 15:39:18 / cg" |
8d837a083e9b
query for changedClasses added
Claus Gittinger <cg@exept.de>
parents:
2907
diff
changeset
|
4222 |
! |
8d837a083e9b
query for changedClasses added
Claus Gittinger <cg@exept.de>
parents:
2907
diff
changeset
|
4223 |
|
1292 | 4224 |
isEmpty |
4225 |
^ changed isEmpty |
|
4226 |
and:[ onlyInReceiver isEmpty |
|
4227 |
and:[ onlyInArg isEmpty ] ] |
|
1869
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4228 |
! |
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4229 |
|
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4230 |
notEmpty |
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4231 |
^ self isEmpty not |
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4232 |
|
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4233 |
"Created: / 12-10-2006 / 23:12:27 / cg" |
1292 | 4234 |
! ! |
4235 |
||
1182 | 4236 |
!ChangeSet::DolphinPACFileReader methodsFor:'reading-private'! |
4237 |
||
4238 |
handleCategoriesForClass |
|
4239 |
|category change| |
|
4240 |
||
2179 | 4241 |
[ |
4242 |
inputStream skipSeparators. |
|
4243 |
category := inputStream nextChunk. |
|
4244 |
category notEmpty |
|
4245 |
] whileTrue:[ |
|
4246 |
change := ClassCategoryChange new. |
|
4247 |
change |
|
4248 |
className:className |
|
4249 |
category:category. |
|
4250 |
||
4251 |
self addChange:change. |
|
4252 |
]. |
|
1182 | 4253 |
^ true |
4254 |
! |
|
4255 |
||
4256 |
handleCategoriesForMethod |
|
2179 | 4257 |
|methodSelector categories change isPrivate isPublic category| |
1182 | 4258 |
|
4259 |
methodSelector := (arguments at:1) evaluate. |
|
4260 |
inputStream skipSeparators. |
|
4261 |
isPrivate := false. |
|
4262 |
||
4263 |
categories := OrderedCollection new. |
|
4264 |
[ |
|
2179 | 4265 |
|done category | |
4266 |
||
1182 | 4267 |
category := inputStream nextChunk withoutSeparators. |
2179 | 4268 |
done := category isEmpty. |
4269 |
done ifFalse:[ |
|
1182 | 4270 |
categories add:category |
4271 |
]. |
|
2179 | 4272 |
done |
4273 |
] whileFalse. |
|
1182 | 4274 |
|
4275 |
categories size > 1 ifTrue:[ |
|
4276 |
isPrivate := categories includes:'private'. |
|
4277 |
categories remove:'private' ifAbsent:nil. |
|
4278 |
]. |
|
4279 |
categories size > 1 ifTrue:[ |
|
4280 |
isPublic := categories includes:'public'. |
|
4281 |
categories remove:'public' ifAbsent:nil. |
|
4282 |
]. |
|
4283 |
"/ categories size > 1 ifTrue:[ |
|
4284 |
"/ self halt. |
|
4285 |
"/ ]. |
|
4286 |
||
4287 |
category := categories first. |
|
4288 |
isPrivate ifTrue:[ |
|
4289 |
category := category , '-private'. |
|
4290 |
]. |
|
4291 |
||
4292 |
change := MethodCategoryChange new. |
|
4293 |
change |
|
4294 |
className:className |
|
4295 |
selector:methodSelector |
|
4296 |
category:category. |
|
4297 |
||
4298 |
self addChange:change. |
|
4299 |
^ true |
|
4300 |
! |
|
4301 |
||
4302 |
processChange |
|
4303 |
"given a parse-tree (from parsing some changes source/chunk), |
|
4304 |
create changes and evaluate changeAction on each. |
|
4305 |
The block is invoked with the change and a lineNumberOrNil as |
|
4306 |
arg; the lineNumber is only valid, if the underlying stream |
|
4307 |
provides line-numbers; otherwise, nil is passed." |
|
4308 |
||
4309 |
(selector == #'categoriesForClass') ifTrue:[ |
|
4310 |
^ self handleCategoriesForClass. |
|
4311 |
]. |
|
4312 |
(selector == #'categoriesFor:') ifTrue:[ |
|
4313 |
^ self handleCategoriesForMethod. |
|
4314 |
]. |
|
4315 |
selector == #'subclass:instanceVariableNames:classVariableNames:poolDictionaries:classInstanceVariableNames:' ifTrue:[ |
|
4316 |
^ self handleClassDefinitionChange. |
|
4317 |
]. |
|
2179 | 4318 |
"/ selector == #'guid:' ifTrue:[ |
4319 |
"/ ^ self handleGUIDChange. |
|
4320 |
"/ ]. |
|
1182 | 4321 |
^ super processChange |
4322 |
||
4323 |
||
4324 |
"/ selector == #named:superclass:indexedInstanceVariables:instanceVariableNames:classVariableNames:sharedPools:classInstanceVariableNames: ifTrue:[ |
|
4325 |
"/ ^ self handleClassDefinitionChange. |
|
4326 |
"/ ]. |
|
4327 |
"/ (selector == #'key:value:') ifTrue:[ |
|
4328 |
"/ (self checkReceiverIsGlobalNamed:'Annotation') ifTrue:[ |
|
4329 |
"/ ^ self handleAnnotation. |
|
4330 |
"/ ] |
|
4331 |
"/ ]. |
|
4332 |
"/ selector == #'method' ifTrue:[ |
|
4333 |
"/ ^ self handleMethodChange:false. |
|
4334 |
"/ ]. |
|
4335 |
"/ selector == #'classMethod' ifTrue:[ |
|
4336 |
"/ ^ self handleMethodChange:true. |
|
4337 |
"/ ]. |
|
4338 |
"/ |
|
4339 |
"/ selector == #'initializer' ifTrue:[ |
|
4340 |
"/ ^ true |
|
4341 |
"/ ]. |
|
4342 |
"/ selector == #'initialize' ifTrue:[ |
|
4343 |
"/ ^ true |
|
4344 |
"/ ]. |
|
4345 |
"/self halt. |
|
4346 |
"/ |
|
4347 |
"/ ^ false |
|
4348 |
||
4349 |
"Created: / 16.2.1998 / 13:42:40 / cg" |
|
4350 |
"Modified: / 15.12.1999 / 00:29:06 / cg" |
|
4351 |
! ! |
|
4352 |
||
1176 | 4353 |
!ChangeSet::SIFChangeFileReader methodsFor:'reading-private'! |
4354 |
||
4355 |
handleAnnotation |
|
4356 |
|key value lastChange change| |
|
4357 |
||
4358 |
key := (arguments at:1) evaluate. |
|
4359 |
value := (arguments at:2) evaluate. |
|
4360 |
||
1422 | 4361 |
key = 'Prerequisite' ifTrue:[ |
4362 |
"/ change := SIFPrerequisiteChange new prerequisiteFileName:value. |
|
4363 |
"/ self addChange:change. |
|
4364 |
^ true |
|
4365 |
]. |
|
4366 |
||
1176 | 4367 |
lastChange := changeSet last. |
4368 |
||
4369 |
key = 'package' ifTrue:[ |
|
4370 |
change := ClassCategoryChange new className:(lastChange className) category:value. |
|
4371 |
self addChange:change. |
|
4372 |
^ true |
|
4373 |
]. |
|
4374 |
key = 'category' ifTrue:[ |
|
4375 |
"/ change := MethodCategoryChange new className:(lastChange className) selector:(lastChange selector) category:value. |
|
4376 |
"/ self addChange:change. |
|
4377 |
lastChange category:value. |
|
4378 |
^ true |
|
4379 |
]. |
|
4380 |
key = 'stamp' ifTrue:[ |
|
4381 |
"/ lastChange timeStamp:value. |
|
4382 |
^ true |
|
4383 |
]. |
|
4384 |
^ false |
|
4385 |
! |
|
4386 |
||
4387 |
handleClassDefinitionChange |
|
4388 |
|nameSpace change| |
|
4389 |
||
4390 |
(self checkReceiverIsGlobalNamed:#Class) ifFalse:[ |
|
4391 |
self error:'unexpected receiver in classDefinition message' mayProceed:true. |
|
4392 |
^ false. |
|
1313 | 4393 |
]. |
1176 | 4394 |
className := (arguments at:1) evaluate. |
4395 |
||
4396 |
nameSpace := Class nameSpaceQuerySignal query. |
|
4397 |
nameSpace ~~ Smalltalk ifTrue:[ |
|
4398 |
className := nameSpace name , '::' , className |
|
4399 |
]. |
|
4400 |
||
4401 |
change := ClassDefinitionChange new. |
|
4402 |
change className:className; source:(parseTree printString). |
|
4403 |
||
4404 |
change package:(Class packageQuerySignal query). |
|
4405 |
self addChange:change. |
|
4406 |
^ true |
|
4407 |
! |
|
4408 |
||
4409 |
handleMethodChange:isMeta |
|
1188 | 4410 |
|categoryName methodSource change parser | |
1176 | 4411 |
|
4412 |
className := self receiversClassName. |
|
4413 |
isMeta ifTrue:[ |
|
4414 |
className := className , ' class' |
|
4415 |
]. |
|
4416 |
||
4417 |
categoryName := 'uncategorized'. |
|
4418 |
||
4419 |
inputStream skipSeparators. |
|
4420 |
lineNumber := inputStream lineNumber. |
|
3376 | 4421 |
position := inputStream position + 1. |
1176 | 4422 |
|
4423 |
methodSource := inputStream nextChunk. |
|
4424 |
||
4425 |
parser := Parser |
|
4426 |
parseMethodArgAndVarSpecification:methodSource |
|
4427 |
in:nil |
|
4428 |
ignoreErrors:true |
|
4429 |
ignoreWarnings:true |
|
4430 |
parseBody:false. |
|
4431 |
||
4432 |
parser isNil ifTrue:[ |
|
4433 |
"/ something wierd ... |
|
4434 |
methodSelector := '????'. |
|
4435 |
] ifFalse:[ |
|
4436 |
methodSelector := parser selector. |
|
4437 |
]. |
|
4438 |
||
4439 |
change := MethodChange new. |
|
4440 |
change |
|
4441 |
className:className |
|
4442 |
selector:methodSelector |
|
4443 |
source:methodSource |
|
4444 |
category:categoryName |
|
1188 | 4445 |
privacy:nil. |
1176 | 4446 |
|
4447 |
self addChange:change. |
|
4448 |
^ true |
|
4449 |
! |
|
4450 |
||
4451 |
processChange |
|
4452 |
"given a parse-tree (from parsing some changes source/chunk), |
|
4453 |
create changes and evaluate changeAction on each. |
|
4454 |
The block is invoked with the change and a lineNumberOrNil as |
|
4455 |
arg; the lineNumber is only valid, if the underlying stream |
|
4456 |
provides line-numbers; otherwise, nil is passed." |
|
4457 |
||
4458 |
(selector == #'interchangeVersion:') ifTrue:[ |
|
4459 |
^ true |
|
4460 |
]. |
|
4461 |
selector == #named:superclass:indexedInstanceVariables:instanceVariableNames:classVariableNames:sharedPools:classInstanceVariableNames: ifTrue:[ |
|
4462 |
^ self handleClassDefinitionChange. |
|
4463 |
]. |
|
4464 |
(selector == #'key:value:') ifTrue:[ |
|
4465 |
(self checkReceiverIsGlobalNamed:'Annotation') ifTrue:[ |
|
4466 |
^ self handleAnnotation. |
|
4467 |
] |
|
4468 |
]. |
|
4469 |
selector == #'method' ifTrue:[ |
|
4470 |
^ self handleMethodChange:false. |
|
4471 |
]. |
|
4472 |
selector == #'classMethod' ifTrue:[ |
|
4473 |
^ self handleMethodChange:true. |
|
4474 |
]. |
|
4475 |
||
4476 |
selector == #'initializer' ifTrue:[ |
|
4477 |
^ true |
|
4478 |
]. |
|
4479 |
selector == #'initialize' ifTrue:[ |
|
4480 |
^ true |
|
4481 |
]. |
|
4482 |
||
4483 |
^ false |
|
4484 |
||
4485 |
"Created: / 16.2.1998 / 13:42:40 / cg" |
|
4486 |
"Modified: / 15.12.1999 / 00:29:06 / cg" |
|
4487 |
! ! |
|
4488 |
||
625
06f4ed35832b
added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
378
diff
changeset
|
4489 |
!ChangeSet class methodsFor:'documentation'! |
100 | 4490 |
|
2868 | 4491 |
version |
3378 | 4492 |
^ '$Header: /cvs/stx/stx/libbasic3/ChangeSet.st,v 1.234 2013-08-10 12:29:04 stefan Exp $' |
2923 | 4493 |
! |
4494 |
||
4495 |
version_CVS |
|
3378 | 4496 |
^ '$Header: /cvs/stx/stx/libbasic3/ChangeSet.st,v 1.234 2013-08-10 12:29:04 stefan Exp $' |
3246 | 4497 |
! |
4498 |
||
4499 |
version_HG |
|
4500 |
||
3269 | 4501 |
^ '$Changeset: <not expanded> $' |
2868 | 4502 |
! |
4503 |
||
2881 | 4504 |
version_SVN |
3378 | 4505 |
^ '$Id: ChangeSet.st,v 1.234 2013-08-10 12:29:04 stefan Exp $' |
100 | 4506 |
! ! |
2985 | 4507 |