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