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