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