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