author | Claus Gittinger <cg@exept.de> |
Wed, 18 Dec 2019 00:20:16 +0100 | |
changeset 4531 | 6261c07996fb |
parent 4527 | 8192557abebb |
child 4532 | a0f6259b1108 |
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]. |
|
1718 |
^ self contains:[:aChange | aChange className = aClassName] |
|
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:[ |
3839 | 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 | |
1737 |
|changeClassName| |
|
1738 |
||
1739 |
changeClassName := eachChange className. |
|
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 | |
1753 |
|changeClassName changeClass| |
|
1754 |
||
1755 |
changeClassName := aChange className. |
|
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 | |
1778 |
|changeClassName changeClass| |
|
1779 |
||
1780 |
changeClassName := aChange className. |
|
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 |
||
3688 | 1808 |
methodDefinitionChangesForClassNamed:aClassName |
1809 |
^ self select:[:chg | chg isMethodDefinitionChange and:[chg className = aClassName]] as:OrderedCollection. |
|
1810 |
! |
|
1811 |
||
3839 | 1812 |
selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:aCollectionOfClasses |
3378 | 1813 |
"return the set of classes from a given collection, for which I have changes." |
3839 | 1814 |
|
2845
914991e2dbd7
added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2819
diff
changeset
|
1815 |
|selected alreadyProcessed classes prev| |
914991e2dbd7
added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2819
diff
changeset
|
1816 |
|
3839 | 1817 |
classes := (aCollectionOfClasses |
1818 |
collect:[:eachClass | eachClass theNonMetaclass]) as:IdentitySet. |
|
3378 | 1819 |
|
1820 |
selected := IdentitySet new. |
|
1821 |
alreadyProcessed := IdentitySet new. |
|
2845
914991e2dbd7
added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2819
diff
changeset
|
1822 |
|
3839 | 1823 |
self do:[:eachChange | |
1824 |
|changeClassName changeClass isIn| |
|
1825 |
||
1826 |
changeClass := eachChange changeClass. |
|
1827 |
(changeClass notNil and:[changeClass ~~ prev]) ifTrue:[ |
|
1828 |
changeClass := changeClass theNonMetaclass. |
|
1829 |
(alreadyProcessed includes:changeClass) ifFalse:[ |
|
1830 |
(classes includes:changeClass) ifTrue:[ |
|
1831 |
selected add:changeClass |
|
1832 |
]. |
|
1833 |
||
1834 |
"/ Care for private classes. If one of its owningClass |
|
1835 |
"/ is in the given collection, add **that owningClass** into |
|
1836 |
"/ result too!!!! |
|
1837 |
||
1838 |
changeClass isPrivate ifTrue:[ |
|
1839 |
|owner| |
|
1840 |
||
1841 |
owner := changeClass owningClass. |
|
1842 |
[owner notNil] whileTrue:[ |
|
1843 |
(classes includes:owner) ifTrue:[ |
|
1844 |
selected add:owner. |
|
1845 |
owner := nil. |
|
1846 |
] ifFalse:[ |
|
1847 |
owner := owner owningClass. |
|
1848 |
]. |
|
1849 |
]. |
|
1850 |
]. |
|
1851 |
alreadyProcessed add: changeClass. |
|
1852 |
]. |
|
1853 |
prev := changeClass. |
|
1854 |
]. |
|
2845
914991e2dbd7
added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2819
diff
changeset
|
1855 |
]. |
914991e2dbd7
added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2819
diff
changeset
|
1856 |
^ selected. |
2519 | 1857 |
|
2907
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1858 |
"Created: / 04-09-2012 / 14:01:37 / cg" |
3378 | 1859 |
"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
|
1860 |
! |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1861 |
|
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1862 |
selectForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:aCollectionOfClasses |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1863 |
"select changes for one of a given class. |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1864 |
Returns a collection of changes" |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1865 |
|
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1866 |
|selected classes | |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1867 |
|
4183 | 1868 |
classes := aCollectionOfClasses collect:[:eachClass | eachClass theNonMetaclass] as:Array. |
1869 |
||
1870 |
selected := self class new. |
|
2907
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1871 |
|
3839 | 1872 |
self do:[:eachChange | |
4183 | 1873 |
|changeClassName changeClass isIn| |
1874 |
||
1875 |
changeClass := eachChange changeClass. |
|
1876 |
(changeClass notNil) ifTrue:[ |
|
1877 |
changeClass := changeClass theNonMetaclass. |
|
1878 |
((classes includes:changeClass) |
|
1879 |
or: [ |
|
1880 |
changeClass isPrivate |
|
1881 |
and: [ (classes includes:changeClass owningClass) ] |
|
1882 |
] |
|
1883 |
) ifTrue:[ |
|
1884 |
selected add: eachChange |
|
1885 |
]. |
|
1886 |
] |
|
2907
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1887 |
]. |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1888 |
^ selected. |
dd00eb010669
added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents:
2902
diff
changeset
|
1889 |
|
2519 | 1890 |
"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
|
1891 |
! ! |
cdc9ddc19155
added query for a class being in a changeSet
Claus Gittinger <cg@exept.de>
parents:
985
diff
changeset
|
1892 |
|
857 | 1893 |
!ChangeSet methodsFor:'utilities'! |
1894 |
||
878 | 1895 |
apply |
3222 | 1896 |
"apply all changes in the receiver's changeSet" |
878 | 1897 |
|
1898 |
self do:[:aChange | |
|
3839 | 1899 |
aChange apply |
878 | 1900 |
] |
1901 |
! |
|
1902 |
||
2412 | 1903 |
condenseChanges |
1904 |
| changesToRemove changesToKeep | |
|
2951 | 1905 |
|
2412 | 1906 |
changesToKeep := self class new. |
1907 |
changesToRemove := self class new. |
|
2951 | 1908 |
self reverseDo:[:change| |
3839 | 1909 |
(changesToKeep anySatisfy:[:each|each isForSameAs: change]) |
1910 |
ifTrue:[changesToRemove add: change] |
|
1911 |
ifFalse:[changesToKeep add: change] |
|
2951 | 1912 |
]. |
2412 | 1913 |
self condenseChanges: changesToRemove. |
1914 |
||
1915 |
"Created: / 22-10-2008 / 13:05:13 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1916 |
! |
|
1917 |
||
1865 | 1918 |
condenseChanges:changesToRemove |
1919 |
"remove the given changes - a helper for the rest of the condense protocol" |
|
1920 |
||
1921 |
changesToRemove notEmpty ifTrue:[ |
|
3839 | 1922 |
changedClasses := changeSelectors := nil. |
1923 |
self removeAll:changesToRemove. |
|
1924 |
"/ self changed. "/ -- removeAll already sends out a notification |
|
1925 |
Smalltalk changed:#currentChangeSet with:self. |
|
1865 | 1926 |
]. |
1927 |
||
1928 |
"Created: / 12-10-2006 / 16:51:11 / cg" |
|
1929 |
! |
|
1930 |
||
3839 | 1931 |
condenseChangesForClass:aClass |
3825 | 1932 |
"remove all changes for aClass (and its metaclass) |
1096 | 1933 |
(i.e. leave changes for other classes)." |
1934 |
||
1935 |
self condenseChangesForClass:aClass package:nil |
|
1936 |
! |
|
1937 |
||
4527 | 1938 |
condenseChangesForClass:aClass package:aPackageSymbolOrNil |
3825 | 1939 |
"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
|
1940 |
(i.e. leave methodChanges for other packages). |
956
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
1941 |
This is invoked when a class is checked into the repository." |
878 | 1942 |
|
4527 | 1943 |
self condenseChangesForClass:aClass selector:nil package:aPackageSymbolOrNil |
1186
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1944 |
|
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1945 |
"Modified: / 5.11.2001 / 14:29:22 / cg" |
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1946 |
! |
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1947 |
|
1830 | 1948 |
condenseChangesForClass:aClass selector:aSelector |
1949 |
"remove all changes for aClass >> selector." |
|
1950 |
||
1951 |
self condenseChangesForClass:aClass selector:aSelector package:nil |
|
1952 |
||
1953 |
"Created: / 26-09-2006 / 17:22:59 / cg" |
|
1954 |
! |
|
1955 |
||
4527 | 1956 |
condenseChangesForClass:aClass selector:selectorOrNil package:aPackageSymbolOrNil |
1186
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1957 |
"remove all changes for aClass/selector and aPackageSymbol |
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1958 |
(i.e. leave methodChanges for other packages). |
3825 | 1959 |
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
|
1960 |
otherwise, only changes for the given selector. |
a47e1a5770c2
condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1961 |
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
|
1962 |
|
945
f9e349d38d49
care for metaclasses when condensing changeSet
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
1963 |
|changesToRemove className metaClassName chgCls| |
878 | 1964 |
|
945
f9e349d38d49
care for metaclasses when condensing changeSet
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
1965 |
className := aClass theNonMetaclass name. |
f9e349d38d49
care for metaclasses when condensing changeSet
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
1966 |
metaClassName := aClass theMetaclass name. |
1865 | 1967 |
|
3839 | 1968 |
changesToRemove := |
4527 | 1969 |
self select:[:aChange | |
1970 |
|chgClassName chgClass removeThis mClass mthd| |
|
1971 |
||
1972 |
removeThis := false. |
|
1973 |
chgClassName := aChange fullClassName "className". |
|
1974 |
||
1975 |
(chgClassName = className or:[chgClassName = metaClassName]) ifTrue:[ |
|
1976 |
removeThis := true |
|
1977 |
] ifFalse:[ |
|
1978 |
chgCls := aChange changeClass. |
|
1979 |
chgCls isNil ifTrue:[ |
|
1980 |
(chgClassName startsWith:(aClass name,':')) ifTrue:[ |
|
1981 |
"a change for a private class of a no-longer present one..." |
|
1982 |
removeThis := true |
|
1983 |
]. |
|
1984 |
]. |
|
1985 |
||
1986 |
(chgCls notNil |
|
1987 |
and:[chgCls isPrivate |
|
1988 |
and:[chgCls topOwningClass == aClass]]) ifTrue:[ |
|
1989 |
removeThis := true |
|
1990 |
] |
|
1991 |
]. |
|
1992 |
selectorOrNil notNil ifTrue:[ |
|
1993 |
(aChange isMethodChange or:[aChange isMethodRemoveChange]) ifFalse:[ |
|
1994 |
removeThis := false. |
|
1995 |
] ifTrue:[ |
|
1996 |
aChange selector = selectorOrNil ifFalse:[ |
|
1997 |
removeThis := false. |
|
1998 |
]. |
|
1999 |
] |
|
2000 |
]. |
|
2001 |
||
2002 |
removeThis ifTrue:[ |
|
2003 |
aChange isMethodChange ifTrue:[ |
|
2004 |
mClass := aChange changeClass. |
|
2005 |
mClass notNil ifTrue:[ |
|
2006 |
mthd := mClass compiledMethodAt:(aChange selector). |
|
2007 |
mthd isNil ifTrue:[ |
|
2008 |
"/ mthd does no longer exist |
|
2009 |
"/ I no longer understand what this was meant for .. (sigh) |
|
2010 |
"/ aPackageSymbol notNil ifTrue:[ |
|
2011 |
"/ removeThis := false |
|
2012 |
"/ ] |
|
2013 |
] ifFalse:[ |
|
2014 |
(aPackageSymbolOrNil notNil and:[mthd package ~= aPackageSymbolOrNil]) ifTrue:[ |
|
2015 |
removeThis := false |
|
2016 |
] |
|
2017 |
] |
|
2018 |
] |
|
2019 |
]. |
|
2020 |
]. |
|
2021 |
removeThis |
|
2022 |
]. |
|
1187
f63ecc7dbaff
condenseChange fixes (if baseClass or extensions are checked in)
Claus Gittinger <cg@exept.de>
parents:
1186
diff
changeset
|
2023 |
|
1865 | 2024 |
self condenseChanges:changesToRemove |
2025 |
||
2026 |
"Modified: / 12-10-2006 / 16:51:38 / cg" |
|
1087
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
2027 |
! |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
2028 |
|
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
2029 |
condenseChangesForExtensionsInPackage:aPackageSymbol |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
2030 |
"remove all changes for aClass and aPackageSymbol |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
2031 |
(i.e. leave methodChanges for other packages). |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
2032 |
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
|
2033 |
|
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
2034 |
|changesToRemove| |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
2035 |
|
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
2036 |
changesToRemove := OrderedCollection new. |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
2037 |
|
3839 | 2038 |
changesToRemove := self select:[:aChange | |
2039 |
|removeThis mClass mthd| |
|
2040 |
||
2041 |
(aChange isMethodChange or:[aChange isMethodRemoveChange]) ifTrue:[ |
|
2042 |
removeThis := false. |
|
2043 |
mClass := aChange changeClass. |
|
2044 |
(mClass notNil and:[mClass package ~= aPackageSymbol]) ifTrue:[ |
|
2045 |
mthd := mClass compiledMethodAt:(aChange selector). |
|
2046 |
mthd isNil ifTrue:[ |
|
2047 |
aChange isMethodRemoveChange ifTrue:[ |
|
2048 |
removeThis := true |
|
2049 |
]. |
|
2050 |
] ifFalse:[ |
|
2051 |
mthd package = aPackageSymbol ifTrue:[ |
|
2052 |
removeThis := true |
|
2053 |
] |
|
2054 |
] |
|
2055 |
]. |
|
2056 |
]. |
|
2057 |
removeThis |
|
1087
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
2058 |
]. |
5aaf7da2882d
condense changes for extensions
Claus Gittinger <cg@exept.de>
parents:
1085
diff
changeset
|
2059 |
|
1865 | 2060 |
self condenseChanges:changesToRemove |
2061 |
||
2062 |
"Created: / 05-11-2001 / 14:21:17 / cg" |
|
2063 |
"Modified: / 12-10-2006 / 16:51:32 / cg" |
|
2064 |
! |
|
2065 |
||
2066 |
condenseChangesForPackage:aPackageSymbol |
|
2067 |
"remove all changes for aPackageSymbol |
|
2068 |
This is invoked when a project is checked into the repository." |
|
2069 |
||
2070 |
|changesToRemove| |
|
2071 |
||
3839 | 2072 |
changesToRemove := self select:[:aChange | |
2073 |
|removeThis mClass mthd| |
|
2074 |
||
2075 |
removeThis := false. |
|
2076 |
(aChange isMethodChange or:[aChange isMethodRemoveChange]) ifTrue:[ |
|
2077 |
mClass := aChange changeClass. |
|
2078 |
mClass notNil ifTrue:[ |
|
2079 |
mthd := mClass compiledMethodAt:(aChange selector). |
|
2080 |
mthd isNil ifTrue:[ |
|
2081 |
aChange isMethodRemoveChange ifTrue:[ |
|
2082 |
removeThis := (mClass package = aPackageSymbol) |
|
2083 |
]. |
|
2084 |
] ifFalse:[ |
|
2085 |
removeThis := (mthd package = aPackageSymbol) |
|
2086 |
] |
|
2087 |
]. |
|
2088 |
] ifFalse:[ |
|
2089 |
(aChange isClassChange) ifTrue:[ |
|
2090 |
(aChange changeClass notNil) ifTrue:[ |
|
2091 |
removeThis := (aChange changeClass package = aPackageSymbol) |
|
2092 |
]. |
|
2093 |
]. |
|
2094 |
]. |
|
2095 |
removeThis |
|
1521
ea6cb41e4523
send out a change notification, when I condensed
Claus Gittinger <cg@exept.de>
parents:
1479
diff
changeset
|
2096 |
]. |
ea6cb41e4523
send out a change notification, when I condensed
Claus Gittinger <cg@exept.de>
parents:
1479
diff
changeset
|
2097 |
|
1865 | 2098 |
self condenseChanges:changesToRemove |
2099 |
||
1521
ea6cb41e4523
send out a change notification, when I condensed
Claus Gittinger <cg@exept.de>
parents:
1479
diff
changeset
|
2100 |
"Created: / 05-11-2001 / 14:21:17 / cg" |
1865 | 2101 |
"Modified: / 12-10-2006 / 16:51:27 / cg" |
878 | 2102 |
! |
2103 |
||
857 | 2104 |
diffSetsAgainst:anotherChangeSet |
2105 |
"walk over the receiver and anotherChangeSet, |
|
2106 |
add all changes to one of the tree lists: |
|
3981 | 2107 |
onlyInReceiver, onlyInArg or changed, |
946 | 2108 |
each being a changeSet containing corresponding changes. |
3839 | 2109 |
WARNING: |
3981 | 2110 |
destructive; could modify both the receiver and the argument by possibly |
2111 |
changing methodChanges into categoryChanges" |
|
857 | 2112 |
|
4033 | 2113 |
^ self diffSetsAgainst:anotherChangeSet comparingDifferentClasses:false |
2114 |
! |
|
2115 |
||
2116 |
diffSetsAgainst:anotherChangeSet comparingDifferentClasses:comparingDifferentClasses |
|
2117 |
"walk over the receiver and anotherChangeSet, |
|
2118 |
add all changes to one of the tree lists: |
|
2119 |
onlyInReceiver, onlyInArg or changed, |
|
2120 |
each being a changeSet containing corresponding changes. |
|
2121 |
If comparingDifferentClasses is false, changes to different classes will |
|
2122 |
generate onlyInA/onlyInB changes; eg. changes for the same selector will be |
|
2123 |
listed on either side. |
|
2124 |
If it is true, we are comparing two different classes, and selectors present in |
|
2125 |
both will be listed as different (or even as the same). |
|
2126 |
||
2127 |
WARNING: |
|
2128 |
destructive; could modify both the receiver and the argument by possibly |
|
2129 |
changing methodChanges into categoryChanges." |
|
2130 |
||
1200
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
2131 |
|otherChangeIndicesBySelector otherNonMethodChangeIndices changeIndicesBySelector nonMethodChangeIndices |
2881 | 2132 |
onlyInReceiver onlyInArg changedMethods same |
857 | 2133 |
indexFromChangedMethodsToA indexFromChangedMethodsToB |
4033 | 2134 |
"info" ret isForSame isSame| |
2135 |
||
2136 |
comparingDifferentClasses ifTrue:[ |
|
2137 |
isForSame := [:aChangeInA :aChangeInB | |
|
2138 |
|isForSame| |
|
2139 |
||
2140 |
isForSame := false. |
|
4120 | 2141 |
(aChangeInA isMethodChange |
2142 |
and:[aChangeInB isMethodChange |
|
2143 |
and:[aChangeInA changeSelector = aChangeInB changeSelector |
|
2144 |
and:[aChangeInA changeClass isMeta = aChangeInB changeClass isMeta]]]) |
|
4033 | 2145 |
ifTrue:[ |
2146 |
isForSame := true. |
|
2147 |
] ifFalse:[ |
|
4120 | 2148 |
(aChangeInA isClassChange |
2149 |
and:[aChangeInB isClassChange |
|
4033 | 2150 |
and:[aChangeInA changeClass nameWithoutNameSpacePrefix |
4120 | 2151 |
= aChangeInB changeClass nameWithoutNameSpacePrefix]]) |
4033 | 2152 |
ifTrue:[ |
2153 |
isForSame := true. |
|
2154 |
] |
|
2155 |
]. |
|
2156 |
isForSame |
|
2157 |
]. |
|
2158 |
||
2159 |
isSame := [:aChangeInA :aChangeInB | |
|
2160 |
(aChangeInA source = aChangeInB source) |
|
2161 |
]. |
|
2162 |
] ifFalse:[ |
|
2163 |
isForSame := [:aChangeInA :aChangeInB | |
|
2164 |
(aChangeInA isForSameAs:aChangeInB) |
|
2165 |
]. |
|
2166 |
||
2167 |
isSame := [:aChangeInA :aChangeInB | |
|
2168 |
(aChangeInA sameAs:aChangeInB) |
|
2169 |
]. |
|
2170 |
]. |
|
857 | 2171 |
|
4183 | 2172 |
onlyInReceiver := self class new. |
2173 |
onlyInArg := self class new. |
|
2174 |
changedMethods := self class new. |
|
2175 |
same := self class new. |
|
857 | 2176 |
|
2177 |
indexFromChangedMethodsToA := OrderedCollection new. |
|
2178 |
indexFromChangedMethodsToB := OrderedCollection new. |
|
2179 |
||
1200
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
2180 |
otherChangeIndicesBySelector := Dictionary new. |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
2181 |
otherNonMethodChangeIndices := OrderedCollection new. |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
2182 |
|
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
2183 |
"/ 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
|
2184 |
anotherChangeSet keysAndValuesDo:[:idxB :aChangeInB | |
3981 | 2185 |
|setOfOtherChangeIndicesForThisSelector| |
2186 |
||
2187 |
aChangeInB isMethodChange ifTrue:[ |
|
2188 |
setOfOtherChangeIndicesForThisSelector := otherChangeIndicesBySelector at:(aChangeInB selector) ifAbsentPut:[OrderedCollection new]. |
|
2189 |
setOfOtherChangeIndicesForThisSelector add:idxB. |
|
2190 |
] ifFalse:[ |
|
2191 |
otherNonMethodChangeIndices add:idxB |
|
2192 |
]. |
|
1200
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
2193 |
]. |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
2194 |
|
857 | 2195 |
self keysAndValuesDo:[:idxA :aChangeInA | |
3981 | 2196 |
|indicesOfChangesToExplore anyFound ch| |
2197 |
||
2198 |
anyFound := false. |
|
2199 |
||
2200 |
aChangeInA isMethodChange ifTrue:[ |
|
2201 |
indicesOfChangesToExplore := otherChangeIndicesBySelector at:(aChangeInA selector) ifAbsent:#() |
|
2202 |
] ifFalse:[ |
|
2203 |
indicesOfChangesToExplore := otherNonMethodChangeIndices. |
|
2204 |
]. |
|
2205 |
||
2206 |
indicesOfChangesToExplore do:[:idxB | |
|
2207 |
|aChangeInB| |
|
2208 |
||
2209 |
aChangeInB := anotherChangeSet at:idxB. |
|
2210 |
||
4033 | 2211 |
(isForSame value:aChangeInA value:aChangeInB) ifTrue:[ |
2212 |
"/ these two are for the same class/selector |
|
3981 | 2213 |
anyFound := true. |
2214 |
||
2215 |
"/ also in B - is it different? |
|
4033 | 2216 |
(isSame value:aChangeInA value:aChangeInB) ifFalse:[ |
3981 | 2217 |
changedMethods add:aChangeInA. |
2218 |
indexFromChangedMethodsToA add:idxA. |
|
2219 |
indexFromChangedMethodsToB add:idxB. |
|
2220 |
] ifTrue:[ |
|
2221 |
aChangeInA isMethodChange ifTrue:[ |
|
2222 |
aChangeInA methodCategory ~= aChangeInB methodCategory ifTrue:[ |
|
2223 |
"/ only the category is different; |
|
2224 |
"/ make it a MethodCategory changes. |
|
2225 |
||
2226 |
ch := MethodCategoryChange new |
|
2227 |
className:aChangeInA className |
|
2228 |
selector:aChangeInA selector |
|
2229 |
category:aChangeInA methodCategory; |
|
4385 | 2230 |
nameSpaceName:aChangeInA nameSpaceName; |
3981 | 2231 |
"JV@2012-03-20: Also keeps origin, required by merge tool" |
2232 |
origin: aChangeInA. |
|
2233 |
self at:idxA put:ch. |
|
2234 |
||
2235 |
ch := MethodCategoryChange new |
|
2236 |
className:aChangeInB className |
|
2237 |
selector:aChangeInB selector |
|
2238 |
category:aChangeInB methodCategory; |
|
4385 | 2239 |
nameSpaceName:aChangeInB nameSpaceName; |
3981 | 2240 |
"JV@2012-03-20: Also keeps origin, required by merge tool" |
2241 |
origin: aChangeInB. |
|
2242 |
anotherChangeSet at:idxB put:ch. |
|
2243 |
||
2244 |
changedMethods add:aChangeInA. |
|
2245 |
indexFromChangedMethodsToA add:idxA. |
|
2246 |
indexFromChangedMethodsToB add:idxB. |
|
2247 |
] |
|
2248 |
]. |
|
2249 |
] |
|
2250 |
] ifFalse:[ |
|
4033 | 2251 |
(isSame value:aChangeInA value:aChangeInB) ifTrue:[ |
3981 | 2252 |
anyFound := true. |
2253 |
] ifFalse:[ |
|
2254 |
] |
|
2255 |
] |
|
2256 |
]. |
|
2257 |
||
2258 |
anyFound ifFalse:[ |
|
2259 |
onlyInReceiver add:aChangeInA. |
|
2260 |
] |
|
857 | 2261 |
]. |
2262 |
||
3981 | 2263 |
"/ 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
|
2264 |
changeIndicesBySelector := Dictionary new. |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
2265 |
nonMethodChangeIndices := OrderedCollection new. |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
2266 |
|
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
2267 |
self keysAndValuesDo:[:idxA :aChangeInA | |
3981 | 2268 |
|setOfChangeIndicesForThisSelector| |
2269 |
||
2270 |
aChangeInA isMethodChange ifTrue:[ |
|
2271 |
setOfChangeIndicesForThisSelector := changeIndicesBySelector at:(aChangeInA selector) ifAbsentPut:[OrderedCollection new]. |
|
2272 |
setOfChangeIndicesForThisSelector add:idxA. |
|
2273 |
] ifFalse:[ |
|
2274 |
nonMethodChangeIndices add:idxA |
|
2275 |
]. |
|
1200
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
2276 |
]. |
2da3e026f94d
much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
2277 |
|
857 | 2278 |
anotherChangeSet keysAndValuesDo:[:idxB :aChangeInB | |
3981 | 2279 |
|anyFound indicesOfChangesToExplore| |
2280 |
||
2281 |
anyFound := false. |
|
2282 |
||
2283 |
aChangeInB isMethodChange ifTrue:[ |
|
2284 |
indicesOfChangesToExplore := changeIndicesBySelector at:(aChangeInB selector) ifAbsent:#() |
|
2285 |
] ifFalse:[ |
|
2286 |
indicesOfChangesToExplore := nonMethodChangeIndices. |
|
2287 |
]. |
|
2288 |
||
2289 |
indicesOfChangesToExplore do:[:idxA | |
|
2290 |
|aChangeInA idxM| |
|
2291 |
||
2292 |
aChangeInA := self at:idxA. |
|
2293 |
||
4033 | 2294 |
(isForSame value:aChangeInA value:aChangeInB) ifTrue:[ |
3981 | 2295 |
anyFound := true. |
2296 |
||
2297 |
"/ also in B - is it different ? |
|
4033 | 2298 |
(isSame value:aChangeInA value:aChangeInB) ifFalse:[ |
3981 | 2299 |
"/ already there ? |
4033 | 2300 |
idxM := changedMethods findFirst:[:c | (isForSame value:c value:aChangeInB)]. |
3981 | 2301 |
idxM == 0 ifTrue:[ |
2302 |
changedMethods add:aChangeInB. |
|
2303 |
indexFromChangedMethodsToB add:idxB. |
|
2304 |
] ifFalse:[ |
|
2305 |
indexFromChangedMethodsToB at:idxM put:idxB |
|
2306 |
] |
|
2307 |
] |
|
2308 |
] ifFalse:[ |
|
4033 | 2309 |
(isSame value:aChangeInA value:aChangeInB) ifTrue:[ |
3981 | 2310 |
anyFound := true. |
2311 |
] ifFalse:[ |
|
2312 |
] |
|
2313 |
] |
|
2314 |
]. |
|
2315 |
anyFound ifFalse:[ |
|
2316 |
onlyInArg add:aChangeInB. |
|
2317 |
] |
|
857 | 2318 |
]. |
2319 |
||
864 | 2320 |
"/ info := OrderedCollection new:(changedMethods size). |
2321 |
"/ changedMethods keysAndValuesDo:[:idx :changedMethod | |
|
3839 | 2322 |
"/ info add:(Array |
864 | 2323 |
"/ with:(indexFromChangedMethodsToA at:idx) |
2324 |
"/ with:(indexFromChangedMethodsToB at:idx) |
|
2325 |
"/ ) |
|
2326 |
"/ ]. |
|
1450 | 2327 |
changedMethods := (1 to:changedMethods size) asOrderedCollection collect:[:idx | |
3981 | 2328 |
|cA cB| |
2329 |
||
2330 |
cA := self at:(indexFromChangedMethodsToA at:idx). |
|
2331 |
cB := anotherChangeSet at:(indexFromChangedMethodsToB at:idx). |
|
2332 |
Array with:cA with:cB |
|
2333 |
]. |
|
857 | 2334 |
|
2881 | 2335 |
same := self reject:[:chg|(changedMethods contains:[:pair|pair first == chg]) or:[onlyInReceiver includes: chg]]. |
2336 |
||
1156
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
2337 |
ret := DiffSet new |
3981 | 2338 |
changed:changedMethods |
2339 |
onlyInReceiver:onlyInReceiver |
|
2340 |
onlyInArg:onlyInArg |
|
2341 |
same: same. |
|
1156
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
2342 |
"/ ret info:info. |
864 | 2343 |
^ret |
1867 | 2344 |
|
2345 |
"Modified: / 12-10-2006 / 22:22:39 / cg" |
|
2633 | 2346 |
"Modified (comment): / 01-12-2011 / 19:12:55 / cg" |
2881 | 2347 |
"Modified: / 20-03-2012 / 22:05:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4385 | 2348 |
"Modified: / 06-12-2018 / 17:15:37 / Stefan Vogel" |
2323 | 2349 |
! |
2350 |
||
2412 | 2351 |
diffSetsAgainstImage |
2352 |
||
2353 |
|imageChangeSet| |
|
2354 |
||
2355 |
imageChangeSet := self class new. |
|
2356 |
self changedClasses do: |
|
2357 |
[:class| |
|
2358 |
(class isMetaclass or:[class isPrivate]) ifFalse: |
|
2359 |
[imageChangeSet addAll: |
|
2360 |
(self class fromStream: class source asString readStream)]]. |
|
2361 |
^self diffSetsAgainst: imageChangeSet |
|
2362 |
||
2363 |
"Created: / 04-12-2007 / 16:03:28 / janfrog" |
|
2364 |
! |
|
2365 |
||
2376 | 2366 |
flatten |
3904 | 2367 |
"return a flat changeset from a changeset which may contain compositeChanges" |
2368 |
||
2376 | 2369 |
| flatten | |
3824 | 2370 |
|
2376 | 2371 |
flatten := self class new: self size. |
3824 | 2372 |
self do:[:ea| |
3904 | 2373 |
ea do:[:ea2| flatten add: ea2] |
3824 | 2374 |
]. |
2375 |
^ flatten |
|
2376 | 2376 |
|
2377 |
"Created: / 29-10-2010 / 14:40:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2378 |
! |
|
2379 |
||
2380 |
groupBy: groupBlock labelAs: labelBlock |
|
2381 |
||
2382 |
" |
|
3839 | 2383 |
returns a new changeset consisting of CompositeChanges. |
2384 |
Changes are grouped together by value (tag) of groupBlock. |
|
2385 |
Each composite change is then labeled using label |
|
2386 |
returned by labelBlock (called with the tag returned |
|
2387 |
by groupBlock as arg) |
|
2376 | 2388 |
" |
2389 |
||
2491
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2390 |
^ self groupBy: groupBlock labelAs: labelBlock sort: false |
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2391 |
|
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2392 |
"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
|
2393 |
"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
|
2394 |
"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
|
2395 |
"Modified: / 30-08-2011 / 16:07:30 / cg" |
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2396 |
! |
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2397 |
|
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2398 |
groupBy: groupBlock labelAs: labelBlock sort: doSort |
2626
0ac000060c44
changed: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2617
diff
changeset
|
2399 |
"returns a new changeset consisting of CompositeChanges. |
0ac000060c44
changed: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2617
diff
changeset
|
2400 |
Changes are grouped together by value (tag) of groupBlock. |
0ac000060c44
changed: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2617
diff
changeset
|
2401 |
Each composite change is then labeled using label |
0ac000060c44
changed: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2617
diff
changeset
|
2402 |
returned by labelBlock (called with the tag returned |
0ac000060c44
changed: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2617
diff
changeset
|
2403 |
by groupBlock as arg)" |
2491
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 |
| buckets newChangeset keys | |
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2406 |
|
2376 | 2407 |
buckets := OrderedDictionary new. |
3839 | 2408 |
self do:[:change| |
2409 |
| tag | |
|
2410 |
||
2411 |
tag := groupBlock value: change. |
|
2412 |
(buckets at: tag ifAbsentPut: [self class new:4]) add: change |
|
2852 | 2413 |
]. |
2414 |
newChangeset := self class new: buckets size. |
|
2491
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2415 |
|
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2416 |
keys := buckets keys select:[:k | k notNil]. |
2852 | 2417 |
doSort ifTrue:[ keys sort ]. |
2491
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2418 |
keys do:[:tag | |
3839 | 2419 |
|changes classDefs| |
2420 |
||
2421 |
changes := buckets at:tag. |
|
2422 |
||
2423 |
"Move class definition to the front" |
|
2424 |
classDefs := changes select:[:chg|chg isClassDefinitionChange]. |
|
2425 |
changes removeAll: classDefs. |
|
2426 |
changes addAllFirst: classDefs. |
|
2427 |
||
2428 |
tag notNil ifTrue:[ |
|
2429 |
newChangeset add: |
|
2430 |
(CompositeChange |
|
2431 |
name: (labelBlock value: tag) |
|
2432 |
changes: changes) |
|
2433 |
] |
|
2852 | 2434 |
]. |
2626
0ac000060c44
changed: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2617
diff
changeset
|
2435 |
(buckets includesKey: nil) ifTrue:[ |
3839 | 2436 |
newChangeset addAll: (buckets at: nil) |
2626
0ac000060c44
changed: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2617
diff
changeset
|
2437 |
]. |
2376 | 2438 |
^newChangeset |
2439 |
||
2440 |
"Created: / 24-07-2009 / 23:17:38 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
2441 |
"Modified: / 25-07-2009 / 19:40:16 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
2442 |
"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
|
2443 |
"Created: / 30-08-2011 / 16:07:01 / cg" |
2376 | 2444 |
! |
2445 |
||
2446 |
groupByClass |
|
2491
882e07ee86bd
added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents:
2469
diff
changeset
|
2447 |
|nm| |
2376 | 2448 |
|
2449 |
^self |
|
3839 | 2450 |
groupBy: [:change| |
2451 |
change isClassChange ifTrue: [ |
|
2452 |
nm := change className. |
|
2453 |
(nm notNil and:[nm endsWith:' class']) ifTrue:[nm := nm copyTo: nm size - 6]. |
|
2454 |
nm |
|
2455 |
] ifFalse: [ |
|
2456 |
nil |
|
2457 |
] |
|
2458 |
] |
|
2459 |
labelAs: [:className| |
|
2460 |
className |
|
2461 |
] |
|
2462 |
sort: true |
|
2376 | 2463 |
|
2464 |
"Created: / 25-07-2009 / 19:43:14 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
2465 |
"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
|
2466 |
"Modified: / 30-08-2011 / 16:08:38 / cg" |
2376 | 2467 |
! |
2468 |
||
2323 | 2469 |
saveSignedToFile:aFilename |
2470 |
"write the changeSet to a signed file in chunk format" |
|
2471 |
||
2472 |
self saveSignedToFile:aFilename format:nil |
|
2473 |
||
2474 |
"Created: / 08-02-2011 / 11:18:54 / cg" |
|
2475 |
! |
|
2476 |
||
2477 |
saveSignedToFile:aFilename format:formatSymbolOrNil |
|
2478 |
"write the changeSet to a signed file in some format. |
|
2479 |
Sign with the exept key (which you do not have outside of exept!!). |
|
4251 | 2480 |
|
2481 |
formatSymbolOrNil is passed to saveToStream:s format:formatSymbolOrNil, |
|
2482 |
and specifies which fileOut format to use. |
|
2483 |
Nil means: chunk format (currently, the only supported)" |
|
2323 | 2484 |
|
2485 |
|s pkcs7SignedData| |
|
2486 |
||
2852 | 2487 |
self assert: (Smalltalk at:#'Expecco::KeyFileGenerator') notNil. |
2488 |
||
2323 | 2489 |
s := WriteStream on:(String new:2000). |
2490 |
self saveToStream:s format:formatSymbolOrNil. |
|
2491 |
||
2852 | 2492 |
pkcs7SignedData := (Smalltalk at:#'Expecco::KeyFileGenerator') new signExpeccoCode:s contents. |
2323 | 2493 |
aFilename asFilename contents:pkcs7SignedData. |
2494 |
||
4251 | 2495 |
"Modified (comment): / 17-07-2017 / 10:41:44 / cg" |
2323 | 2496 |
! |
2497 |
||
2498 |
saveToFile:aFilename |
|
2499 |
"write the changeSet to a regular file in chunk format" |
|
2500 |
||
2501 |
self saveToFile:aFilename format:nil |
|
2502 |
||
2503 |
"Created: / 08-02-2011 / 11:18:46 / cg" |
|
2504 |
! |
|
2505 |
||
2506 |
saveToFile:aFilename format:formatSymbolOrNil |
|
2881 | 2507 |
"Writes the changeSet to a regular file in some format. |
2508 |
Supported formats are: |
|
2509 |
nil ............ chunk changeset file |
|
2510 |
#classSource ... class fileout format, assumes that |
|
4303 | 2511 |
the receiver is a changeset containing |
2512 |
single class (possibly with its private |
|
2513 |
classes) |
|
2881 | 2514 |
" |
2323 | 2515 |
|
4303 | 2516 |
aFilename asFilename writingFileDo:[:s | |
2517 |
self saveToStream:s format:formatSymbolOrNil. |
|
2518 |
]. |
|
2323 | 2519 |
|
2520 |
"Created: / 08-02-2011 / 11:20:06 / cg" |
|
2881 | 2521 |
"Modified (comment): / 31-07-2012 / 13:38:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2323 | 2522 |
! |
2523 |
||
2524 |
saveToStream:aStream format:formatSymbolOrNil |
|
2881 | 2525 |
"Writes the changeSet to a stream in some format. |
2526 |
Supported formats are: |
|
3445 | 2527 |
nil ............ chunk changeset file format |
2881 | 2528 |
#classSource ... class fileout format, assumes that |
3839 | 2529 |
the receiver is a changeset containing |
2530 |
single class (possibly with its private |
|
2531 |
classes) |
|
2881 | 2532 |
" |
2533 |
||
2323 | 2534 |
|
2535 |
formatSymbolOrNil isNil ifTrue:[ |
|
3839 | 2536 |
ChangeFileWriter new fileOut:self on:aStream. |
2537 |
^ self. |
|
2323 | 2538 |
]. |
2539 |
||
2881 | 2540 |
formatSymbolOrNil == #classSource ifTrue:[ |
3839 | 2541 |
ClassSourceWriter new fileOut:self on:aStream. |
2542 |
^ self. |
|
2881 | 2543 |
]. |
2544 |
||
2545 |
self error:'Unknown format, possible formats are { nil, #classSource }' |
|
2323 | 2546 |
|
2547 |
"Created: / 08-02-2011 / 11:25:16 / cg" |
|
3445 | 2548 |
"Modified (comment): / 04-02-2014 / 18:39:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3904 | 2549 |
! |
2550 |
||
2551 |
sortedByClassName |
|
2552 |
"returns a new changeset containing the changes sorted by class names" |
|
2553 |
||
2554 |
| newChangeset | |
|
2555 |
||
2556 |
newChangeset := self class new: self size. |
|
2557 |
newChangeset addAll:self. |
|
2558 |
newChangeset sort:[:a :b | |
|
2559 |
|nameA nameB| |
|
2560 |
nameA := a isClassChange ifTrue:[ a className ] ifFalse:[ '^other' ]. |
|
2561 |
nameB := b isClassChange ifTrue:[ b className ] ifFalse:[ '^other' ]. |
|
2562 |
nameA < nameB]. |
|
2563 |
^ newChangeset |
|
857 | 2564 |
! ! |
2565 |
||
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2566 |
!ChangeSet::ChangeFileReader methodsFor:'accessing'! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2567 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2568 |
changeAction:aBlock |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2569 |
changeAction := aBlock. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2570 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2571 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2572 |
changeSet:something |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2573 |
"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
|
2574 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2575 |
changeSet := something. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2576 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2577 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2578 |
inputStream:aStream |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2579 |
inputStream := aStream. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2580 |
! ! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2581 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2582 |
!ChangeSet::ChangeFileReader methodsFor:'helpers'! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2583 |
|
1176 | 2584 |
addChange:change |
2881 | 2585 |
|
2586 |
timestamp notNil ifTrue:[change timeStamp: timestamp]. |
|
2587 |
timestamp := nil. |
|
3246 | 2588 |
change isClassChange ifTrue:[ |
3839 | 2589 |
change package: Class packageQuerySignal query. |
2590 |
change nameSpace: Class nameSpaceQuerySignal query. |
|
3246 | 2591 |
]. |
2881 | 2592 |
|
3839 | 2593 |
changeAction |
2594 |
valueWithOptionalArgument:change |
|
2595 |
and:lineNumber |
|
2596 |
and:position. |
|
2008 | 2597 |
|
3445 | 2598 |
"Modified: / 11-06-2013 / 15:57:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1176 | 2599 |
! |
2600 |
||
2601 |
checkReceiverIsGlobalNamed:expectedName |
|
2602 |
^ self variableNameOfReceiver = expectedName |
|
2603 |
! |
|
2604 |
||
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2605 |
classNameOf:aReceiver |
3184 | 2606 |
"old" |
2376 | 2607 |
|
3246 | 2608 |
| nameSpace isMeta clsNode clsName | |
2376 | 2609 |
nameSpace := Class nameSpaceQuerySignal query. |
2610 |
||
3246 | 2611 |
isMeta := false. |
2612 |
classIsJava := false. |
|
2613 |
||
2614 |
||
2615 |
(aReceiver isUnaryMessage and:[aReceiver selector == #class]) ifTrue:[ |
|
3839 | 2616 |
isMeta := true. |
2617 |
clsNode := aReceiver receiver. |
|
3246 | 2618 |
] ifFalse:[ |
3839 | 2619 |
clsNode := aReceiver. |
3246 | 2620 |
]. |
2621 |
||
2622 |
clsNode isMessage ifFalse:[ |
|
3839 | 2623 |
"Normal smalltalk method on Smalltalk class" |
2624 |
clsName := clsNode name |
|
3246 | 2625 |
] ifTrue:[ |
3839 | 2626 |
"Maybe a Java class?" |
2627 |
((clsNode selector == #classForName:) and:[clsNode receiver name = 'Java']) ifTrue:[ |
|
2628 |
clsName := '(Java classForName:''%1'')' bindWith: clsNode arguments first value. |
|
2629 |
classIsJava := true. |
|
2630 |
]. |
|
3246 | 2631 |
]. |
2632 |
||
2633 |
isMeta ifTrue:[ |
|
3839 | 2634 |
clsName := clsName , ' class'. |
3246 | 2635 |
]. |
2376 | 2636 |
|
3184 | 2637 |
(nameSpace ~~ Smalltalk and:[(clsName startsWith: nameSpace name) not]) |
3839 | 2638 |
ifTrue:[ |
2639 |
^ nameSpace name , '::' , clsName |
|
2640 |
] ifFalse:[ |
|
2641 |
^ clsName |
|
2642 |
]. |
|
3184 | 2643 |
|
3246 | 2644 |
"Modified: / 30-01-2013 / 10:02:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3184 | 2645 |
! |
2646 |
||
2647 |
classNameOfRememberingNamespace:aReceiver |
|
2648 |
"new" |
|
2649 |
||
4337 | 2650 |
| nameSpace isMeta clsNode clsName| |
2651 |
||
3184 | 2652 |
nameSpace := Class nameSpaceQuerySignal query. |
3195 | 2653 |
|
3247
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2654 |
isMeta := false. |
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2655 |
classIsJava := false. |
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2656 |
|
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2657 |
(aReceiver isUnaryMessage and:[aReceiver selector == #class]) ifTrue:[ |
4337 | 2658 |
isMeta := true. |
2659 |
clsNode := aReceiver receiver. |
|
3197 | 2660 |
] ifFalse:[ |
4337 | 2661 |
clsNode := aReceiver. |
3247
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2662 |
]. |
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2663 |
|
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2664 |
clsNode isMessage ifFalse:[ |
4337 | 2665 |
"Normal smalltalk method on Smalltalk class" |
2666 |
clsName := clsNode name |
|
3247
09f7b7abf87c
Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3246
diff
changeset
|
2667 |
] ifTrue:[ |
4337 | 2668 |
"Maybe a Java class?" |
2669 |
((clsNode selector == #classForName:) and:[clsNode receiver name = 'Java']) ifTrue:[ |
|
2670 |
clsName := '(Java classForName:''%1'')' bindWith: clsNode arguments first value. |
|
2671 |
classIsJava := true. |
|
2672 |
]. |
|
3195 | 2673 |
]. |
3184 | 2674 |
|
3445 | 2675 |
"Strip off the namespace" |
2676 |
(classIsJava not and:[ nameSpace ~~ Smalltalk]) ifTrue:[ |
|
4337 | 2677 |
(clsName startsWith:(nameSpace name,'::')) ifTrue:[ |
2678 |
clsName := clsName copyFrom: nameSpace name size + 3. |
|
2679 |
] |
|
2680 |
]. |
|
2681 |
||
2682 |
isMeta ifTrue:[ |
|
2683 |
clsName := clsName , ' class'. |
|
3445 | 2684 |
]. |
2685 |
||
4337 | 2686 |
(nameSpace ~~ Smalltalk "and:[(clsName startsWith:(nameSpace name,'::')) not]") |
2687 |
ifTrue:[ |
|
2688 |
"/ old: remember namespace in name |
|
2689 |
"/ ^ nameSpace name , '::' , clsName |
|
2690 |
"/ new: remember in override |
|
2691 |
nameSpaceOverride := nameSpace. |
|
2692 |
^ clsName |
|
2693 |
] ifFalse:[ |
|
2694 |
nameSpaceOverride := nil. |
|
2695 |
^ clsName |
|
2696 |
]. |
|
2745
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2697 |
|
3445 | 2698 |
"Modified: / 11-06-2013 / 17:55:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4337 | 2699 |
"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
|
2700 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2701 |
|
2892 | 2702 |
extractMethodsClassAndSelectorFromReceiver |
2703 |
"helper for all changes which are of the form: |
|
4325 | 2704 |
(className compiledMethodAt:#methodSelector) something: ... |
2892 | 2705 |
" |
2706 |
||
2707 |
(receiver isMessage |
|
2708 |
and:[receiverSelector == #'compiledMethodAt:']) ifFalse:[ |
|
4325 | 2709 |
self proceedableError:'unexpected change'. |
2710 |
^ false. |
|
2892 | 2711 |
]. |
3184 | 2712 |
|
2713 |
"/ className := self classNameOf:receiverReceiver. |
|
2714 |
className := self classNameOfRememberingNamespace:receiverReceiver. |
|
2892 | 2715 |
self assert:className notNil. |
2716 |
||
2717 |
methodSelector := (receiver arguments at:1) evaluate. |
|
2718 |
self assert:methodSelector notNil. |
|
2719 |
^ true. |
|
2720 |
||
2721 |
"Created: / 27-07-2012 / 21:33:47 / cg" |
|
4325 | 2722 |
"Modified: / 24-05-2018 / 14:54:14 / Claus Gittinger" |
2892 | 2723 |
! |
2724 |
||
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2725 |
receiversClassName |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2726 |
^ self classNameOf:receiver |
1176 | 2727 |
! |
2728 |
||
3184 | 2729 |
receiversClassNameRememberingNamespace |
2730 |
^ self classNameOfRememberingNamespace:receiver |
|
2731 |
! |
|
2732 |
||
1176 | 2733 |
variableNameOfReceiver |
2734 |
||
2735 |
receiver isVariable ifFalse:[ ^ nil ]. |
|
2736 |
^ receiver name |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2737 |
! ! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2738 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2739 |
!ChangeSet::ChangeFileReader methodsFor:'reading'! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2740 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2741 |
changesFromParseTree:aTree lineNumber:initialLineNumberOrNil position:initialPositionOrNil |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2742 |
"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
|
2743 |
create changes and evaluate changeAction on each. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2744 |
The chnageAction-block is invoked with the change and a lineNumberOrNil as |
3839 | 2745 |
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
|
2746 |
provides line-numbers; otherwise, nil is passed." |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2747 |
|
2745
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2748 |
^self changesFromParseTree:aTree lineNumber:initialLineNumberOrNil position:initialPositionOrNil chunk: nil |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2749 |
|
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2750 |
"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
|
2751 |
! |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2752 |
|
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2753 |
changesFromParseTree:aTree lineNumber:initialLineNumberOrNil position:initialPositionOrNil chunk: initialChunkOrNil |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2754 |
"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
|
2755 |
create changes and evaluate changeAction on each. |
3964 | 2756 |
The changeAction-block is invoked with the change and a lineNumberOrNil as |
3839 | 2757 |
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
|
2758 |
provides line-numbers; otherwise, nil is passed." |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2759 |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2760 |
lineNumber := initialLineNumberOrNil. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2761 |
position := initialPositionOrNil. |
2745
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2762 |
chunk := initialChunkOrNil. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2763 |
parseTree := aTree. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2764 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2765 |
selector := aTree selector. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2766 |
receiver := aTree receiver. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2767 |
arguments := aTree arguments. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2768 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2769 |
receiver isMessage ifTrue:[ |
3964 | 2770 |
receiverSelector := receiver selector. |
2771 |
receiverReceiver := receiver receiver. |
|
1174
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 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2774 |
^ self processChange |
2745
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2775 |
|
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
2776 |
"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
|
2777 |
! ! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2778 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2779 |
!ChangeSet::ChangeFileReader methodsFor:'reading-private'! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2780 |
|
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2781 |
handleCategoriesForChange |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2782 |
|selector category categories attributes change| |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2783 |
|
2256
b98137d2aa30
changed: #changesFromStream:for:reader:do:
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
2784 |
selector := arguments first value. |
3184 | 2785 |
className := self receiversClassNameRememberingNamespace. |
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2786 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2787 |
categories := OrderedCollection new. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2788 |
attributes := OrderedCollection new. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2789 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2790 |
[ |
3957 | 2791 |
inputStream skipSeparators. |
2792 |
category := inputStream nextChunk. |
|
2793 |
category notEmptyOrNil |
|
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2794 |
] whileTrue:[ |
3957 | 2795 |
( #( 'public' 'private' ) includes: category) ifTrue:[ |
2796 |
attributes add:category |
|
2797 |
] ifFalse:[ |
|
2798 |
categories add:category |
|
2799 |
]. |
|
2800 |
]. |
|
2801 |
categories notEmpty ifTrue:[ |
|
2802 |
categories size == 1 ifTrue:[ |
|
2803 |
category := categories first. |
|
2804 |
] ifFalse:[ |
|
2805 |
category := categories asStringWith:' and ' |
|
2806 |
]. |
|
2807 |
change := MethodCategoryChange |
|
2808 |
className:className |
|
2809 |
selector:selector |
|
2810 |
source:(parseTree printString) |
|
2811 |
category:category. |
|
2812 |
self addChange:change. |
|
2813 |
]. |
|
2814 |
||
2815 |
attributes notEmpty ifTrue:[ |
|
2816 |
attributes size == 1 ifTrue:[ |
|
2817 |
"/ easy |
|
2818 |
(attributes first = 'public') ifTrue:[ |
|
2819 |
"/ default anyway - ignore |
|
2820 |
] ifFalse:[ |
|
2821 |
change := MethodPrivacyChange |
|
2822 |
className:className |
|
2823 |
selector:selector |
|
2824 |
privacy:(attributes first asSymbol). |
|
2825 |
change nameSpaceOverride:nameSpaceOverride. |
|
2826 |
change source:(parseTree printString). |
|
2827 |
self addChange:change. |
|
2828 |
]. |
|
2829 |
] ifFalse:[ |
|
2830 |
self halt:'multiple/missing attributes not supported'. |
|
2831 |
]. |
|
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2832 |
]. |
3957 | 2833 |
^ true |
2834 |
||
2835 |
"Modified: / 11-06-2013 / 16:11:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2836 |
! |
|
2837 |
||
2838 |
handleCategoriesForClassChange |
|
2839 |
|category categories attributes change| |
|
2840 |
||
2841 |
className := self receiversClassNameRememberingNamespace. |
|
2842 |
||
2843 |
categories := OrderedCollection new. |
|
2844 |
attributes := OrderedCollection new. |
|
2845 |
||
2846 |
[ |
|
2847 |
inputStream skipSeparators. |
|
2848 |
category := inputStream nextChunk. |
|
2849 |
category notEmptyOrNil |
|
2850 |
] whileTrue:[ |
|
2851 |
( #( 'public' 'private' ) includes: category) ifTrue:[ |
|
2852 |
attributes add:category |
|
2853 |
] ifFalse:[ |
|
2854 |
categories add:category |
|
2855 |
]. |
|
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2856 |
]. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2857 |
|
3957 | 2858 |
categories notEmpty ifTrue:[ |
2859 |
categories size == 1 ifTrue:[ |
|
2860 |
"/ easy |
|
2861 |
category := categories first |
|
2862 |
] ifFalse:[ |
|
2863 |
category := categories asStringWith:' and ' |
|
2864 |
]. |
|
2865 |
change := ClassCategoryChange new |
|
2866 |
className:className |
|
2867 |
category:category. |
|
2868 |
self addChange:change. |
|
2869 |
]. |
|
2870 |
||
2871 |
attributes notEmpty ifTrue:[ |
|
2872 |
attributes size == 1 ifTrue:[ |
|
2873 |
"/ easy |
|
2874 |
(attributes first = 'public') ifTrue:[ |
|
2875 |
"/ default anyway - ignore |
|
2876 |
] ifFalse:[ |
|
2877 |
"/ a private class!! |
|
2878 |
"/ change := ClassDefinitionChange |
|
2879 |
"/ className:className |
|
2880 |
"/ selector:selector |
|
2881 |
"/ privacy:(attributes first asSymbol). |
|
2882 |
"/ change nameSpaceOverride:nameSpaceOverride. |
|
2883 |
"/ change source:(parseTree printString). |
|
2884 |
"/ self addChange:change. |
|
2885 |
]. |
|
2886 |
] ifFalse:[ |
|
2887 |
self halt:'multiple/missing attributes not supported'. |
|
2888 |
]. |
|
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2889 |
]. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2890 |
^ true |
3445 | 2891 |
|
2892 |
"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
|
2893 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
2894 |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2895 |
handleClassCommentChange |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2896 |
|change| |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2897 |
|
3184 | 2898 |
className := self receiversClassNameRememberingNamespace. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2899 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2900 |
change := ClassCommentChange new. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2901 |
change className:className comment:(arguments at:1) evaluate. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2902 |
change source:(parseTree printString). |
1176 | 2903 |
self addChange:change. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2904 |
^ true |
3445 | 2905 |
|
2906 |
"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
|
2907 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2908 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2909 |
handleClassDefinitionChange |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2910 |
|nameSpace change| |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2911 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2912 |
className := (arguments at:1) evaluate. |
3184 | 2913 |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2914 |
nameSpace := Class nameSpaceQuerySignal query. |
3184 | 2915 |
(nameSpace == Smalltalk) ifTrue:[ nameSpace := nil ]. |
2916 |
||
2917 |
"/ old: remember namespace in className |
|
2918 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
|
2919 |
"/ className := nameSpace name , '::' , className |
|
2920 |
"/ ]. |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2921 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2922 |
change := ClassDefinitionChange new. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2923 |
change className:className; source:(parseTree printString). |
3860 | 2924 |
change definitionSelector:selector. |
2925 |
||
1453 | 2926 |
receiver isVariable ifTrue:[ |
3860 | 2927 |
change superClassName:receiver name. |
1453 | 2928 |
]. |
1428
807f0bc05504
more state in classdefinition change
Claus Gittinger <cg@exept.de>
parents:
1422
diff
changeset
|
2929 |
selector keywords with:arguments do:[:kw :arg | |
3860 | 2930 |
kw = #'instanceVariableNames:' ifTrue:[ |
2931 |
change instanceVariableString:arg evaluate. |
|
2932 |
]. |
|
2933 |
kw = #'classVariableNames:' ifTrue:[ |
|
2934 |
change classVariableString:arg evaluate. |
|
2935 |
]. |
|
2936 |
kw = #'poolDictionaries:' ifTrue:[ |
|
2937 |
change poolDictionaries:arg evaluate. |
|
2938 |
]. |
|
2939 |
kw = #'category:' ifTrue:[ |
|
2940 |
change category:arg evaluate. |
|
2941 |
]. |
|
2942 |
kw = #'privateIn:' ifTrue:[ |
|
2943 |
| nm | |
|
2944 |
||
2945 |
nm := arg name. |
|
2946 |
nameSpace notNil ifTrue:[ |
|
2947 |
(nm startsWith: nameSpace name) ifTrue:[ |
|
2948 |
nm := nm copyFrom: nameSpace name size + 3. |
|
2949 |
]. |
|
2950 |
]. |
|
2951 |
change className:(nm ,'::',change classNameWithoutNamespace). |
|
2952 |
change owningClassName:nm. |
|
2953 |
change private:true. |
|
2954 |
]. |
|
4514 | 2955 |
"/ treat squeak package as category |
2956 |
kw = #'package:' ifTrue:[ |
|
2957 |
change category:arg evaluate. |
|
2958 |
]. |
|
1428
807f0bc05504
more state in classdefinition change
Claus Gittinger <cg@exept.de>
parents:
1422
diff
changeset
|
2959 |
]. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2960 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2961 |
change package:(Class packageQuerySignal query). |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2962 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2963 |
"/ change nameSpaceName:(nameSpace name). |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2964 |
"/ ]. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2965 |
"/ |
1176 | 2966 |
self addChange:change. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2967 |
^ true |
2290 | 2968 |
|
2969 |
"Modified: / 30-08-2010 / 13:56:32 / cg" |
|
3445 | 2970 |
"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
|
2971 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2972 |
|
3839 | 2973 |
handleClassInitializeChange |
3526
e64bd3cbd704
For class initialization chunk, create ClassInitializeChange instead of plain DoItChange.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3521
diff
changeset
|
2974 |
| change nm | |
e64bd3cbd704
For class initialization chunk, create ClassInitializeChange instead of plain DoItChange.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3521
diff
changeset
|
2975 |
|
e64bd3cbd704
For class initialization chunk, create ClassInitializeChange instead of plain DoItChange.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3521
diff
changeset
|
2976 |
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
|
2977 |
|
e64bd3cbd704
For class initialization chunk, create ClassInitializeChange instead of plain DoItChange.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3521
diff
changeset
|
2978 |
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
|
2979 |
change className: nm. |
3197 | 2980 |
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
|
2981 |
|
3197 | 2982 |
^ true |
3526
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 |
"Modified: / 21-03-2014 / 18:19:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3197 | 2985 |
! |
2986 |
||
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2987 |
handleClassInstanceVariableDefinitionChange |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2988 |
|change| |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2989 |
|
3184 | 2990 |
className := self receiversClassNameRememberingNamespace. |
2991 |
||
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2992 |
change := ClassInstVarDefinitionChange new. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2993 |
change className:className. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2994 |
change source:(parseTree printString). |
2617
a9e632776c57
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2524
diff
changeset
|
2995 |
change classInstVarNames:(parseTree arguments first value asCollectionOfWords asArray). |
1176 | 2996 |
self addChange:change. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
2997 |
^ true |
2617
a9e632776c57
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2524
diff
changeset
|
2998 |
|
a9e632776c57
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2524
diff
changeset
|
2999 |
"Modified: / 25-11-2011 / 17:40:49 / cg" |
3445 | 3000 |
"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
|
3001 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3002 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3003 |
handleMethodCategoryChange |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3004 |
|change| |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3005 |
|
2867
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3006 |
self extractMethodsClassAndSelectorFromReceiver ifFalse:[ |
3839 | 3007 |
^ false. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3008 |
]. |
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 |
change := MethodCategoryChange new. |
3839 | 3011 |
change |
3012 |
className:className |
|
3013 |
selector:methodSelector |
|
3014 |
category:(arguments at:1) evaluate. |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3015 |
|
1176 | 3016 |
self addChange:change. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3017 |
^ true |
2867
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3018 |
|
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3019 |
"Modified: / 27-07-2012 / 21:34:42 / cg" |
3445 | 3020 |
"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
|
3021 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3022 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3023 |
handleMethodCategoryRenameChange |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3024 |
|change| |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3025 |
|
3184 | 3026 |
className := self receiversClassNameRememberingNamespace. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3027 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3028 |
change := MethodCategoryRenameChange new. |
3839 | 3029 |
change |
3030 |
className:className; |
|
3031 |
oldCategoryName:(arguments at:1) evaluate |
|
3032 |
newCategoryName:(arguments at:2) evaluate. |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3033 |
|
1176 | 3034 |
self addChange:change. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3035 |
^ true |
3445 | 3036 |
|
3037 |
"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
|
3038 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3039 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3040 |
handleMethodChange |
2745
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
3041 |
[ |
3839 | 3042 |
^ self handleMethodChangeUnsafe |
2745
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
3043 |
] on: Error do:[:ex| |
3839 | 3044 |
| change | |
3045 |
||
3046 |
change := InvalidChange new source: chunk. |
|
3047 |
self addChange: change. |
|
3048 |
||
3049 |
"Read methods that may follow" |
|
3050 |
||
3051 |
[ (chunk := inputStream nextChunk) notEmptyOrNil ] whileTrue:[ |
|
3052 |
change := InvalidChange new source: chunk. |
|
3053 |
self addChange: change. |
|
3054 |
] |
|
2745
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
3055 |
]. |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
3056 |
|
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
3057 |
^ true |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
3058 |
|
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
3059 |
"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
|
3060 |
! |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
3061 |
|
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
3062 |
handleMethodChangeUnsafe |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3063 |
|priv categoryName methodSource changes change parser | |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3064 |
|
3184 | 3065 |
className := self receiversClassNameRememberingNamespace. |
3066 |
||
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3067 |
(selector == #'ignoredMethodsFor:') ifTrue:[ |
3839 | 3068 |
priv := #ignored. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3069 |
] ifFalse:[ |
3839 | 3070 |
priv := nil |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3071 |
]. |
3246 | 3072 |
classIsJava := false. |
3839 | 3073 |
((selector == #'methods') |
1977 | 3074 |
or:[(selector == #'publicMethods') |
3075 |
or:[(selector == #'methodsFor')]]) ifTrue:[ |
|
3839 | 3076 |
categoryName := 'uncategorized public' |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3077 |
] ifFalse:[ |
3839 | 3078 |
(selector == #'privateMethods') ifTrue:[ |
3079 |
categoryName := 'uncategorized private' |
|
3080 |
] ifFalse:[ |
|
3081 |
categoryName := (arguments at:1) evaluate. |
|
3082 |
] |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3083 |
]. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3084 |
inputStream skipSeparators. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3085 |
lineNumber := inputStream lineNumber. |
3521
6e43c118d860
Fixes for reading changesets from non-positionable streams
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3520
diff
changeset
|
3086 |
"/ 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
|
3087 |
position := nil. |
6e43c118d860
Fixes for reading changesets from non-positionable streams
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3520
diff
changeset
|
3088 |
inputStream isPositionable ifTrue:[ |
3839 | 3089 |
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
|
3090 |
]. |
1176 | 3091 |
|
2745
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
3092 |
methodSource := chunk := inputStream nextChunk. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3093 |
changes := OrderedCollection new. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3094 |
|
1395
6ea99b157f6b
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
1389
diff
changeset
|
3095 |
[methodSource notEmptyOrNil] whileTrue:[ |
3839 | 3096 |
parser := Parser |
3097 |
parseMethodArgAndVarSpecification:methodSource |
|
3098 |
in:nil |
|
3099 |
ignoreErrors:true |
|
3100 |
ignoreWarnings:true |
|
3101 |
parseBody:false. |
|
3102 |
||
3103 |
parser isNil ifTrue:[ |
|
3104 |
"/ something wierd ... |
|
3105 |
methodSelector := '????'. |
|
3106 |
] ifFalse:[ |
|
3107 |
methodSelector := parser selector. |
|
3108 |
]. |
|
3109 |
||
3110 |
change := MethodDefinitionChange new. |
|
3111 |
change |
|
3112 |
className:className |
|
3113 |
selector:methodSelector |
|
3114 |
source:methodSource |
|
3115 |
category:categoryName |
|
3116 |
privacy:priv. |
|
3117 |
"/ huh - where is classIsJava: implemented??? |
|
3118 |
classIsJava ifTrue:[ change classIsJava: classIsJava ]. |
|
3119 |
||
3120 |
self addChange:change. |
|
3121 |
||
3122 |
inputStream skipSeparators. |
|
3123 |
lineNumber := inputStream lineNumber. |
|
3124 |
"/ Care for non-positionable streams |
|
3125 |
position := nil. |
|
3126 |
inputStream isPositionable ifTrue:[ |
|
3127 |
position := inputStream position + 1. |
|
3128 |
]. |
|
3129 |
methodSource := chunk := inputStream nextChunk. |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3130 |
]. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3131 |
^ true |
2745
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
3132 |
|
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
3133 |
"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
|
3134 |
"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
|
3135 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3136 |
|
2892 | 3137 |
handleMethodPackageChange |
3138 |
|change| |
|
3139 |
||
3140 |
self extractMethodsClassAndSelectorFromReceiver ifFalse:[ |
|
3839 | 3141 |
^ false. |
2892 | 3142 |
]. |
3143 |
||
3144 |
change := MethodPackageChange new. |
|
3839 | 3145 |
change |
3146 |
className:className |
|
3147 |
selector:methodSelector |
|
3148 |
package:(arguments at:1) evaluate. |
|
2892 | 3149 |
|
3150 |
self addChange:change. |
|
3151 |
^ true |
|
3152 |
||
3153 |
"Created: / 27-07-2012 / 21:31:25 / cg" |
|
3445 | 3154 |
"Modified: / 11-06-2013 / 16:11:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2892 | 3155 |
! |
3156 |
||
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3157 |
handleMethodPrivacyChange |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3158 |
|change| |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3159 |
|
2867
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3160 |
self extractMethodsClassAndSelectorFromReceiver ifFalse:[ |
3839 | 3161 |
^ false. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3162 |
]. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3163 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3164 |
change := MethodPrivacyChange new. |
3839 | 3165 |
change |
3166 |
className:className |
|
3167 |
selector:methodSelector |
|
3168 |
privacy:(arguments at:1) evaluate. |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3169 |
|
1176 | 3170 |
self addChange:change. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3171 |
^ true |
2867
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3172 |
|
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3173 |
"Modified: / 27-07-2012 / 21:35:20 / cg" |
3445 | 3174 |
"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
|
3175 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3176 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3177 |
handleNameSpaceCreationChange |
1176 | 3178 |
|change| |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3179 |
|
1176 | 3180 |
(self checkReceiverIsGlobalNamed:#Namespace) ifFalse:[ |
4325 | 3181 |
(self checkReceiverIsGlobalNamed:#NameSpace) ifFalse:[ |
3182 |
self proceedableError:'unexpected receiver in nameSpace message'. |
|
3183 |
^ false |
|
3184 |
]. |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3185 |
]. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3186 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3187 |
className := (arguments at:1) evaluate. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3188 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3189 |
change := NameSpaceCreationChange new. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3190 |
change name:className. |
1176 | 3191 |
self addChange:change. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3192 |
^ true |
4325 | 3193 |
|
3194 |
"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
|
3195 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3196 |
|
3839 | 3197 |
handlePrimitiveChange |
3184 | 3198 |
self handlePrimitiveChange:nil |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3199 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3200 |
|
2892 | 3201 |
handlePrimitiveChange: sourceOrNil |
3202 |
"if sourceOrNil is nil, the def has not been read and must be read from |
|
3203 |
the next chunk. Otherwise, it has been already read as argument." |
|
3204 |
||
3205 |
|change primSource| |
|
3206 |
||
3184 | 3207 |
className := self receiversClassNameRememberingNamespace. |
3208 |
||
2892 | 3209 |
sourceOrNil notNil ifTrue:[ |
3839 | 3210 |
primSource := sourceOrNil |
2892 | 3211 |
] ifFalse:[ |
3839 | 3212 |
inputStream skipSeparators. |
3213 |
primSource := inputStream nextChunk. |
|
2892 | 3214 |
]. |
3215 |
||
3216 |
(selector == #'primitiveDefinitions' or:[ selector == #'primitiveDefinitions:' ]) ifTrue:[ |
|
3839 | 3217 |
change := ClassPrimitiveDefinitionsChange new |
2892 | 3218 |
] ifFalse:[ |
3839 | 3219 |
(selector == #'primitiveFunctions' or:[ selector == #'primitiveFunctions:' ]) ifTrue:[ |
3220 |
change := ClassPrimitiveFunctionsChange new |
|
3221 |
] ifFalse:[ |
|
3222 |
change := ClassPrimitiveVariablesChange new |
|
3223 |
] |
|
2892 | 3224 |
]. |
3225 |
change className:className source:primSource. |
|
3226 |
self addChange:change. |
|
3227 |
^ true |
|
3228 |
||
3229 |
"Created: / 27-07-2012 / 21:39:55 / cg" |
|
3445 | 3230 |
"Modified (format): / 11-06-2013 / 16:12:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2892 | 3231 |
! |
3232 |
||
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3233 |
handleRemoveClassChange |
1176 | 3234 |
|change| |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3235 |
|
1176 | 3236 |
(self checkReceiverIsGlobalNamed:#Smalltalk) ifFalse:[ |
4325 | 3237 |
self proceedableError:'unexpected receiver in remove-class message'. |
3238 |
^ false |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3239 |
]. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3240 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3241 |
className := (arguments at:1) name. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3242 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3243 |
"/ className := nameSpace name , '::' , className |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3244 |
"/ ]. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3245 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3246 |
change := ClassRemoveChange new. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3247 |
change className:className. |
1176 | 3248 |
self addChange:change. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3249 |
^ true |
4325 | 3250 |
|
3251 |
"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
|
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 |
handleRemoveMethodChange |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3255 |
|change| |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3256 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3257 |
className := self receiversClassName. |
3184 | 3258 |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3259 |
methodSelector := (arguments at:1) evaluate. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3260 |
change := MethodRemoveChange new. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3261 |
change className:className selector:methodSelector. |
1176 | 3262 |
self addChange:change. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3263 |
^ true |
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 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3266 |
handleRenameClassChange |
1176 | 3267 |
|oldName newName change| |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3268 |
|
1176 | 3269 |
(self checkReceiverIsGlobalNamed:#Smalltalk) ifFalse:[ |
4325 | 3270 |
self proceedableError:'unexpected receiver in rename-class message'. |
3271 |
^ false. |
|
1174
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 |
oldName := (arguments at:1) name. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3275 |
newName := (arguments at:2) evaluate. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3276 |
|
1176 | 3277 |
change := ClassRenameChange new oldName:oldName newName:newName. |
3278 |
self addChange:change. |
|
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3279 |
^ true |
4325 | 3280 |
|
3281 |
"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
|
3282 |
! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3283 |
|
1181
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
3284 |
handleSqueakCommentStamp |
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
3285 |
|comment change| |
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
3286 |
|
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
3287 |
inputStream skipSeparators. |
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
3288 |
|
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
3289 |
comment := inputStream nextChunk. |
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
3290 |
|
3184 | 3291 |
className := self receiversClassNameRememberingNamespace. |
3292 |
||
1181
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
3293 |
change := ClassCommentChange new. |
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
3294 |
change className:className comment:comment. |
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
3295 |
change source:(parseTree printString). |
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
3296 |
self addChange:change. |
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
3297 |
^ true |
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
3298 |
! |
e13c86138164
more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents:
1176
diff
changeset
|
3299 |
|
1183 | 3300 |
handleVW7ClassDefinitionChange |
3301 |
|nameSpace change| |
|
3302 |
||
3303 |
nameSpace := receiver. |
|
3304 |
className := (arguments at:1) evaluate. |
|
3305 |
||
3306 |
"/ nameSpace := Class nameSpaceQuerySignal query. |
|
3307 |
"/ nameSpace ~~ Smalltalk ifTrue:[ |
|
3308 |
"/ className := nameSpace name , '::' , className |
|
3309 |
"/ ]. |
|
3310 |
||
3311 |
change := ClassDefinitionChange new. |
|
3312 |
change className:className; source:(parseTree printString). |
|
3313 |
||
3314 |
change package:(Class packageQuerySignal query). |
|
3315 |
self addChange:change. |
|
3316 |
^ true |
|
3317 |
! |
|
3318 |
||
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3319 |
processChange |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3320 |
"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
|
3321 |
create changes and evaluate changeAction on each. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3322 |
The block is invoked with the change and a lineNumberOrNil as |
3839 | 3323 |
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
|
3324 |
provides line-numbers; otherwise, nil is passed." |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3325 |
|
2745
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
3326 |
[ |
3839 | 3327 |
^ self processChangeUnsafe |
2745
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
3328 |
] on: Error do:[:ex| |
3839 | 3329 |
| change | |
3330 |
||
3331 |
change := DoItChange new source: chunk. |
|
3332 |
self addChange: change. |
|
2745
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
3333 |
]. |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
3334 |
|
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
3335 |
^true |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
3336 |
|
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
3337 |
"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
|
3338 |
! |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
3339 |
|
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
3340 |
processChangeUnsafe |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
3341 |
"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
|
3342 |
create changes and evaluate changeAction on each. |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
3343 |
The block is invoked with the change and a lineNumberOrNil as |
3839 | 3344 |
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
|
3345 |
provides line-numbers; otherwise, nil is passed." |
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
3346 |
|
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3347 |
|dispatchSelector| |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3348 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3349 |
dispatchSelector := ('process_',(selector copyReplaceAll:$: with:$_)) asSymbol. |
2122 | 3350 |
"/ Transcript showCR:dispatchSelector. |
2179 | 3351 |
(self respondsTo:dispatchSelector) ifTrue:[ |
3839 | 3352 |
^ self perform:dispatchSelector. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3353 |
]. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3354 |
|
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3355 |
"/ any subclass definiton selector ? |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3356 |
(Behavior definitionSelectors includes:selector) |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3357 |
ifTrue:[ |
3839 | 3358 |
^ self handleClassDefinitionChange. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3359 |
]. |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3360 |
|
3195 | 3361 |
self error:'unhandled change selector: ',selector. |
1174
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
3362 |
^ false |
2745
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
3363 |
|
c2f7200248e7
More robust changeset reading - creates InvalidChange when an error
vrany
parents:
2633
diff
changeset
|
3364 |
"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
|
3365 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3366 |
|
2881 | 3367 |
processInfo: string |
3368 |
"Processes 'info record' - an info record consist of a chunk containing |
|
3369 |
single string literal starting with ----, such as: |
|
3370 |
||
3371 |
'---- timestamp jv@neso 12-03-2012 10:49:40 ----' |
|
3372 |
'---- snapshot st.img 30-03-2012 11:40:24 ----' |
|
3373 |
'---- checkin SVN::ConfigurationApp into stx:libsvn (1.12) 12-03-2012 10:51:15 ----' |
|
3374 |
'---- rake update 30-03-2012 11:40:24 ----' |
|
3375 |
'---- start 30-03-2012 11:40:24 ----' |
|
3376 |
||
3377 |
timestamp info records are (for historical reasons) processed in ChangeSet |
|
3378 |
" |
|
3379 |
||
3380 |
| kind sel | |
|
3381 |
inputStream skip: 5. |
|
3382 |
kind := inputStream upTo: Character space. |
|
3184 | 3383 |
(kind endsWith:$:) ifTrue:[ |
3839 | 3384 |
kind := kind copyButLast:1 |
3184 | 3385 |
]. |
2881 | 3386 |
sel := ('process_', kind) asSymbolIfInterned. |
3387 |
sel notNil ifTrue:[ |
|
3839 | 3388 |
MessageNotUnderstood handle:[ |
3389 |
self process_otherInfo:kind |
|
3390 |
] do:[ |
|
3391 |
self perform: sel. |
|
3392 |
] |
|
3393 |
] ifFalse:[ |
|
3394 |
self process_otherInfo:kind |
|
2881 | 3395 |
] |
3396 |
||
3397 |
"Created: / 30-03-2012 / 16:44:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3398 |
! |
|
3399 |
||
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3400 |
process_category_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3401 |
"'category:' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3402 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3403 |
^ self handleMethodCategoryChange. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3404 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3405 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3406 |
process_comment_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3407 |
"'comment:' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3408 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3409 |
^ self handleClassCommentChange. |
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 |
|
3184 | 3412 |
process_encoding |
3413 |
"St/X encoding info record. Ignored" |
|
3414 |
! |
|
3415 |
||
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3416 |
process_ignoredMethodsFor_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3417 |
"'ignoredMethodsFor:' chunk (ST/X)" |
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 |
^ self handleMethodChange. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3420 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3421 |
|
3197 | 3422 |
process_initialize |
3423 |
"'class initialize' chunk" |
|
3424 |
||
3425 |
^ self handleClassInitializeChange |
|
3426 |
! |
|
3427 |
||
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3428 |
process_instanceVariableNames_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3429 |
"'instanceVariableNames:' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3430 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3431 |
^ self handleClassInstanceVariableDefinitionChange. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3432 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3433 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3434 |
process_name_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3435 |
"'name:' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3436 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3437 |
^ self handleNameSpaceCreationChange. |
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 |
|
3184 | 3440 |
process_otherInfo:what |
3441 |
"'---- <what> 12-03-2012 10:49:40 ----' |
|
3442 |
||
3443 |
'<what>' is already read from inputStream. |
|
3444 |
" |
|
3445 |
||
3446 |
"/ inputStream skipSeparators. |
|
3447 |
self addChange: (InfoChange type: what data: (inputStream upToEnd) timestamp: nil) |
|
3448 |
||
3449 |
"Created: / 18-05-2012 / 17:03:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3450 |
! |
|
3451 |
||
2892 | 3452 |
process_package_ |
3453 |
"'package:' chunk (ST/X)" |
|
3454 |
||
3455 |
^ self handleMethodPackageChange. |
|
3456 |
||
3457 |
"Created: / 27-07-2012 / 21:36:30 / cg" |
|
3458 |
! |
|
3459 |
||
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3460 |
process_primitiveDefinitions |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3461 |
"'primitiveDefinitions' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3462 |
|
2867
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3463 |
^ self handlePrimitiveChange:nil. |
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3464 |
|
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3465 |
"Modified: / 27-07-2012 / 21:40:33 / cg" |
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3466 |
! |
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3467 |
|
2892 | 3468 |
process_primitiveDefinitions_ |
3469 |
"'primitiveDefinitions:' chunk (ST/X)" |
|
3470 |
||
3471 |
^ self handlePrimitiveChange: (arguments at:1) evaluate. |
|
3472 |
||
3473 |
"Created: / 27-07-2012 / 21:42:03 / cg" |
|
3474 |
! |
|
3475 |
||
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3476 |
process_primitiveFunctions |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3477 |
"'primitiveFunctions' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3478 |
|
2867
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3479 |
^ self handlePrimitiveChange:nil. |
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3480 |
|
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3481 |
"Modified: / 27-07-2012 / 21:40:23 / cg" |
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3482 |
! |
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3483 |
|
2892 | 3484 |
process_primitiveFunctions_ |
3485 |
"'primitiveFunctions:' chunk (ST/X)" |
|
3486 |
||
3487 |
^ self handlePrimitiveChange: (arguments at:1) evaluate. |
|
3488 |
||
3489 |
"Created: / 27-07-2012 / 21:37:21 / cg" |
|
3490 |
! |
|
3491 |
||
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3492 |
process_primitiveVariables |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3493 |
"'primitiveVariables' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3494 |
|
2867
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3495 |
^ self handlePrimitiveChange:nil. |
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3496 |
|
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3497 |
"Modified: / 27-07-2012 / 21:40:35 / cg" |
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3498 |
! |
6d868612727b
fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents:
2852
diff
changeset
|
3499 |
|
2892 | 3500 |
process_primitiveVariables_ |
3501 |
"'primitiveVariables:' chunk (ST/X)" |
|
3502 |
||
3503 |
^ self handlePrimitiveChange: (arguments at:1) evaluate. |
|
3504 |
||
3505 |
"Created: / 27-07-2012 / 21:41:49 / cg" |
|
3506 |
! |
|
3507 |
||
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3508 |
process_privacy_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3509 |
"'privacy:' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3510 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3511 |
^ self handleMethodPrivacyChange. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3512 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3513 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3514 |
process_privateMethods |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3515 |
"'privateMethods' chunk (ST/V and dolphin)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3516 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3517 |
^ self handleMethodChange. |
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 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3520 |
process_privateMethodsFor_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3521 |
"'privateMethodsFor:' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3522 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3523 |
^ self handleMethodChange. |
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 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3526 |
process_protectedMethodsFor_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3527 |
"'protectedMethodsFor:' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3528 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3529 |
^ self handleMethodChange. |
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 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3532 |
process_publicMethodsFor_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3533 |
"'publicMethodsFor:' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3534 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3535 |
^ self handleMethodChange. |
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 |
|
3246 | 3538 |
process_rake |
3539 |
"Rake build system info record |
|
3540 |
||
3541 |
'---- rake update st.img 12-03-2012 10:49:40 ----'!! |
|
3542 |
'---- rake compile st.img 12-03-2012 10:49:40 ----'!! |
|
3543 |
||
3544 |
'rake' is already read from inputStream. |
|
3545 |
" |
|
3546 |
||
3547 |
| ts what | |
|
3548 |
||
3549 |
inputStream skipSeparators. |
|
3550 |
what := inputStream through: Character space. "/read snapshot name |
|
3551 |
inputStream through: Character space. "/skip username@host |
|
3552 |
ts := Timestamp readFrom: inputStream. |
|
3553 |
self addChange: (InfoChange type: #rake data: what timestamp: ts) |
|
3554 |
||
3555 |
"Created: / 01-08-2012 / 19:33:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3556 |
! |
|
3557 |
||
2117
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3558 |
process_removeClass_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3559 |
"'removeClass:' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3560 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3561 |
^ self handleRemoveClassChange. |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3562 |
! |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3563 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3564 |
process_removeSelector_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3565 |
"'removeSelector:' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3566 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3567 |
^ self handleRemoveMethodChange. |
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 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3570 |
process_renameCategory_to_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3571 |
"'renameCategory:to:' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3572 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3573 |
^ self handleMethodCategoryRenameChange. |
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 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3576 |
process_renameClass_to_ |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3577 |
"'renameClass:to:' chunk (ST/X)" |
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3578 |
|
4ff77bbf9f89
refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents:
2080
diff
changeset
|
3579 |
^ self handleRenameClassChange. |
2881 | 3580 |
! |
3581 |
||
3582 |
process_snapshot |
|
3583 |
"St/X system start info record |
|
3584 |
||
3585 |
'---- snapshot st.img 12-03-2012 10:49:40 ----'!! |
|
3586 |
||
3587 |
'start' is already read from inputStream. |
|
3588 |
" |
|
3589 |
||
3590 |
| ts file | |
|
3591 |
||
3592 |
inputStream skipSeparators. |
|
3593 |
file := inputStream through: Character space. "/read snapshot name |
|
3594 |
ts := Timestamp readFrom: inputStream. |
|
3595 |
self addChange: (InfoChange type: #snapshot data: file timestamp: ts) |
|
3596 |
||
3597 |
"Created: / 18-05-2012 / 17:04:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3598 |
! |
|
3599 |
||
3600 |
process_start |
|
3601 |
"St/X system start info record |
|
3602 |
||
3603 |
'---- start 12-03-2012 10:49:40 ----'!! |
|
3604 |
||
3605 |
'start' is already read from inputStream. |
|
3606 |
" |
|
3607 |
||
3608 |
| ts | |
|
3609 |
||
3610 |
inputStream skipSeparators. |
|
3611 |
ts := Timestamp readFrom: inputStream. |
|
3612 |
self addChange: (InfoChange type: #start data: nil timestamp: ts) |
|
3613 |
||
3614 |
"Created: / 18-05-2012 / 17:03:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3615 |
! |
|
3616 |
||
3617 |
process_timestamp |
|
3618 |
"St/X timestamp info record. Example: |
|
3619 |
||
3620 |
'---- timestamp jv@neso 12-03-2012 10:49:40 ----'!! |
|
3621 |
||
3622 |
'timestamp' is already read from inputStream. |
|
3623 |
" |
|
3624 |
||
3625 |
inputStream skipSeparators; through: Character space. "/read username@host |
|
3626 |
timestamp := Timestamp readFrom: inputStream. |
|
3627 |
||
3628 |
"Created: / 02-04-2012 / 19:08:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3629 |
! ! |
|
3630 |
||
3832 | 3631 |
!ChangeSet::ChangeFileReader methodsFor:'reading-private-dolphin'! |
3632 |
||
3957 | 3633 |
process_categoriesForClass |
3634 |
"'categoriesForClass' chunk (Dolphin)" |
|
3635 |
||
3636 |
^ self handleCategoriesForClassChange. |
|
3637 |
! |
|
3638 |
||
3832 | 3639 |
process_categoriesFor_ |
3640 |
"'categoriesFor:' chunk (Dolphin)" |
|
3641 |
||
3642 |
^ self handleCategoriesForChange. |
|
3643 |
! |
|
3644 |
||
3957 | 3645 |
process_methods |
3646 |
"'methods' chunk (ST/V and dolphin)" |
|
3647 |
||
3648 |
^ self handleMethodChange. |
|
3649 |
! |
|
3650 |
||
3651 |
process_methodsFor |
|
3652 |
"'methodsFor' chunk (ST/V and dolphin)" |
|
3653 |
||
3654 |
^ self handleMethodChange. |
|
3655 |
! |
|
3656 |
||
3832 | 3657 |
process_methodsForUndefined_ |
3658 |
"'methodsForUndefined:' chunk (?)" |
|
3659 |
||
3660 |
^ self handleMethodChange. |
|
3661 |
! |
|
3662 |
||
3957 | 3663 |
process_methodsFor_ |
3664 |
"'methodsFor:' chunk (ST/80, Squeak, ST/X, VW, ...)" |
|
3665 |
||
3666 |
^ self handleMethodChange. |
|
3667 |
! |
|
3668 |
||
3832 | 3669 |
process_publicMethods |
3670 |
"'publicMethods' chunk (ST/V and dolphin)" |
|
3671 |
||
3672 |
^ self handleMethodChange. |
|
3673 |
! ! |
|
3674 |
||
3675 |
!ChangeSet::ChangeFileReader methodsFor:'reading-private-gravel'! |
|
3676 |
||
3677 |
process_addClassMethod_ |
|
3678 |
"'reader addClassMethod:' chunk (gravel Smalltalk)" |
|
3679 |
||
3680 |
^ self process_addMethodOrClassMethod:true |
|
3681 |
! |
|
3682 |
||
3683 |
process_addMethodOrClassMethod:isClassMethod |
|
3684 |
"'reader addMethod:' chunk (gravel Smalltalk)" |
|
3685 |
||
3686 |
|categoryName methodSource change parser| |
|
3687 |
||
3688 |
categoryName := (arguments at:1) evaluate. |
|
3689 |
||
3690 |
lineNumber := inputStream lineNumber. |
|
3691 |
"/ Care for non-positionable streams |
|
3692 |
position := nil. |
|
3693 |
inputStream isPositionable ifTrue:[ |
|
3839 | 3694 |
position := inputStream position + 1. |
3832 | 3695 |
]. |
3696 |
methodSource := inputStream nextChunk. |
|
3697 |
||
3698 |
parser := Parser |
|
3839 | 3699 |
parseMethodArgAndVarSpecification:methodSource |
3700 |
in:nil |
|
3701 |
ignoreErrors:true |
|
3702 |
ignoreWarnings:true |
|
3703 |
parseBody:false. |
|
3832 | 3704 |
|
3705 |
parser isNil ifTrue:[ |
|
3839 | 3706 |
"/ something wierd ... |
3707 |
methodSelector := '????'. |
|
3832 | 3708 |
] ifFalse:[ |
3839 | 3709 |
methodSelector := parser selector. |
3832 | 3710 |
]. |
3711 |
||
3712 |
isClassMethod ifTrue:[ |
|
3839 | 3713 |
className := className , ' class' |
3832 | 3714 |
]. |
3715 |
||
3716 |
change := MethodDefinitionChange new. |
|
3839 | 3717 |
change |
3718 |
className:className |
|
3719 |
selector:methodSelector |
|
3720 |
source:methodSource |
|
3721 |
category:categoryName |
|
3722 |
privacy:nil. |
|
3832 | 3723 |
|
3724 |
self addChange:change. |
|
3725 |
||
3726 |
"/ self halt. |
|
3727 |
^ true |
|
3728 |
! |
|
3729 |
||
3730 |
process_addMethod_ |
|
3731 |
"'reader addMethod:' chunk (gravel Smalltalk)" |
|
3732 |
||
3733 |
^ self process_addMethodOrClassMethod:false |
|
3734 |
! |
|
3735 |
||
3736 |
process_addSimpleClassTrait_ |
|
3737 |
"'reader defineaddSimpleTraitTrait:' chunk (gravel Smalltalk)" |
|
3738 |
||
3739 |
|change traitName| |
|
3740 |
||
3741 |
traitName := (arguments at:1) evaluate. |
|
3742 |
||
3743 |
change := TraitDefinitionChange new. |
|
3839 | 3744 |
change |
3745 |
className:className,' class'; |
|
3746 |
baseTrait:traitName; |
|
3747 |
source:chunk. |
|
3832 | 3748 |
"/ self halt. |
3749 |
self addChange:change. |
|
3750 |
^ true |
|
3751 |
! |
|
3752 |
||
3753 |
process_addSimpleTrait_ |
|
3754 |
"'reader defineaddSimpleTraitTrait:' chunk (gravel Smalltalk)" |
|
3755 |
||
3756 |
|change traitName gravelSuperclassName superclassName| |
|
3757 |
||
3758 |
traitName := (arguments at:1) evaluate. |
|
3759 |
gravelSuperclassName := (arguments at:2) evaluate. |
|
3833 | 3760 |
superclassName := SourceFileLoader::SourceFileReader classNameMappingFor:gravelSuperclassName. |
3832 | 3761 |
|
3762 |
change := TraitDefinitionChange new. |
|
3839 | 3763 |
change |
3764 |
className:className; |
|
3765 |
superClassName:superclassName; |
|
3766 |
baseTrait:traitName; |
|
3767 |
source:chunk. |
|
3832 | 3768 |
"/ self halt. |
3769 |
self addChange:change. |
|
3770 |
^ true |
|
3771 |
! |
|
3772 |
||
3773 |
process_defineClass_superclass_ |
|
3774 |
"'reader defineClass:superclass:' chunk (gravel Smalltalk)" |
|
3775 |
||
3776 |
|nameSpace change gravelSuperclassName superclassName| |
|
3777 |
||
3778 |
className := (arguments at:1) evaluate. |
|
3779 |
gravelSuperclassName := (arguments at:2) evaluate. |
|
3833 | 3780 |
superclassName := SourceFileLoader::SourceFileReader classNameMappingFor:gravelSuperclassName. |
3832 | 3781 |
|
3782 |
nameSpace := Class nameSpaceQuerySignal query. |
|
3783 |
(nameSpace == Smalltalk) ifTrue:[ nameSpace := nil ]. |
|
3784 |
||
3785 |
change := ClassDefinitionChange new. |
|
3839 | 3786 |
change |
3787 |
className:className; |
|
3788 |
superClassName:superclassName; |
|
3789 |
source:chunk. |
|
3832 | 3790 |
"/ self halt. |
3791 |
self addChange:change. |
|
3792 |
^ true |
|
3793 |
! |
|
3794 |
||
3795 |
process_defineTrait_superclass_ |
|
3796 |
"'reader defineTrait:' chunk (gravel Smalltalk)" |
|
3797 |
||
3798 |
|nameSpace change| |
|
3799 |
||
3800 |
className := (arguments at:1) evaluate. |
|
3801 |
||
3802 |
nameSpace := Class nameSpaceQuerySignal query. |
|
3803 |
(nameSpace == Smalltalk) ifTrue:[ nameSpace := nil ]. |
|
3804 |
||
3805 |
change := TraitDefinitionChange new. |
|
3839 | 3806 |
change |
3807 |
className:className; |
|
3808 |
source:chunk. |
|
3832 | 3809 |
"/ self halt. |
3810 |
self addChange:change. |
|
3811 |
^ true |
|
3812 |
! ! |
|
3813 |
||
3814 |
!ChangeSet::ChangeFileReader methodsFor:'reading-private-squeak'! |
|
3815 |
||
3816 |
process_commentStamp_prior_ |
|
3817 |
"'commentStamp:prior::' chunk (Squeak)" |
|
3818 |
||
3819 |
^ self handleSqueakCommentStamp. |
|
3820 |
! |
|
3821 |
||
3822 |
process_methodsFor_stamp_ |
|
3823 |
"'methodsFor:stamp:' chunk (Squeak)" |
|
3824 |
||
3825 |
^ self handleMethodChange. |
|
3826 |
! ! |
|
3827 |
||
3621
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3828 |
!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
|
3829 |
|
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3830 |
receiversClassNameRememberingNamespace |
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3831 |
^ (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
|
3832 |
|
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3833 |
"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
|
3834 |
! ! |
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3835 |
|
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:'reading-private'! |
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 |
processChangeUnsafe |
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3839 |
"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
|
3840 |
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
|
3841 |
The block is invoked with the change and a lineNumberOrNil as |
3839 | 3842 |
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
|
3843 |
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
|
3844 |
|
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3845 |
|dispatchSelector| |
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3846 |
|
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3847 |
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
|
3848 |
"/ Transcript showCR:dispatchSelector. |
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3849 |
(self respondsTo:dispatchSelector) ifTrue:[ |
3839 | 3850 |
^ 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
|
3851 |
]. |
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 |
"/ 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
|
3854 |
(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
|
3855 |
ifTrue:[ |
3839 | 3856 |
^ self handleClassDefinitionChange. |
3621
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3857 |
]. |
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3858 |
|
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3859 |
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
|
3860 |
^ false |
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3861 |
|
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3862 |
"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
|
3863 |
! |
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3864 |
|
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3865 |
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
|
3866 |
^ self handleMethodChange |
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3867 |
|
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3868 |
"/ 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
|
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: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
|
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_applicationVersion_ |
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3874 |
|
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 |
^ self handleMethodChange |
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 |
"/ 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
|
3879 |
|
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3880 |
"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
|
3881 |
! |
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 |
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
|
3884 |
|
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 |
^ self handleMethodChange |
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 |
"/ 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
|
3889 |
|
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3890 |
"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
|
3891 |
! |
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 |
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
|
3894 |
|
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3895 |
^ self handleMethodChange |
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3896 |
|
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3897 |
"/ 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
|
3898 |
|
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3899 |
"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
|
3900 |
! |
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3901 |
|
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3902 |
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
|
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: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
|
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_applicationVersion_ |
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: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
|
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_changesFileName_ |
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3919 |
|
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3920 |
^ self handleMethodChange |
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3921 |
|
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3922 |
"/ 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
|
3923 |
|
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3924 |
"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
|
3925 |
! |
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3926 |
|
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3927 |
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
|
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 / 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
|
3933 |
! ! |
3979244930e1
Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3619
diff
changeset
|
3934 |
|
3445 | 3935 |
!ChangeSet::ChangeFileWriter methodsFor:'source writing'! |
3936 |
||
3937 |
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
|
3938 |
| hasWideChars stream lastNameSpace | |
3445 | 3939 |
|
3940 |
hasWideChars := aChangeSet contains:[:each | each source isWideString ]. |
|
3839 | 3941 |
hasWideChars ifTrue:[ |
4464 | 3942 |
stream := EncodedStream stream:aStream encoder:(CharacterEncoder encoderForUTF8). |
3943 |
stream nextPutAll: '"{ Encoding: utf8 }"'; cr; cr. |
|
3944 |
stream nextPutAll: '!!'; cr; cr. |
|
3839 | 3945 |
] ifFalse:[ |
4464 | 3946 |
stream := aStream |
3445 | 3947 |
]. |
3948 |
||
3518
1b770a65ef66
Fix in namespace handling when filing out chunked changeset.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3483
diff
changeset
|
3949 |
lastNameSpace := nil. |
1b770a65ef66
Fix in namespace handling when filing out chunked changeset.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3483
diff
changeset
|
3950 |
|
3445 | 3951 |
aChangeSet do:[:eachChange | |
4464 | 3952 |
eachChange isClassChange ifTrue:[ |
3953 |
| changeNameSpace | |
|
3954 |
||
3955 |
changeNameSpace := eachChange nameSpaceName. |
|
3956 |
changeNameSpace ~= lastNameSpace ifTrue:[ |
|
3957 |
aStream nextPutAll: ('"{ NameSpace: %1 }"' bindWith: changeNameSpace). |
|
3958 |
aStream cr; cr. |
|
3959 |
stream nextPutLine:'!!'. |
|
3960 |
lastNameSpace := changeNameSpace. |
|
3961 |
]. |
|
3962 |
eachChange isMethodCodeChange ifTrue:[ |
|
3963 |
stream nextPutAll:'!!'; nextPutAll:(eachChange className); nextPutAll:' methodsFor: '. |
|
3964 |
stream nextPutAll:(eachChange methodCategory storeString). |
|
3965 |
stream nextPutLine:'!!'. |
|
3966 |
stream cr. |
|
3967 |
stream nextPutAllAsChunk:(eachChange source). |
|
3968 |
stream nextPutLine:'!! !!'. |
|
3969 |
] ifFalse:[ |
|
3970 |
stream nextPutAll:(eachChange source). |
|
3971 |
stream nextPutLine:'!!'. |
|
3972 |
]. |
|
3973 |
]. |
|
3974 |
aStream cr. |
|
3445 | 3975 |
]. |
3976 |
||
3977 |
"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
|
3978 |
"Modified: / 06-03-2014 / 12:48:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3445 | 3979 |
! ! |
3980 |
||
2881 | 3981 |
!ChangeSet::ClassSourceWriter methodsFor:'private'! |
3982 |
||
3983 |
analyze |
|
3904 | 3984 |
"Analyzes changeset and build some index" |
2881 | 3985 |
|
3986 |
classInfos := Dictionary new. |
|
3987 |
metaInfos := Dictionary new. |
|
3988 |
topClassName := nil. |
|
3989 |
"Pass 1 - collect classes" |
|
3990 |
changeSetBeingSaved do:[:change| |
|
3856 | 3991 |
| pkg | |
3992 |
pkg := change package. |
|
3993 |
packageName isNil ifTrue:[ |
|
3994 |
packageName := pkg. |
|
3995 |
] ifFalse:[ |
|
3996 |
"/Just a defensive check... |
|
3904 | 3997 |
self assert: (pkg isNil or:[pkg = packageName]) message: 'STC does not support multiple packages in source files'. |
3856 | 3998 |
]. |
3999 |
||
4000 |
change isClassDefinitionChange ifTrue:[ |
|
4001 |
| nm ns | |
|
4002 |
||
4003 |
nm := change className. |
|
4004 |
(nm endsWith:' class') ifFalse:[ |
|
4005 |
(classInfos includesKey: nm) ifTrue:[ |
|
4006 |
self error:'Multiple definitions of class ', nm. |
|
4007 |
^self. |
|
4008 |
]. |
|
4009 |
classInfos at: nm put: (ClassInfo new name: nm). |
|
4010 |
metaInfos at: nm put: (ClassInfo new name: nm , ' class'). |
|
4011 |
change isPrivateClassDefinitionChange ifFalse:[ |
|
4012 |
topClassName notNil ifTrue:[ |
|
4013 |
self error: ('Multiple top class definitions (%1 vs %2)' bindWith: topClassName with: nm). |
|
4014 |
^self. |
|
4015 |
]. |
|
4016 |
topClassName := nm. |
|
4017 |
namespaceName := change nameSpaceName. |
|
4018 |
||
4019 |
] |
|
4020 |
] |
|
4021 |
] |
|
2881 | 4022 |
]. |
4023 |
||
3246 | 4024 |
"/ Could be an extension container... |
4025 |
topClassName isNil ifTrue:[ |
|
3856 | 4026 |
^self |
3246 | 4027 |
]. |
4028 |
||
2881 | 4029 |
"Pass 2: fill in infos" |
4030 |
changeSetBeingSaved do:[:change| |
|
3856 | 4031 |
change isClassChange ifTrue:[ |
4032 |
| nm info | |
|
4033 |
||
4034 |
nm := change className. |
|
4035 |
(nm endsWith: ' class') ifTrue:[ |
|
4036 |
info := metaInfos at: (nm copyButLast:(' class' size)). |
|
4037 |
] ifFalse:[ |
|
4038 |
info := classInfos at: nm. |
|
4039 |
"Fill superclass info..." |
|
4040 |
change isClassDefinitionChange ifTrue:[ |
|
4041 |
| superNm | |
|
4042 |
superNm := change superClassName. |
|
4445 | 4043 |
(superNm notNil and:[superNm ~= 'nil']) ifTrue:[ |
3856 | 4044 |
(classInfos includesKey: superNm) ifTrue:[ |
4045 |
info superclass: (classInfos at: superNm). |
|
4046 |
(metaInfos at: nm) superclass: (classInfos at: superNm). |
|
4047 |
]. |
|
4048 |
]. |
|
4049 |
]. |
|
4050 |
]. |
|
4051 |
info addChange: change. |
|
4052 |
] |
|
2881 | 4053 |
]. |
4054 |
||
4055 |
classInfos do:[:info|info namespace: namespaceName]. |
|
4056 |
metaInfos do:[:info|info namespace: namespaceName]. |
|
4057 |
||
4058 |
||
4059 |
" |
|
3856 | 4060 |
ChangeSet::ClassSourceWriter new |
4061 |
changeSetBeingSaved: (ChangeSet forExistingClass: ChangeSet); |
|
4062 |
analyze; |
|
4063 |
yourself |
|
2881 | 4064 |
|
4065 |
" |
|
4066 |
||
4067 |
"Created: / 15-03-2012 / 17:51:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3445 | 4068 |
"Modified: / 11-06-2013 / 17:59:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4445 | 4069 |
"Modified: / 22-06-2019 / 16:06:06 / Claus Gittinger" |
2881 | 4070 |
! |
4071 |
||
4072 |
changeSetBeingSaved:something |
|
4073 |
changeSetBeingSaved := something. |
|
4074 |
! |
|
4075 |
||
4076 |
privateClassesOf: classInfo |
|
4077 |
||
4078 |
| classInfoNameSz | |
|
4079 |
||
4080 |
classInfoNameSz := classInfo name size. |
|
4081 |
^classInfos values select:[:info| |
|
3839 | 4082 |
info name size > classInfoNameSz and:[ |
4083 |
(info name startsWith: classInfo name) |
|
4084 |
and:[(info name at:classInfoNameSz + 1) == $: |
|
4085 |
and:[(info name at:classInfoNameSz + 2) == $: |
|
4086 |
and:[(info name indexOf: $: startingAt: classInfo name size + 3) == 0]]]] |
|
2881 | 4087 |
] |
4088 |
||
4089 |
"Created: / 15-03-2012 / 19:31:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4090 |
! |
|
4091 |
||
4092 |
privateClassesSortedOf: classInfo |
|
4093 |
||
4094 |
|classes| |
|
4095 |
||
4096 |
classes := self privateClassesOf: classInfo. |
|
4097 |
(classes size > 0) ifTrue:[ |
|
3839 | 4098 |
classes := classes asOrderedCollection. |
4099 |
classes sort:[:a :b | a name < b name]. |
|
4100 |
||
4101 |
classes topologicalSort:[:a :b | |
|
4102 |
"/ a must come before b iff: |
|
4103 |
"/ b is a subclass of a |
|
4104 |
"/ b has a private class which is a subclass of a |
|
4105 |
||
4106 |
|mustComeBefore privateClassesOfB| |
|
4107 |
mustComeBefore := (b isSubclassOf:a) or:[b isPrivateClassOf: a]. |
|
4108 |
mustComeBefore |
|
4109 |
]. |
|
2881 | 4110 |
]. |
4111 |
^ classes. |
|
4112 |
||
4113 |
" |
|
4114 |
Object privateClassesSorted |
|
4115 |
NewSystemBrowser privateClassesSorted |
|
4116 |
NewSystemBrowser privateClasses |
|
4117 |
" |
|
4118 |
||
4119 |
"Created: / 15-03-2012 / 19:45:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4120 |
! ! |
|
4121 |
||
4122 |
!ChangeSet::ClassSourceWriter methodsFor:'source writing'! |
|
4123 |
||
3839 | 4124 |
fileOut:aChangeSet on:outStreamArg |
3445 | 4125 |
^ self |
3839 | 4126 |
fileOut: aChangeSet |
4127 |
on:outStreamArg |
|
4128 |
withTimeStamp:false |
|
4129 |
withInitialize:true |
|
4130 |
withDefinition:true |
|
4131 |
methodFilter:nil encoder:nil. |
|
3445 | 4132 |
|
4133 |
"Created: / 04-02-2014 / 18:36:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4134 |
! |
|
4135 |
||
2881 | 4136 |
fileOut:aChangeSet on:outStreamArg withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition methodFilter:methodFilter encoder:encoderOrNil |
4137 |
||
3646 | 4138 |
|collectionOfCategories versionMethods extensionVersionMethods comment |
4139 |
nonMeta meta classesImplementingInitialize outStream |
|
4140 |
allMetaClassSelectors versionSelectors extensionVersionSelectors |
|
4141 |
allVersionMethods| |
|
2881 | 4142 |
|
3904 | 4143 |
self todo:'code duplication with SmalltalkChunkFileSourceFileWriter - please refactor'. |
4144 |
||
2881 | 4145 |
changeSetBeingSaved := aChangeSet. |
4146 |
self analyze. |
|
4147 |
||
4148 |
encoderOrNil isNil ifTrue:[ |
|
3904 | 4149 |
outStream := outStreamArg. |
2881 | 4150 |
] ifFalse:[ |
3904 | 4151 |
outStream := EncodedStream stream:outStreamArg encoder:encoderOrNil. |
4152 |
outStream nextPutAll:'"{ Encoding: ' , encoderOrNil nameOfEncoding , ' }"'; cr; cr. |
|
2881 | 4153 |
]. |
4154 |
||
3246 | 4155 |
"/ Just a bunch of extensions? |
4156 |
topClassName isNil ifTrue:[ |
|
3904 | 4157 |
self fileOutMethodsOn: outStream. |
4158 |
^self. |
|
3246 | 4159 |
]. |
4160 |
||
4161 |
nonMeta := classInfos at: topClassName. |
|
4162 |
meta := metaInfos at: topClassName. |
|
4163 |
||
4164 |
methodsAlreadySaved := Set new. |
|
4165 |
||
4166 |
||
4167 |
||
2881 | 4168 |
" |
4169 |
if there is a copyright method, add a copyright comment |
|
4170 |
at the beginning, taking the string from the copyright method. |
|
4171 |
We cannot do this unconditionally - that would lead to my copyrights |
|
4172 |
being put on your code ;-). |
|
4173 |
On the other hand: I want every file created by myself to have the |
|
4174 |
copyright string at the beginning be preserved .... even if the |
|
4175 |
code was edited in the browser and filedOut. |
|
4176 |
" |
|
4177 |
self generateHeaderWithCopyrightOn:outStream. |
|
4178 |
||
4179 |
stampIt ifTrue:[ |
|
3904 | 4180 |
"/ |
4181 |
"/ first, a timestamp |
|
4182 |
"/ |
|
4183 |
outStream nextPutAll:(Smalltalk timeStamp). |
|
4184 |
outStream nextPutChunkSeparator. |
|
4185 |
outStream cr; cr. |
|
2881 | 4186 |
]. |
4187 |
||
4188 |
withDefinition ifTrue:[ |
|
3904 | 4189 |
"/ |
4190 |
"/ then the definition(s) |
|
4191 |
"/ |
|
4192 |
self fileOutAllDefinitionsOf:nonMeta on:outStream. |
|
4193 |
"/ |
|
4194 |
"/ a comment - if any |
|
4195 |
"/ |
|
4196 |
||
4197 |
(comment := nonMeta comment) notNil ifTrue:[ |
|
4198 |
nonMeta printClassNameOn: outStream. |
|
4199 |
outStream nextPutAll:' comment:'. |
|
4200 |
comment comment storeOn: outStream. |
|
4201 |
outStream cr. |
|
4202 |
outStream nextPut:$!!; cr; cr. |
|
4203 |
]. |
|
4204 |
"/ |
|
4205 |
"/ ST/X primitive definitions - if any |
|
4206 |
"/ |
|
4207 |
self fileOutPrimitiveSpecsOf: nonMeta on:outStream. |
|
2881 | 4208 |
]. |
4209 |
||
4210 |
"/ |
|
4211 |
"/ methods from all categories in metaclass (i.e. class methods) |
|
4212 |
"/ EXCEPT: the version method is placed at the very end, to |
|
4213 |
"/ avoid sourcePosition-shifts when checked out later. |
|
4214 |
"/ (RCS expands this string, so its size is not constant) |
|
4215 |
"/ |
|
4248 | 4216 |
collectionOfCategories := meta methodCategories asSortedCollection. |
3646 | 4217 |
|
4218 |
allMetaClassSelectors := meta methodDictionary keys. |
|
4219 |
versionSelectors := allMetaClassSelectors select:[:selector | AbstractSourceCodeManager isVersionMethodSelector:selector ]. |
|
4220 |
versionMethods := versionSelectors collect:[:eachSelector | meta methodDictionary at:eachSelector]. |
|
3839 | 4221 |
extensionVersionSelectors := allMetaClassSelectors select:[:selector | AbstractSourceCodeManager isExtensionsVersionMethodSelector:selector ]. |
3646 | 4222 |
extensionVersionMethods := extensionVersionSelectors collect:[:eachSelector | meta methodDictionary at:eachSelector]. |
4223 |
allVersionMethods := Set new addAll:versionMethods; addAll:extensionVersionMethods; yourself. |
|
2881 | 4224 |
|
4225 |
collectionOfCategories notNil ifTrue:[ |
|
3904 | 4226 |
"/ |
4227 |
"/ documentation first (if any), but not the version method |
|
4228 |
"/ |
|
4229 |
(collectionOfCategories includes:'documentation') ifTrue:[ |
|
2881 | 4230 |
|
4231 |
"/ versionMethods do:[:versionMethod | |
|
4232 |
"/ |source| |
|
4233 |
"/ |
|
4234 |
"/ source := versionMethod source. |
|
4235 |
"/ (source isEmptyOrNil or:[(source startsWith:nonMeta nameOfOldVersionMethod) not]) ifTrue:[ |
|
4236 |
"/ "something bad happend to the classes code" |
|
4237 |
"/ |
|
3839 | 4238 |
"/ Class fileOutErrorSignal |
2881 | 4239 |
"/ raiseRequestWith:aClass |
4240 |
"/ errorString:' - bad source for version method (uncompiled class file?): ', (versionMethod displayString) |
|
4241 |
"/ ]. |
|
4242 |
"/ ]. |
|
4243 |
||
3904 | 4244 |
self fileOutCategory:'documentation' of:meta except:allVersionMethods only:nil methodFilter:methodFilter on:outStream. |
4245 |
]. |
|
4246 |
||
4247 |
"/ |
|
4248 |
"/ initialization next (if any) |
|
4249 |
"/ |
|
4250 |
(collectionOfCategories includes:'initialization') ifTrue:[ |
|
4251 |
self fileOutCategory:'initialization' of:meta methodFilter:methodFilter on:outStream. |
|
4252 |
]. |
|
4253 |
||
4254 |
"/ |
|
4255 |
"/ instance creation next (if any) |
|
4256 |
"/ |
|
4257 |
(collectionOfCategories includes:'instance creation') ifTrue:[ |
|
4258 |
self fileOutCategory:'instance creation' of:meta methodFilter:methodFilter on:outStream. |
|
4259 |
]. |
|
4260 |
collectionOfCategories do:[:aCategory | |
|
4261 |
((aCategory ~= 'documentation') |
|
4262 |
and:[(aCategory ~= 'initialization') |
|
4263 |
and:[aCategory ~= 'instance creation']]) ifTrue:[ |
|
4264 |
self fileOutCategory:aCategory of:meta methodFilter:methodFilter on:outStream. |
|
4265 |
] |
|
4266 |
] |
|
2881 | 4267 |
]. |
4268 |
||
4269 |
"/ if there are any primitive definitions (vw-like ffi-primitives), |
|
4270 |
"/ file them out first in the order: defines, types. |
|
4271 |
"/ Otherwise, we might have trouble when filing in later, because the types are needed |
|
4272 |
"/ for the primitive calls. |
|
3904 | 4273 |
|
4274 |
"/ TODO: that does not work - MethodDefinition does not implement #isVisualWorksTypedef |
|
4275 |
"/ nonMeta methodDictionary keysAndValuesDo:[:sel :m | |
|
4276 |
"/ m isVisualWorksTypedef ifTrue:[ |
|
4277 |
"/ self fileOutCategory:m category of:nonMeta except:nil only:(Array with:m) methodFilter:methodFilter on:outStream. |
|
4278 |
"/ ]. |
|
4279 |
"/ ]. |
|
2881 | 4280 |
|
4281 |
"/ |
|
4282 |
"/ methods from all categories |
|
4283 |
"/ |
|
4284 |
collectionOfCategories := nonMeta categories asSortedCollection. |
|
4285 |
collectionOfCategories notNil ifTrue:[ |
|
3904 | 4286 |
collectionOfCategories do:[:aCategory | |
4287 |
self fileOutCategory:aCategory of:nonMeta methodFilter:methodFilter on:outStream. |
|
4288 |
] |
|
2881 | 4289 |
]. |
4290 |
||
4291 |
"/ |
|
4292 |
"/ any private classes' methods |
|
4293 |
"/ |
|
4294 |
(self privateClassesSortedOf: nonMeta) do:[:aClass | |
|
3904 | 4295 |
self fileOutAllMethodsOf:aClass on:outStream methodFilter:methodFilter |
2881 | 4296 |
]. |
4297 |
||
4298 |
||
4299 |
"/ |
|
3646 | 4300 |
"/ finally, the previously skipped version method(s) - but NOT the extension version methods |
2881 | 4301 |
"/ |
4302 |
versionMethods notEmpty ifTrue: [ |
|
3904 | 4303 |
self fileOutCategory:'documentation' of:meta except:nil only:versionMethods methodFilter:methodFilter on:outStream. |
2881 | 4304 |
]. |
4305 |
||
4306 |
initIt ifTrue:[ |
|
3904 | 4307 |
"/ |
4308 |
"/ optionally an initialize message |
|
4309 |
"/ |
|
4310 |
classesImplementingInitialize := OrderedCollection new. |
|
4311 |
||
4312 |
classInfos values with: metaInfos values do:[:class :meta| |
|
4313 |
(meta includesSelector: #initialize) ifTrue:[ |
|
4314 |
classesImplementingInitialize add: class. |
|
4315 |
] |
|
4316 |
]. |
|
4317 |
||
4318 |
classesImplementingInitialize size ~~ 0 ifTrue:[ |
|
4319 |
classesImplementingInitialize topologicalSort:[:a :b | b isSubclassOf:a]. |
|
4320 |
outStream cr. |
|
4321 |
classesImplementingInitialize do:[:eachClass | |
|
4322 |
eachClass printClassNameOn:outStream. outStream nextPutAll:' initialize'. |
|
4323 |
outStream nextPutChunkSeparator. |
|
4324 |
outStream cr. |
|
4325 |
]. |
|
4326 |
]. |
|
2881 | 4327 |
] |
4328 |
||
4329 |
"Created: / 15-11-1995 / 12:53:06 / cg" |
|
4330 |
"Modified: / 01-04-1997 / 16:01:05 / stefan" |
|
4331 |
"Created: / 15-03-2012 / 17:39:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3246 | 4332 |
"Modified: / 01-05-2013 / 09:17:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4248 | 4333 |
"Modified: / 05-07-2017 / 10:50:30 / cg" |
2881 | 4334 |
! |
4335 |
||
4336 |
fileOutAllDefinitionsOf:nonMetaInfo on:aStream |
|
4337 |
"append expressions on aStream, which defines myself and all of my private classes." |
|
4338 |
||
3697 | 4339 |
| metaInfo definition metaDefinition | |
4340 |
||
4341 |
definition := nonMetaInfo definition. |
|
4342 |
definition isPrivateClassDefinitionChange ifFalse:[ |
|
3904 | 4343 |
definition package notNil ifTrue:[ |
4344 |
aStream nextPutAll: ('"{ Package: ''%1'' }"' bindWith: definition package). |
|
4345 |
aStream cr; cr. |
|
4346 |
]. |
|
4347 |
aStream nextPutAll: ('"{ NameSpace: %1 }"' bindWith: namespaceName ? 'Smalltalk'). |
|
4348 |
aStream cr; cr. |
|
2881 | 4349 |
]. |
4350 |
||
3697 | 4351 |
aStream nextChunkPut: (definition definitionStringInNamespace: namespaceName). |
2881 | 4352 |
aStream cr; cr. |
4353 |
||
4354 |
"/ |
|
4355 |
"/ optional classInstanceVariables |
|
4356 |
"/ |
|
4357 |
metaInfo := metaInfos at: nonMetaInfo name. |
|
3697 | 4358 |
metaDefinition := metaInfo definition. |
4359 |
metaDefinition notNil ifTrue:[ |
|
3904 | 4360 |
| anySuperClassInstVar myClass | |
4361 |
aStream |
|
4362 |
nextPutAll: metaDefinition className; |
|
4363 |
nextPutAll:' instanceVariableNames:'; |
|
4364 |
nextPutAll: (metaDefinition classInstVarNames asStringWith:' ') storeString. |
|
4365 |
"mhmh - good idea; saw this in SmallDraw sourcecode ..." |
|
4366 |
||
4367 |
anySuperClassInstVar := false. |
|
4368 |
myClass := metaDefinition changeClass. |
|
4369 |
myClass notNil ifTrue:[myClass := myClass theNonMetaclass]. |
|
4370 |
myClass notNil ifTrue:[ |
|
4371 |
myClass allSuperclassesDo:[:aSuperClass | |
|
4372 |
aSuperClass class instVarNames do:[:ignored | anySuperClassInstVar := true]. |
|
4373 |
]. |
|
4374 |
||
4375 |
aStream cr; cr; nextPut:(Character doubleQuote); cr; space. |
|
4376 |
anySuperClassInstVar ifFalse:[ |
|
4377 |
aStream |
|
4378 |
nextPutLine:'No other class instance variables are inherited by this class.'. |
|
4379 |
] ifTrue:[ |
|
4380 |
aStream |
|
4381 |
nextPutLine:'The following class instance variables are inherited by this class:'. |
|
4382 |
aStream cr. |
|
4383 |
myClass allSuperclassesDo:[:aSuperClass | |
|
4384 |
aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '. |
|
4385 |
aStream nextPutLine:(aSuperClass class instanceVariableString). |
|
4386 |
]. |
|
4387 |
||
4388 |
]. |
|
4389 |
]. |
|
4390 |
aStream nextPut:(Character doubleQuote); cr. |
|
4391 |
aStream nextPut:$!!; cr; cr |
|
2881 | 4392 |
]. |
4393 |
||
4394 |
"/ here, the full nameSpace prefixes are output, |
|
3839 | 4395 |
"/ to avoid confusing stc |
2881 | 4396 |
"/ (which otherwise could not find the correct superclass) |
4397 |
"/ |
|
4398 |
Class fileOutNameSpaceQuerySignal answer:false do:[ |
|
3904 | 4399 |
Class forceNoNameSpaceQuerySignal answer:true do:[ |
4400 |
(self privateClassesSortedOf: nonMetaInfo) do:[:i | |
|
4401 |
self fileOutAllDefinitionsOf:i on:aStream |
|
4402 |
] |
|
4403 |
] |
|
2881 | 4404 |
]. |
4405 |
||
4406 |
"Created: / 15-10-1996 / 11:15:19 / cg" |
|
4407 |
"Modified: / 22-03-1997 / 16:11:56 / cg" |
|
4408 |
"Created: / 15-03-2012 / 19:18:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3445 | 4409 |
"Modified: / 11-06-2013 / 22:23:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2881 | 4410 |
! |
4411 |
||
4412 |
fileOutAllMethodsOf:aClass on:aStream methodFilter:methodFilter |
|
4413 |
| collectionOfCategories meta | |
|
4414 |
||
4415 |
meta := metaInfos at: aClass name. |
|
4416 |
||
4248 | 4417 |
collectionOfCategories := meta methodCategories asSortedCollection. |
2881 | 4418 |
collectionOfCategories notNil ifTrue:[ |
4248 | 4419 |
collectionOfCategories do:[:aCategory | |
4420 |
self fileOutCategory:aCategory of:meta methodFilter:methodFilter on:aStream. |
|
3246 | 4421 |
"/ aStream cr. |
4248 | 4422 |
] |
2881 | 4423 |
]. |
4248 | 4424 |
collectionOfCategories := aClass methodCategories asSortedCollection. |
2881 | 4425 |
collectionOfCategories notNil ifTrue:[ |
4248 | 4426 |
collectionOfCategories do:[:aCategory | |
4427 |
self fileOutCategory:aCategory of:aClass methodFilter:methodFilter on:aStream. |
|
3246 | 4428 |
"/ aStream cr. |
4248 | 4429 |
] |
2881 | 4430 |
]. |
4431 |
||
4432 |
(self privateClassesSortedOf: aClass) do:[:privateClass | |
|
4248 | 4433 |
self fileOutAllMethodsOf:privateClass on:aStream methodFilter:methodFilter |
2881 | 4434 |
]. |
4435 |
||
4436 |
"Created: / 15-10-1996 / 11:13:00 / cg" |
|
4437 |
"Created: / 19-03-2012 / 18:21:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3246 | 4438 |
"Modified: / 01-05-2013 / 09:06:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4248 | 4439 |
"Modified: / 05-07-2017 / 10:50:34 / cg" |
2881 | 4440 |
! |
4441 |
||
4442 |
fileOutMethod:change on:aStream |
|
4443 |
"file a single method onto aStream." |
|
4444 |
||
4445 |
| changeToFileOut | |
|
4446 |
||
4447 |
change isMethodCategoryChange ifTrue:[ |
|
3839 | 4448 |
self assert: change origin notNil. |
4449 |
changeToFileOut := change origin copy. |
|
4450 |
changeToFileOut category: change category. |
|
2881 | 4451 |
] ifFalse:[ |
3839 | 4452 |
changeToFileOut := change. |
2881 | 4453 |
]. |
4454 |
changeToFileOut source notEmptyOrNil ifTrue:[ |
|
3839 | 4455 |
super fileOutMethod:changeToFileOut on:aStream |
2881 | 4456 |
] ifFalse:[ |
4457 |
"/ self error: 'Should not happen' mayProceed: true. |
|
4458 |
] |
|
4459 |
||
4460 |
"Created: / 20-03-2012 / 22:33:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4461 |
! |
|
4462 |
||
3246 | 4463 |
fileOutMethodsOn:stream |
4464 |
"Writes a set of methods in changesetBeingSaved in same format as |
|
4465 |
extensions.st created by source code management. Code stolen from |
|
4466 |
||
4467 |
AbstractSourceCodeManager class>>fileOutSourceCodeExtensions:package:on:version: |
|
4468 |
" |
|
4469 |
||
4470 |
| methodsSortedByName | |
|
4471 |
||
4472 |
||
4409 | 4473 |
stream nextPutAll:'"{ Package: '''. |
4474 |
stream nextPutAll:packageName asString. |
|
4475 |
stream nextPutAll:''' }"'; nextPutChunkSeparator; cr; cr. |
|
3246 | 4476 |
|
4477 |
"/ s nextPutAll:(Smalltalk timeStamp). |
|
3839 | 4478 |
"/ s nextPutChunkSeparator. |
3246 | 4479 |
"/ s cr; cr. |
4480 |
||
4409 | 4481 |
"/ sort them by name (to avoid conflict due to CVS merge) |
4482 |
methodsSortedByName := changeSetBeingSaved. |
|
4483 |
methodsSortedByName sort:[:a :b | |
|
4484 |
|clsA clsB| |
|
4485 |
||
4486 |
clsA := a className. |
|
4487 |
clsB := b className. |
|
4488 |
clsA < clsB ifTrue:[ |
|
4489 |
true |
|
4490 |
] ifFalse:[ |
|
4491 |
clsA > clsB ifTrue:[ |
|
4492 |
false |
|
4493 |
] ifFalse:[ |
|
4494 |
a selector < b selector |
|
4495 |
] |
|
4496 |
] |
|
4497 |
]. |
|
4498 |
methodsSortedByName do:[:aMethod | |
|
4499 |
|cat source privacy| |
|
4500 |
||
4501 |
self assert: aMethod package = packageName. |
|
4502 |
"/self assert: aMethod programmingLanguage isSmalltalk. |
|
4503 |
||
4504 |
||
4505 |
stream nextPutChunkSeparator. |
|
4506 |
aMethod className printOn: stream. |
|
4507 |
||
4508 |
(privacy := aMethod privacy) ~~ #public ifTrue:[ |
|
4509 |
stream space; nextPutAll:privacy; nextPutAll:'MethodsFor:'. |
|
4510 |
] ifFalse:[ |
|
4511 |
stream nextPutAll:' methodsFor:'. |
|
4512 |
]. |
|
4513 |
||
4514 |
cat := aMethod category ? '* no category *'. |
|
4515 |
stream nextPutAll:cat asString storeString. |
|
4516 |
stream nextPutChunkSeparator; cr; cr. |
|
4517 |
||
4518 |
source := aMethod source. |
|
4519 |
source isNil ifTrue:[ |
|
4520 |
"FileOutErrorSignal"Error |
|
4521 |
raiseRequestWith:self |
|
4522 |
errorString:(' - no source for method: ' , |
|
4523 |
self className , '>>' , |
|
4524 |
aMethod selector) |
|
4525 |
] ifFalse:[ |
|
4526 |
stream nextChunkPut:source. |
|
4527 |
]. |
|
4528 |
stream space. |
|
4529 |
stream nextPutChunkSeparator. |
|
4530 |
stream cr. |
|
4531 |
]. |
|
3246 | 4532 |
|
4533 |
"Created: / 30-01-2013 / 09:35:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4409 | 4534 |
"Modified: / 03-03-2019 / 22:25:24 / Claus Gittinger" |
3246 | 4535 |
! |
4536 |
||
2881 | 4537 |
fileOutPrimitiveSpecsOf: nonMeta on:aStream |
4538 |
"append primitive defs (if any) to aStream." |
|
4539 |
||
4540 |
|s| |
|
4541 |
||
4542 |
" |
|
4543 |
primitive definitions - if any |
|
4544 |
" |
|
4545 |
(s := nonMeta primitiveDefinitionsString) notNil ifTrue:[ |
|
3839 | 4546 |
aStream nextPutChunkSeparator. |
4547 |
nonMeta printClassNameOn:aStream. |
|
4548 |
aStream nextPutAll:' primitiveDefinitions'; |
|
4549 |
nextPutChunkSeparator; |
|
4550 |
cr. |
|
4551 |
aStream nextPutAll:s. |
|
4552 |
aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr |
|
2881 | 4553 |
]. |
4554 |
(s := nonMeta primitiveVariablesString) notNil ifTrue:[ |
|
3839 | 4555 |
aStream nextPutChunkSeparator. |
4556 |
nonMeta printClassNameOn:aStream. |
|
4557 |
aStream nextPutAll:' primitiveVariables'; |
|
4558 |
nextPutChunkSeparator; |
|
4559 |
cr. |
|
4560 |
aStream nextPutAll:s. |
|
4561 |
aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr |
|
2881 | 4562 |
]. |
4563 |
||
4564 |
"Created: / 15-03-2012 / 19:48:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4565 |
! |
|
4566 |
||
4567 |
generateHeaderWithCopyrightOn:outStream |
|
4568 |
|copyrightChange copyrightText| |
|
4569 |
||
4570 |
copyrightChange := |
|
4035 | 4571 |
(metaInfos at: topClassName) methodAt: #copyright. |
2881 | 4572 |
|
4573 |
||
4574 |
copyrightChange notNil ifTrue:[ |
|
4035 | 4575 |
" |
4576 |
get the copyright method's comment-text, strip off empty and blank lines |
|
4577 |
and insert at beginning. |
|
4578 |
" |
|
4579 |
copyrightText := Parser methodCommentFromSource: copyrightChange source. |
|
4580 |
copyrightText notEmptyOrNil ifTrue:[ |
|
4581 |
copyrightText := copyrightText asCollectionOfLines asStringCollection. |
|
4582 |
copyrightText := copyrightText withoutLeadingAndTrailingBlankLines. |
|
4583 |
copyrightText notEmpty ifTrue:[ |
|
4584 |
copyrightText addFirst:'"'. |
|
4585 |
copyrightText addLast:'"'. |
|
4586 |
copyrightText := copyrightText asString. |
|
4587 |
outStream nextPutAllAsChunk:copyrightText. |
|
4588 |
]. |
|
4589 |
]. |
|
2881 | 4590 |
]. |
4591 |
||
4592 |
"Created: / 15-03-2012 / 19:01:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4593 |
! ! |
|
4594 |
||
3246 | 4595 |
!ChangeSet::ClassSourceWriter::ClassInfo class methodsFor:'documentation'! |
4596 |
||
4597 |
copyright |
|
4598 |
" |
|
4599 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
3839 | 4600 |
All Rights Reserved |
3246 | 4601 |
|
4602 |
This software is furnished under a license and may be used |
|
4603 |
only in accordance with the terms of that license and with the |
|
4604 |
inclusion of the above copyright notice. This software may not |
|
4605 |
be provided or otherwise made available to, or used by, any |
|
4606 |
other person. No title to or ownership of the software is |
|
4607 |
hereby transferred. |
|
4608 |
" |
|
4609 |
! |
|
4610 |
||
4611 |
version_SVN |
|
3904 | 4612 |
^ '$Id$' |
3246 | 4613 |
! ! |
4614 |
||
2881 | 4615 |
!ChangeSet::ClassSourceWriter::ClassInfo class methodsFor:'instance creation'! |
4616 |
||
4617 |
new |
|
4618 |
"return an initialized instance" |
|
4619 |
||
4620 |
^ self basicNew initialize. |
|
4621 |
! ! |
|
4622 |
||
4623 |
!ChangeSet::ClassSourceWriter::ClassInfo methodsFor:'accessing'! |
|
4624 |
||
4625 |
categories |
|
3246 | 4626 |
|
4627 |
^ (methods collect:[:e|e category]) asSet |
|
2881 | 4628 |
|
4629 |
"Created: / 19-03-2012 / 18:03:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4630 |
! |
|
4631 |
||
3246 | 4632 |
comment |
4633 |
^ comment |
|
4634 |
! |
|
4635 |
||
4636 |
comment:something |
|
4637 |
comment := something. |
|
4638 |
! |
|
4639 |
||
2881 | 4640 |
definition |
4641 |
^ definition |
|
4642 |
! |
|
4643 |
||
4644 |
definition:something |
|
4645 |
definition := something. |
|
4646 |
! |
|
4647 |
||
3839 | 4648 |
methodAt: selector |
2881 | 4649 |
^methods detect:[:each|each selector == selector] ifNone:[nil]. |
4650 |
||
4651 |
"Created: / 15-03-2012 / 19:11:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4652 |
! |
|
4653 |
||
4654 |
methodDictionary |
|
3904 | 4655 |
methodDictionary isEmptyOrNil ifTrue:[ |
4656 |
methodDictionary := Dictionary new. |
|
4657 |
methods do:[:m| methodDictionary at: m selector put: m]. |
|
2881 | 4658 |
]. |
3904 | 4659 |
|
4660 |
^ methodDictionary. |
|
2881 | 4661 |
! |
4662 |
||
4663 |
methods |
|
4664 |
^ methods |
|
4665 |
! |
|
4666 |
||
4667 |
methods:something |
|
4668 |
methods := something. |
|
4669 |
methodDictionary := Dictionary new. |
|
4670 |
methods do:[:m|methodDictionary at: m selector put: m]. |
|
4671 |
||
4672 |
"Modified: / 19-03-2012 / 18:12:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4673 |
! |
|
4674 |
||
4675 |
name |
|
4676 |
^ name |
|
4677 |
! |
|
4678 |
||
4679 |
name:something |
|
4680 |
name := something. |
|
4681 |
! |
|
4682 |
||
4683 |
namespace |
|
4684 |
^ namespace |
|
4685 |
! |
|
4686 |
||
4687 |
namespace:aString |
|
4688 |
namespace := aString. |
|
4689 |
! |
|
4690 |
||
4691 |
primitiveDefinitions |
|
4692 |
^ primitiveDefinitions |
|
4693 |
! |
|
4694 |
||
4695 |
primitiveDefinitionsString |
|
3839 | 4696 |
^ primitiveDefinitions isNil |
4697 |
ifTrue:[nil] |
|
4698 |
ifFalse:[primitiveDefinitions source] |
|
2881 | 4699 |
|
4700 |
"Created: / 13-04-2012 / 13:14:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4701 |
! |
|
4702 |
||
4703 |
primitiveFunctions |
|
4704 |
^ primitiveFunctions |
|
4705 |
! |
|
4706 |
||
4707 |
primitiveFunctionsString |
|
3839 | 4708 |
^ primitiveFunctions isNil |
4709 |
ifTrue:[nil] |
|
4710 |
ifFalse:[primitiveFunctions source] |
|
2881 | 4711 |
|
4712 |
"Created: / 13-04-2012 / 13:15:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4713 |
! |
|
4714 |
||
4715 |
primitiveVariables |
|
4716 |
^ primitiveVariables |
|
4717 |
! |
|
4718 |
||
4719 |
primitiveVariablesString |
|
3839 | 4720 |
^ primitiveVariables isNil |
4721 |
ifTrue:[nil] |
|
4722 |
ifFalse:[primitiveVariables source] |
|
2881 | 4723 |
|
4724 |
"Created: / 13-04-2012 / 13:15:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4725 |
! |
|
4726 |
||
4727 |
selectorAtMethod: m |
|
4728 |
^m selector |
|
4729 |
||
4730 |
"Created: / 19-03-2012 / 18:14:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4731 |
! |
|
4732 |
||
4733 |
superclass |
|
4734 |
^ superclass |
|
4735 |
! |
|
4736 |
||
4737 |
superclass:something |
|
4738 |
superclass := something. |
|
4739 |
! ! |
|
4740 |
||
4741 |
!ChangeSet::ClassSourceWriter::ClassInfo methodsFor:'adding'! |
|
4742 |
||
4743 |
addChange: change |
|
4744 |
||
4745 |
change isClassDefinitionChange ifTrue:[ |
|
3839 | 4746 |
self assert: definition isNil. |
4747 |
definition := change. |
|
4748 |
^self. |
|
2881 | 4749 |
]. |
4750 |
change isMethodCodeChange ifTrue:[ |
|
3839 | 4751 |
methods add: change. |
4752 |
^self. |
|
2881 | 4753 |
]. |
4754 |
change isMethodCategoryChange ifTrue:[ |
|
3839 | 4755 |
methods add: change. |
4756 |
^self. |
|
2881 | 4757 |
]. |
4758 |
||
4759 |
change isClassInstVarDefinitionChange ifTrue:[ |
|
3839 | 4760 |
self assert: definition isNil. |
4761 |
definition := change. |
|
4762 |
^self |
|
2881 | 4763 |
]. |
4764 |
||
4765 |
change isPrimitiveDefinitionsChange ifTrue:[ |
|
3839 | 4766 |
primitiveDefinitions := change. |
4767 |
^self |
|
2881 | 4768 |
]. |
4769 |
||
4770 |
change isPrimitiveVariablesChange ifTrue:[ |
|
3839 | 4771 |
primitiveVariables := change. |
4772 |
^self |
|
2881 | 4773 |
]. |
4774 |
||
4775 |
change isPrimitiveFunctionsChange ifTrue:[ |
|
3839 | 4776 |
primitiveFunctions := change. |
4777 |
^self |
|
2881 | 4778 |
]. |
4779 |
||
3246 | 4780 |
change isClassCommentChange ifTrue:[ |
3839 | 4781 |
comment := change. |
4782 |
^self |
|
3246 | 4783 |
]. |
4784 |
||
3839 | 4785 |
change isClassInitializeChange ifTrue:[ |
4786 |
"/ Ignore it, the class inititalization chunk is |
|
4787 |
"/ written fileOut:on:withTimeStamp:withInitialize:withDefinition:methodFilter:encoder: |
|
4788 |
"/ for all class implementing class-side #initialize |
|
4789 |
^ self |
|
3575
6d208ef54e78
Fixes ClassSourceWriter - ignore ClassInitializeChange when analyzing changeset.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3545
diff
changeset
|
4790 |
]. |
6d208ef54e78
Fixes ClassSourceWriter - ignore ClassInitializeChange when analyzing changeset.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3545
diff
changeset
|
4791 |
|
2881 | 4792 |
self error: 'Unknown change' |
4793 |
||
4794 |
"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
|
4795 |
"Modified: / 05-06-2014 / 08:14:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2881 | 4796 |
! ! |
4797 |
||
4798 |
!ChangeSet::ClassSourceWriter::ClassInfo methodsFor:'enumerating'! |
|
4799 |
||
4800 |
methodsDo: aBlock |
|
4801 |
||
4802 |
methods do: aBlock |
|
4803 |
||
4804 |
"Created: / 19-03-2012 / 18:14:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4805 |
! ! |
|
4806 |
||
4807 |
!ChangeSet::ClassSourceWriter::ClassInfo methodsFor:'initialization'! |
|
4808 |
||
4809 |
initialize |
|
4810 |
"Invoked when a new instance is created." |
|
4811 |
||
4812 |
"/ please change as required (and remove this comment) |
|
4813 |
"/ name := nil. |
|
4814 |
"/ instDefinition := nil. |
|
4815 |
"/ classDefinition := nil. |
|
4816 |
methods := OrderedCollection new. |
|
4817 |
||
4818 |
"/ super initialize. -- commented since inherited method does nothing |
|
4819 |
||
4820 |
"Modified: / 15-03-2012 / 19:12:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4821 |
! ! |
|
4822 |
||
4823 |
!ChangeSet::ClassSourceWriter::ClassInfo methodsFor:'printing & storing'! |
|
4824 |
||
4825 |
printClassNameOn:aStream |
|
4826 |
| nameWithoutNs | |
|
4827 |
||
4828 |
nameWithoutNs := name. |
|
3445 | 4829 |
"/ namespace notNil ifTrue:[ |
4830 |
"/ self assert: (name startsWith:namespace). |
|
4831 |
"/ nameWithoutNs := nameWithoutNs copyFrom: namespace size + 3. |
|
4832 |
"/ ]. |
|
2881 | 4833 |
|
4834 |
aStream nextPutAll: nameWithoutNs |
|
4835 |
||
4836 |
"Created: / 19-03-2012 / 18:17:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3445 | 4837 |
"Modified: / 11-06-2013 / 17:59:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2881 | 4838 |
! |
4839 |
||
4840 |
printOn:aStream |
|
4073 | 4841 |
"append a printed representation of the receiver to the argument, aStream" |
2881 | 4842 |
|
4843 |
aStream nextPutAll: self class nameWithoutPrefix. |
|
4844 |
aStream nextPutAll:'('. |
|
4845 |
name printOn:aStream. |
|
4846 |
aStream nextPutAll:')'. |
|
4847 |
||
4848 |
"Modified: / 19-03-2012 / 19:43:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4849 |
! ! |
|
4850 |
||
4851 |
!ChangeSet::ClassSourceWriter::ClassInfo methodsFor:'queries'! |
|
4852 |
||
4853 |
includesSelector: selector |
|
4854 |
||
4855 |
^methods anySatisfy:[:m|m selector == selector]. |
|
4856 |
||
4857 |
"Created: / 19-03-2012 / 18:22:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4858 |
! |
|
4859 |
||
4860 |
isPrivateClassOf: classInfo |
|
4861 |
||
4862 |
^(name startsWith: classInfo name) |
|
3839 | 4863 |
and:[ (name at: (classInfo name size + 1)) == $: |
4864 |
and:[ (name at: (classInfo name size + 2)) == $:]] |
|
2881 | 4865 |
|
4866 |
"Created: / 15-03-2012 / 19:42:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4867 |
! |
|
4868 |
||
4869 |
isSubclassOf: classInfo |
|
4870 |
||
4871 |
^superclass notNil and: |
|
3839 | 4872 |
[superclass == classInfo or:[superclass isSubclassOf: classInfo]] |
2881 | 4873 |
|
4874 |
"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
|
4875 |
! ! |
f4794940b620
new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents:
1169
diff
changeset
|
4876 |
|
2321 | 4877 |
!ChangeSet::DiffSet class methodsFor:'documentation'! |
4878 |
||
4879 |
documentation |
|
4880 |
" |
|
4881 |
I represent the differences between two change sets. |
|
4882 |
As such, I can be used by a VersionDiffBrowser and to generate patchSets. |
|
4883 |
" |
|
4884 |
! ! |
|
4885 |
||
1156
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4886 |
!ChangeSet::DiffSet methodsFor:'accessing'! |
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4887 |
|
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4888 |
changed |
1867 | 4889 |
"return the set of methods which were different" |
1156
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4890 |
|
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4891 |
^ changed |
1867 | 4892 |
|
4893 |
"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
|
4894 |
! |
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:something |
1867 | 4897 |
"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
|
4898 |
|
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4899 |
changed := something. |
1867 | 4900 |
|
4901 |
"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
|
4902 |
! |
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4903 |
|
3839 | 4904 |
changed:changedArg onlyInReceiver:onlyInReceiverArg onlyInArg:onlyInArgArg |
3338 | 4905 |
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
|
4906 |
! |
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4907 |
|
2881 | 4908 |
changed:changedArg onlyInReceiver:onlyInReceiverArg onlyInArg:onlyInArgArg same: sameArg |
4909 |
"set instance variables (automatically generated)" |
|
4910 |
||
4911 |
changed := changedArg. |
|
4912 |
changed isNil ifTrue:[changed := OrderedCollection new]. |
|
4913 |
||
4914 |
onlyInReceiver := onlyInReceiverArg. |
|
4915 |
onlyInReceiver isNil ifTrue:[onlyInReceiver := ChangeSet new]. |
|
4916 |
||
4917 |
onlyInArg := onlyInArgArg. |
|
4918 |
onlyInArg isNil ifTrue:[onlyInArg := ChangeSet new]. |
|
4919 |
||
4920 |
same := sameArg. |
|
4921 |
same isNil ifTrue:[same := ChangeSet new]. |
|
4922 |
||
4923 |
"Created: / 19-03-2012 / 21:35:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4924 |
! |
|
4925 |
||
1156
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4926 |
onlyInArg |
1867 | 4927 |
"return the set of methods which were only present in the argument of the diffset" |
4928 |
||
1156
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4929 |
^ onlyInArg |
1867 | 4930 |
|
4931 |
"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
|
4932 |
! |
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4933 |
|
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4934 |
onlyInArg:something |
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4935 |
onlyInArg := something. |
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4936 |
! |
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4937 |
|
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4938 |
onlyInReceiver |
1867 | 4939 |
"return the set of methods which were only present in the receiver of the diffset" |
4940 |
||
1156
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4941 |
^ onlyInReceiver |
1867 | 4942 |
|
4943 |
"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
|
4944 |
! |
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4945 |
|
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4946 |
onlyInReceiver:something |
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4947 |
onlyInReceiver := something. |
2881 | 4948 |
! |
4949 |
||
4950 |
same |
|
4951 |
^ same |
|
4952 |
! |
|
4953 |
||
4954 |
same:something |
|
4955 |
same := something. |
|
1156
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4956 |
! ! |
29fb7d77797d
use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
4957 |
|
1869
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4958 |
!ChangeSet::DiffSet methodsFor:'merging'! |
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4959 |
|
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4960 |
addDiffSet:anotherDiffset |
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4961 |
changed addAll:(anotherDiffset changed). |
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4962 |
onlyInReceiver addAll:(anotherDiffset onlyInReceiver). |
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4963 |
onlyInArg addAll:(anotherDiffset onlyInArg). |
2881 | 4964 |
same addAll: (anotherDiffset same). |
1869
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4965 |
|
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4966 |
"Created: / 12-10-2006 / 22:49:30 / cg" |
2881 | 4967 |
"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
|
4968 |
! |
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4969 |
|
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4970 |
copy |
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4971 |
^ self class new |
3839 | 4972 |
changed:changed copy |
4973 |
onlyInReceiver:onlyInReceiver copy |
|
4974 |
onlyInArg:onlyInArg copy |
|
4975 |
same:same copy |
|
1869
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4976 |
|
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4977 |
"Created: / 12-10-2006 / 22:50:56 / cg" |
2881 | 4978 |
"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
|
4979 |
! ! |
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4980 |
|
2186 | 4981 |
!ChangeSet::DiffSet methodsFor:'misc'! |
4982 |
||
4983 |
removeAllVersionMethods |
|
3839 | 4984 |
changed := changed |
4985 |
reject:[:pair | |
|
4986 |
pair first isMethodChangeForVersionMethod |
|
4987 |
]. |
|
4988 |
onlyInReceiver := onlyInReceiver |
|
4989 |
reject:[:chg | |
|
4990 |
chg isMethodChangeForVersionMethod |
|
4991 |
]. |
|
4992 |
onlyInArg := onlyInArg |
|
4993 |
reject:[:chg | |
|
4994 |
chg isMethodChangeForVersionMethod |
|
4995 |
]. |
|
3904 | 4996 |
! |
4997 |
||
4998 |
sortByClassName |
|
4999 |
onlyInReceiver notNil ifTrue:[ |
|
5000 |
onlyInReceiver := onlyInReceiver sortedByClassName. |
|
5001 |
]. |
|
5002 |
onlyInArg notNil ifTrue:[ |
|
5003 |
onlyInArg := onlyInArg sortedByClassName. |
|
5004 |
]. |
|
5005 |
changed notEmptyOrNil ifTrue:[ |
|
5006 |
changed := changed sort:[:pairA :pairB | |
|
5007 |
|nameA nameB chgA chgB| |
|
5008 |
chgA := pairA first. chgB := pairB first. |
|
5009 |
nameA := chgA isClassChange ifTrue:[chgA className] ifFalse:['^other']. |
|
5010 |
nameB := chgB isClassChange ifTrue:[chgB className] ifFalse:['^other']. |
|
5011 |
nameA < nameB] |
|
5012 |
]. |
|
2186 | 5013 |
! ! |
5014 |
||
1292 | 5015 |
!ChangeSet::DiffSet methodsFor:'queries'! |
5016 |
||
2914
8d837a083e9b
query for changedClasses added
Claus Gittinger <cg@exept.de>
parents:
2907
diff
changeset
|
5017 |
changedClasses |
8d837a083e9b
query for changedClasses added
Claus Gittinger <cg@exept.de>
parents:
2907
diff
changeset
|
5018 |
|allChangedClasses| |
8d837a083e9b
query for changedClasses added
Claus Gittinger <cg@exept.de>
parents:
2907
diff
changeset
|
5019 |
|
2923 | 5020 |
allChangedClasses := Set new. |
2914
8d837a083e9b
query for changedClasses added
Claus Gittinger <cg@exept.de>
parents:
2907
diff
changeset
|
5021 |
allChangedClasses addAll:(onlyInArg changedClasses). |
8d837a083e9b
query for changedClasses added
Claus Gittinger <cg@exept.de>
parents:
2907
diff
changeset
|
5022 |
allChangedClasses addAll:(onlyInReceiver changedClasses). |
3839 | 5023 |
changed do:[:eachChangePair | |
5024 |
allChangedClasses add:(eachChangePair first changeClass). |
|
5025 |
allChangedClasses add:(eachChangePair second changeClass). |
|
2923 | 5026 |
]. |
5027 |
allChangedClasses remove:nil ifAbsent:[]. |
|
2914
8d837a083e9b
query for changedClasses added
Claus Gittinger <cg@exept.de>
parents:
2907
diff
changeset
|
5028 |
^ allChangedClasses |
8d837a083e9b
query for changedClasses added
Claus Gittinger <cg@exept.de>
parents:
2907
diff
changeset
|
5029 |
|
8d837a083e9b
query for changedClasses added
Claus Gittinger <cg@exept.de>
parents:
2907
diff
changeset
|
5030 |
"Created: / 26-09-2012 / 15:39:18 / cg" |
8d837a083e9b
query for changedClasses added
Claus Gittinger <cg@exept.de>
parents:
2907
diff
changeset
|
5031 |
! |
8d837a083e9b
query for changedClasses added
Claus Gittinger <cg@exept.de>
parents:
2907
diff
changeset
|
5032 |
|
1292 | 5033 |
isEmpty |
5034 |
^ changed isEmpty |
|
5035 |
and:[ onlyInReceiver isEmpty |
|
5036 |
and:[ onlyInArg isEmpty ] ] |
|
1869
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
5037 |
! |
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
5038 |
|
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
5039 |
notEmpty |
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
5040 |
^ self isEmpty not |
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
5041 |
|
988269721678
+isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
5042 |
"Created: / 12-10-2006 / 23:12:27 / cg" |
1292 | 5043 |
! ! |
5044 |
||
1182 | 5045 |
!ChangeSet::DolphinPACFileReader methodsFor:'reading-private'! |
5046 |
||
5047 |
handleCategoriesForClass |
|
5048 |
|category change| |
|
5049 |
||
2179 | 5050 |
[ |
3839 | 5051 |
inputStream skipSeparators. |
5052 |
category := inputStream nextChunk. |
|
5053 |
category notEmpty |
|
2179 | 5054 |
] whileTrue:[ |
3839 | 5055 |
change := ClassCategoryChange new. |
5056 |
change |
|
5057 |
className:className |
|
5058 |
category:category. |
|
5059 |
||
5060 |
self addChange:change. |
|
2179 | 5061 |
]. |
1182 | 5062 |
^ true |
5063 |
! |
|
5064 |
||
5065 |
handleCategoriesForMethod |
|
2179 | 5066 |
|methodSelector categories change isPrivate isPublic category| |
1182 | 5067 |
|
5068 |
methodSelector := (arguments at:1) evaluate. |
|
5069 |
inputStream skipSeparators. |
|
5070 |
isPrivate := false. |
|
5071 |
||
5072 |
categories := OrderedCollection new. |
|
5073 |
[ |
|
3839 | 5074 |
|done category | |
5075 |
||
5076 |
category := inputStream nextChunk withoutSeparators. |
|
5077 |
done := category isEmpty. |
|
5078 |
done ifFalse:[ |
|
5079 |
categories add:category |
|
5080 |
]. |
|
5081 |
done |
|
2179 | 5082 |
] whileFalse. |
1182 | 5083 |
|
5084 |
categories size > 1 ifTrue:[ |
|
3839 | 5085 |
isPrivate := categories includes:'private'. |
5086 |
categories remove:'private' ifAbsent:nil. |
|
1182 | 5087 |
]. |
5088 |
categories size > 1 ifTrue:[ |
|
3839 | 5089 |
isPublic := categories includes:'public'. |
5090 |
categories remove:'public' ifAbsent:nil. |
|
1182 | 5091 |
]. |
5092 |
"/ categories size > 1 ifTrue:[ |
|
5093 |
"/ self halt. |
|
5094 |
"/ ]. |
|
5095 |
||
5096 |
category := categories first. |
|
5097 |
isPrivate ifTrue:[ |
|
3839 | 5098 |
category := category , '-private'. |
1182 | 5099 |
]. |
5100 |
||
5101 |
change := MethodCategoryChange new. |
|
3839 | 5102 |
change |
5103 |
className:className |
|
5104 |
selector:methodSelector |
|
5105 |
category:category. |
|
1182 | 5106 |
|
5107 |
self addChange:change. |
|
5108 |
^ true |
|
5109 |
! |
|
5110 |
||
5111 |
processChange |
|
5112 |
"given a parse-tree (from parsing some changes source/chunk), |
|
5113 |
create changes and evaluate changeAction on each. |
|
5114 |
The block is invoked with the change and a lineNumberOrNil as |
|
3839 | 5115 |
arg; the lineNumber is only valid, if the underlying stream |
1182 | 5116 |
provides line-numbers; otherwise, nil is passed." |
5117 |
||
5118 |
(selector == #'categoriesForClass') ifTrue:[ |
|
3839 | 5119 |
^ self handleCategoriesForClass. |
1182 | 5120 |
]. |
5121 |
(selector == #'categoriesFor:') ifTrue:[ |
|
3839 | 5122 |
^ self handleCategoriesForMethod. |
1182 | 5123 |
]. |
5124 |
selector == #'subclass:instanceVariableNames:classVariableNames:poolDictionaries:classInstanceVariableNames:' ifTrue:[ |
|
3839 | 5125 |
^ self handleClassDefinitionChange. |
1182 | 5126 |
]. |
2179 | 5127 |
"/ selector == #'guid:' ifTrue:[ |
5128 |
"/ ^ self handleGUIDChange. |
|
5129 |
"/ ]. |
|
1182 | 5130 |
^ super processChange |
5131 |
||
5132 |
||
5133 |
"/ selector == #named:superclass:indexedInstanceVariables:instanceVariableNames:classVariableNames:sharedPools:classInstanceVariableNames: ifTrue:[ |
|
5134 |
"/ ^ self handleClassDefinitionChange. |
|
5135 |
"/ ]. |
|
5136 |
"/ (selector == #'key:value:') ifTrue:[ |
|
5137 |
"/ (self checkReceiverIsGlobalNamed:'Annotation') ifTrue:[ |
|
5138 |
"/ ^ self handleAnnotation. |
|
5139 |
"/ ] |
|
5140 |
"/ ]. |
|
5141 |
"/ selector == #'method' ifTrue:[ |
|
5142 |
"/ ^ self handleMethodChange:false. |
|
5143 |
"/ ]. |
|
5144 |
"/ selector == #'classMethod' ifTrue:[ |
|
5145 |
"/ ^ self handleMethodChange:true. |
|
5146 |
"/ ]. |
|
5147 |
"/ |
|
5148 |
"/ selector == #'initializer' ifTrue:[ |
|
5149 |
"/ ^ true |
|
5150 |
"/ ]. |
|
5151 |
"/ selector == #'initialize' ifTrue:[ |
|
5152 |
"/ ^ true |
|
5153 |
"/ ]. |
|
5154 |
"/self halt. |
|
5155 |
"/ |
|
5156 |
"/ ^ false |
|
5157 |
||
5158 |
"Created: / 16.2.1998 / 13:42:40 / cg" |
|
5159 |
"Modified: / 15.12.1999 / 00:29:06 / cg" |
|
5160 |
! ! |
|
5161 |
||
4397 | 5162 |
!ChangeSet::GNUSmalltalkFileReader class methodsFor:'documentation'! |
5163 |
||
5164 |
documentation |
|
5165 |
" |
|
5166 |
documentation to be added. |
|
5167 |
||
5168 |
[author:] |
|
5169 |
Claus Gittinger |
|
5170 |
||
5171 |
[instance variables:] |
|
5172 |
||
5173 |
[class variables:] |
|
5174 |
||
5175 |
[see also:] |
|
5176 |
||
5177 |
" |
|
5178 |
! ! |
|
5179 |
||
5180 |
!ChangeSet::GNUSmalltalkFileReader methodsFor:'private'! |
|
5181 |
||
5182 |
readClass |
|
5183 |
|classDefinition classCategory classComment k |
|
5184 |
newClassName superClassName instVars |
|
5185 |
methodStartPos methodEndPos methodSpecStartPos methodSpecEndPos |
|
5186 |
methodClassName |
|
5187 |
methodSpecSource methodSource| |
|
5188 |
||
5189 |
parser := Parser new. |
|
5190 |
||
5191 |
parser source:inputStream. |
|
5192 |
parser nextToken. |
|
5193 |
||
5194 |
"/ expect a subclass definition of the form: |
|
5195 |
"/ <identifier> subclass: <identifier> |
|
5196 |
classDefinition := parser keywordExpression. |
|
5197 |
(classDefinition isMessage |
|
5198 |
and:[ #( #'subclass:' ) includes:classDefinition selector ]) ifFalse:[ |
|
5199 |
parser parseError:'class definition message expected (id subclass: id)' |
|
5200 |
]. |
|
5201 |
classDefinition receiver isVariable ifFalse:[ |
|
5202 |
parser parseError:'invalid superclass in class definition' |
|
5203 |
]. |
|
5204 |
superClassName := classDefinition receiver name. |
|
5205 |
||
5206 |
"/ GNU uses plain name for the new class - we need a symbol |
|
5207 |
classDefinition arg1 isVariable ifFalse:[ |
|
5208 |
parser parseError:'invalid classname in class definition' |
|
5209 |
]. |
|
5210 |
newClassName := classDefinition arg1 name. |
|
5211 |
||
5212 |
classDefinition arguments |
|
5213 |
at:1 put:(ConstantNode value:classDefinition arg1 name asSymbol). |
|
5214 |
||
5215 |
parser tokenType == $[ ifFalse:[ |
|
5216 |
parser parseError:'"[" expected (class definition)' |
|
5217 |
]. |
|
5218 |
parser nextToken. |
|
5219 |
||
5220 |
[(parser tokenType == #BinaryOperator) and:[parser token = '<']] whileTrue:[ |
|
5221 |
parser nextToken. |
|
5222 |
k := parser token. |
|
5223 |
( #('category:' 'comment:') includes: k) ifTrue:[ |
|
5224 |
parser nextToken. |
|
5225 |
(parser tokenType == #String) ifTrue:[ |
|
5226 |
k = 'category:' ifTrue:[ |
|
5227 |
classCategory := parser token. |
|
5228 |
] ifFalse:[ |
|
5229 |
classComment := parser token. |
|
5230 |
]. |
|
5231 |
parser nextToken. |
|
5232 |
(parser token = '>') ifFalse:[ |
|
5233 |
parser parseError:'">" expected' |
|
5234 |
]. |
|
5235 |
parser nextToken. |
|
5236 |
] ifFalse:[ |
|
5237 |
self halt. |
|
5238 |
]. |
|
5239 |
] ifFalse:[ |
|
5240 |
self halt. |
|
5241 |
]. |
|
5242 |
]. |
|
5243 |
||
5244 |
instVars := OrderedCollection new. |
|
5245 |
"/ instvar definition? |
|
5246 |
parser tokenType == $| ifTrue:[ |
|
5247 |
parser nextToken. |
|
5248 |
[ parser tokenType == $| ] whileFalse:[ |
|
5249 |
parser tokenType == #Identifier ifFalse:[ |
|
5250 |
parser parseError:'identifier expected (in instvar list)'. |
|
5251 |
]. |
|
5252 |
instVars add:parser token. |
|
5253 |
parser nextToken. |
|
5254 |
]. |
|
5255 |
parser nextToken. |
|
5256 |
]. |
|
5257 |
||
5258 |
self addChange:(ClassDefinitionChange new |
|
5259 |
className:newClassName; |
|
5260 |
superClassName:superClassName; |
|
5261 |
instanceVariableString:(instVars asStringWith:' '); |
|
5262 |
category:(classCategory ? 'GNU classes'); |
|
5263 |
yourself). |
|
5264 |
||
5265 |
classComment notNil ifTrue:[ |
|
5266 |
self addChange:(ClassCommentChange new |
|
5267 |
className:newClassName; |
|
5268 |
comment:classComment; |
|
5269 |
yourself) |
|
5270 |
]. |
|
5271 |
||
5272 |
"/ methods |
|
5273 |
[ parser tokenType == $] ] whileFalse:[ |
|
5274 |
"/ must be |
|
5275 |
"/ ( NewClassName | NewClassName "class" ) methodSpec |
|
5276 |
"/ or |
|
5277 |
"/ methodSpec |
|
5278 |
methodClassName := newClassName. |
|
5279 |
||
5280 |
(parser tokenType == #Identifier |
|
5281 |
and:[ parser token = newClassName ]) ifTrue:[ |
|
5282 |
parser nextToken. |
|
5283 |
(parser tokenType == #Identifier |
|
5284 |
and:[ parser token = 'class' ]) ifTrue:[ |
|
5285 |
parser nextToken. |
|
5286 |
methodClassName := methodClassName,' class'. |
|
5287 |
]. |
|
5288 |
"/ expect >> |
|
5289 |
(parser tokenType == #BinaryOperator |
|
5290 |
and:[parser token = '>>']) ifFalse:[ |
|
5291 |
parser parseError:('">>" expected'). |
|
5292 |
]. |
|
5293 |
parser nextToken. |
|
5294 |
]. |
|
5295 |
||
5296 |
methodSpecStartPos := parser tokenPosition. |
|
5297 |
parser parseMethodSpec. |
|
5298 |
methodSpecEndPos := parser tokenPosition-1. |
|
5299 |
methodSpecSource := inputStream collection copyFrom:methodSpecStartPos to:methodSpecEndPos. |
|
5300 |
||
5301 |
parser tokenType == $[ ifFalse:[ |
|
5302 |
parser parseError:'"[" expected (method definition)' |
|
5303 |
]. |
|
5304 |
parser nextToken. |
|
5305 |
||
5306 |
methodStartPos := parser tokenPosition. |
|
5307 |
parser parseMethodBody. |
|
5308 |
methodEndPos := parser tokenPosition-1. |
|
5309 |
methodSource := inputStream collection copyFrom:methodStartPos to:methodEndPos. |
|
5310 |
||
5311 |
parser tokenType == $] ifFalse:[ |
|
5312 |
parser parseError:'"]" expected (method definition)' |
|
5313 |
]. |
|
5314 |
parser nextToken. |
|
5315 |
||
5316 |
self addChange:(MethodDefinitionChange |
|
5317 |
className:methodClassName |
|
5318 |
selector:parser selector |
|
5319 |
source:(methodSpecSource,Character cr,methodSource) |
|
5320 |
category:'* uncategorized GNU *') |
|
5321 |
]. |
|
5322 |
||
5323 |
"<<END |
|
5324 |
||
5325 |
ChangeSet fromGNUSmalltalkStream:' |
|
5326 |
Object subclass: Polynomial [ |
|
5327 |
<category: ''Math''> |
|
5328 |
|coeffs| |
|
5329 |
Polynomial class >> new [ ^ super basicNew init ] |
|
5330 |
init [ coeffs := OrderedCollection new. ^ self ] |
|
5331 |
Polynomial class >> newWithCoefficients: coefficients [ |
|
5332 |
|r| |
|
5333 |
r := super basicNew. |
|
5334 |
^ r initWithCoefficients: coefficients |
|
5335 |
] |
|
5336 |
initWithCoefficients: coefficients [ |
|
5337 |
coeffs := coefficients asOrderedCollection. |
|
5338 |
^ self |
|
5339 |
] |
|
5340 |
/ denominator [ |n q| |
|
5341 |
n := self deepCopy. |
|
5342 |
self >= denominator |
|
5343 |
ifTrue: [ |
|
5344 |
q := Polynomial new. |
|
5345 |
[ n >= denominator ] |
|
5346 |
whileTrue: [ |piv| |
|
5347 |
piv := (n coeff: 0) / (denominator coeff: 0). |
|
5348 |
q addCoefficient: piv. |
|
5349 |
n := n - (denominator * piv). |
|
5350 |
n clean |
|
5351 |
]. |
|
5352 |
^ { q . (n degree) > 0 ifTrue: [ n ] ifFalse: [ n addCoefficient: 0. n ] } |
|
5353 |
] |
|
5354 |
ifFalse: [ |
|
5355 |
^ { Polynomial newWithCoefficients: #( 0 ) . self deepCopy } |
|
5356 |
] |
|
5357 |
] |
|
5358 |
* constant [ |r| r := self deepCopy. |
|
5359 |
1 to: (coeffs size) do: [ :i | |
|
5360 |
r at: i put: ((r at: i) * constant) |
|
5361 |
]. |
|
5362 |
^ r |
|
5363 |
] |
|
5364 |
at: index [ ^ coeffs at: index ] |
|
5365 |
at: index put: obj [ ^ coeffs at: index put: obj ] |
|
5366 |
>= anotherPoly [ |
|
5367 |
^ (self degree) >= (anotherPoly degree) |
|
5368 |
] |
|
5369 |
degree [ ^ coeffs size ] |
|
5370 |
- anotherPoly [ "This is not a real subtraction between Polynomial: it is an |
|
5371 |
internal method ..." |
|
5372 |
|a| |
|
5373 |
a := self deepCopy. |
|
5374 |
1 to: ( (coeffs size) min: (anotherPoly degree) ) do: [ :i | |
|
5375 |
a at: i put: ( (a at: i) - (anotherPoly at: i) ) |
|
5376 |
]. |
|
5377 |
^ a |
|
5378 |
] |
|
5379 |
coeff: index [ ^ coeffs at: (index + 1) ] |
|
5380 |
addCoefficient: coeff [ coeffs add: coeff ] |
|
5381 |
clean [ |
|
5382 |
[ (coeffs size) > 0 |
|
5383 |
ifTrue: [ (coeffs at: 1) = 0 ] ifFalse: [ false ] ] |
|
5384 |
whileTrue: [ coeffs removeFirst ]. |
|
5385 |
] |
|
5386 |
display [ |
|
5387 |
1 to: (coeffs size) do: [ :i | |
|
5388 |
(coeffs at: i) display. |
|
5389 |
i < (coeffs size) |
|
5390 |
ifTrue: [ (''x^%1 + '' % {(coeffs size) - i} ) display ] |
|
5391 |
] |
|
5392 |
] |
|
5393 |
displayNl [ self display. Character nl display ] |
|
5394 |
].' readStream |
|
5395 |
||
5396 |
END>>" |
|
5397 |
||
5398 |
"Created: / 10-02-2019 / 16:21:15 / Claus Gittinger" |
|
5399 |
"Modified: / 10-02-2019 / 23:17:42 / Claus Gittinger" |
|
5400 |
! ! |
|
5401 |
||
5402 |
!ChangeSet::GNUSmalltalkFileReader methodsFor:'reading'! |
|
5403 |
||
5404 |
changesFromStream:aStream for:changeSetArg do:changeActionArg |
|
5405 |
inputStream := aStream. |
|
5406 |
changeSet := changeSetArg. |
|
5407 |
changeAction := changeActionArg. |
|
5408 |
||
5409 |
self readClass. |
|
5410 |
^ changeSet |
|
5411 |
||
5412 |
" |
|
5413 |
ChangeSet fromGNUSmalltalkStream:' |
|
5414 |
Object subclass: Polynomial [ |
|
5415 |
|coeffs| |
|
5416 |
Polynomial class >> new [ ^ super basicNew init ] |
|
5417 |
init [ coeffs := OrderedCollection new. ^ self ] |
|
5418 |
] |
|
5419 |
' readStream |
|
5420 |
" |
|
5421 |
||
5422 |
"Created: / 10-02-2019 / 16:20:21 / Claus Gittinger" |
|
5423 |
"Modified: / 10-02-2019 / 22:48:34 / Claus Gittinger" |
|
5424 |
! ! |
|
5425 |
||
4428 | 5426 |
!ChangeSet::GithubPharoSmalltalkFileReader class methodsFor:'documentation'! |
5427 |
||
5428 |
documentation |
|
5429 |
" |
|
5430 |
ChangeSet fromGithubPharoSmalltalkStream: |
|
5431 |
'/Users/cg/Downloads/smalltalk/PharoJS-master/Pharo/PharoJsBridgeTest/PjBasicTest.class.st' |
|
5432 |
asFilename readStream |
|
5433 |
||
5434 |
ChangeSet fromGithubPharoSmalltalkStream: |
|
5435 |
'/Users/cg/Downloads/smalltalk/PharoJS-master/Pharo/PharoJsCoreLibraries/PjStack.class.st' |
|
5436 |
asFilename readStream |
|
5437 |
||
5438 |
|dir| |
|
5439 |
dir := '/Users/cg/Downloads/smalltalk/PharoJS-master/Pharo/PharoJsCoreLibraries' asFilename. |
|
5440 |
dir filesMatchingGLOB:'*.st' do:[:eachSTFile | |
|
5441 |
Transcript showCR:'reading %1' with:eachSTFile baseName. |
|
5442 |
eachSTFile readingFileDo:[:s | |
|
5443 |
ChangeSet fromGithubPharoSmalltalkStream:s |
|
5444 |
]. |
|
5445 |
]. |
|
5446 |
" |
|
5447 |
! ! |
|
5448 |
||
5449 |
!ChangeSet::GithubPharoSmalltalkFileReader methodsFor:'private'! |
|
5450 |
||
5451 |
readClassDefinition:what |
|
5452 |
"what is either #class or #trait. |
|
5453 |
'Class/Trait' '{' has been read. |
|
5454 |
read the class definition proper" |
|
5455 |
||
5456 |
|name superClassName classType pools category |
|
5457 |
traits classTraits instVarNames classVarNames classInstVarNames |
|
5458 |
classDefChange traitDefChange| |
|
5459 |
||
5460 |
parser nextToken. |
|
5461 |
[parser token == $} ] whileFalse:[ |
|
5462 |
|keyw| |
|
5463 |
||
5464 |
parser tokenType == #Symbol ifFalse:[ |
|
5465 |
parser parseError:'class definition keyword symbol expected (eg. #name)' |
|
5466 |
]. |
|
5467 |
keyw := parser token. |
|
5468 |
parser nextToken. |
|
5469 |
parser expectToken:$:. |
|
5470 |
||
5471 |
keyw == #name ifTrue:[ |
|
5472 |
parser tokenType == #Symbol ifFalse:[ |
|
5473 |
parser parseError:'class name symbol expected (eg. #name : #className)' |
|
5474 |
]. |
|
5475 |
name := parser token. |
|
5476 |
parser nextToken. |
|
5477 |
] ifFalse:[ |
|
5478 |
keyw == #superclass ifTrue:[ |
|
5479 |
parser tokenType == #Symbol ifFalse:[ |
|
5480 |
parser parseError:'superclass name symbol expected (eg. #superclass : #className)' |
|
5481 |
]. |
|
5482 |
superClassName := parser token. |
|
5483 |
parser nextToken. |
|
5484 |
] ifFalse:[ |
|
5485 |
keyw == #category ifTrue:[ |
|
5486 |
parser tokenType == #Symbol ifFalse:[ |
|
5487 |
parser parseError:'category symbol expected (eg. #category : #categoryName)' |
|
5488 |
]. |
|
5489 |
category := parser token. |
|
5490 |
parser nextToken. |
|
5491 |
] ifFalse:[ |
|
5492 |
keyw == #type ifTrue:[ |
|
5493 |
parser tokenType == #Symbol ifFalse:[ |
|
5494 |
parser parseError:'category symbol expected (eg. #category : #categoryName)' |
|
5495 |
]. |
|
5496 |
classType := parser token. |
|
5497 |
parser nextToken. |
|
5498 |
] ifFalse:[ |
|
5499 |
keyw == #pools ifTrue:[ |
|
5500 |
parser tokenType == $[ ifFalse:[ |
|
5501 |
parser parseError:'pools collection expected (eg. #pools : [ ... ]' |
|
5502 |
]. |
|
5503 |
pools := self readStringList. |
|
5504 |
] ifFalse:[ |
|
5505 |
keyw == #traits ifTrue:[ |
|
5506 |
parser tokenType == #String ifFalse:[ |
|
5507 |
parser parseError:'traits string expected' |
|
5508 |
]. |
|
5509 |
traits := parser token. |
|
5510 |
parser nextToken. |
|
5511 |
] ifFalse:[ |
|
5512 |
keyw == #classTraits ifTrue:[ |
|
5513 |
parser tokenType == #String ifFalse:[ |
|
5514 |
parser parseError:'classTraits string expected' |
|
5515 |
]. |
|
5516 |
classTraits := parser token. |
|
5517 |
parser nextToken. |
|
5518 |
] ifFalse:[ |
|
5519 |
keyw == #instVars ifTrue:[ |
|
5520 |
parser tokenType == $[ ifFalse:[ |
|
5521 |
parser parseError:'instVarNames collection expected (eg. #instVars : [ ... ]' |
|
5522 |
]. |
|
5523 |
instVarNames := self readStringList |
|
5524 |
] ifFalse:[ |
|
5525 |
keyw == #classVars ifTrue:[ |
|
5526 |
parser tokenType == $[ ifFalse:[ |
|
5527 |
parser parseError:'classVars collection expected (eg. #instVars : [ ... ]' |
|
5528 |
]. |
|
5529 |
classVarNames := self readStringList |
|
5530 |
] ifFalse:[ |
|
5531 |
keyw == #classInstVars ifTrue:[ |
|
5532 |
parser tokenType == $[ ifFalse:[ |
|
5533 |
parser parseError:'classInstVars collection expected (eg. #instVars : [ ... ]' |
|
5534 |
]. |
|
5535 |
classInstVarNames := self readStringList |
|
5536 |
] ifFalse:[ |
|
5537 |
self halt. |
|
5538 |
]. |
|
5539 |
]. |
|
5540 |
]. |
|
5541 |
]. |
|
5542 |
]. |
|
5543 |
]. |
|
5544 |
]. |
|
5545 |
]. |
|
5546 |
]. |
|
5547 |
]. |
|
5548 |
parser token = ',' ifTrue:[ |
|
5549 |
parser nextToken |
|
5550 |
]. |
|
5551 |
]. |
|
5552 |
parser nextToken. |
|
5553 |
||
5554 |
what == #class ifTrue:[ |
|
5555 |
classDefChange := ClassDefinitionChange new. |
|
5556 |
classDefChange className:name. |
|
5557 |
classDefChange superClassName:superClassName. |
|
5558 |
"/ classDefChange instanceVariableString:(instVars asStringWith:' '). |
|
5559 |
classDefChange category:(category ? 'Pharo classes'). |
|
5560 |
||
5561 |
self addChange:classDefChange. |
|
5562 |
] ifFalse:[ |
|
5563 |
what == #trait ifTrue:[ |
|
5564 |
traitDefChange := TraitDefinitionChange new. |
|
5565 |
traitDefChange className:name. |
|
5566 |
traitDefChange category:(category ? 'Pharo traits'). |
|
5567 |
||
5568 |
self addChange:traitDefChange. |
|
5569 |
] ifFalse:[ |
|
5570 |
self halt. |
|
5571 |
]. |
|
5572 |
]. |
|
5573 |
||
5574 |
parser atEnd ifFalse:[ |
|
5575 |
self readMethods:what. |
|
5576 |
]. |
|
5577 |
||
5578 |
" |
|
5579 |
self fromGithubPharoSmalltalkStream: |
|
5580 |
'/Users/cg/Downloads/smalltalk/PharoJS-master/Pharo/PharoJsBridgeTest/PjBasicTest.class.st' |
|
5581 |
asFilename readStream |
|
5582 |
||
5583 |
self fromGithubPharoSmalltalkStream: |
|
5584 |
'/Users/cg/Downloads/smalltalk/PharoJS-master/Pharo/PharoJsCoreLibraries/PjStack.class.st' |
|
5585 |
asFilename readStream |
|
5586 |
" |
|
5587 |
||
5588 |
"/ |
|
5589 |
"/ "/ expect a subclass definition of the form: |
|
5590 |
"/ "/ <identifier> subclass: <identifier> |
|
5591 |
"/ classDefinition := parser keywordExpression. |
|
5592 |
"/ (classDefinition isMessage |
|
5593 |
"/ and:[ #( #'subclass:' ) includes:classDefinition selector ]) ifFalse:[ |
|
5594 |
"/ parser parseError:'class definition message expected (id subclass: id)' |
|
5595 |
"/ ]. |
|
5596 |
"/ classDefinition receiver isVariable ifFalse:[ |
|
5597 |
"/ parser parseError:'invalid superclass in class definition' |
|
5598 |
"/ ]. |
|
5599 |
"/ superClassName := classDefinition receiver name. |
|
5600 |
"/ |
|
5601 |
"/ "/ GNU uses plain name for the new class - we need a symbol |
|
5602 |
"/ classDefinition arg1 isVariable ifFalse:[ |
|
5603 |
"/ parser parseError:'invalid classname in class definition' |
|
5604 |
"/ ]. |
|
5605 |
"/ newClassName := classDefinition arg1 name. |
|
5606 |
"/ |
|
5607 |
"/ classDefinition arguments |
|
5608 |
"/ at:1 put:(ConstantNode value:classDefinition arg1 name asSymbol). |
|
5609 |
"/ |
|
5610 |
"/ parser tokenType == $[ ifFalse:[ |
|
5611 |
"/ parser parseError:'"[" expected (class definition)' |
|
5612 |
"/ ]. |
|
5613 |
"/ parser nextToken. |
|
5614 |
"/ |
|
5615 |
"/ [(parser tokenType == #BinaryOperator) and:[parser token = '<']] whileTrue:[ |
|
5616 |
"/ parser nextToken. |
|
5617 |
"/ k := parser token. |
|
5618 |
"/ ( #('category:' 'comment:') includes: k) ifTrue:[ |
|
5619 |
"/ parser nextToken. |
|
5620 |
"/ (parser tokenType == #String) ifTrue:[ |
|
5621 |
"/ k = 'category:' ifTrue:[ |
|
5622 |
"/ classCategory := parser token. |
|
5623 |
"/ ] ifFalse:[ |
|
5624 |
"/ classComment := parser token. |
|
5625 |
"/ ]. |
|
5626 |
"/ parser nextToken. |
|
5627 |
"/ (parser token = '>') ifFalse:[ |
|
5628 |
"/ parser parseError:'">" expected' |
|
5629 |
"/ ]. |
|
5630 |
"/ parser nextToken. |
|
5631 |
"/ ] ifFalse:[ |
|
5632 |
"/self halt. |
|
5633 |
"/ ]. |
|
5634 |
"/ ] ifFalse:[ |
|
5635 |
"/ self halt. |
|
5636 |
"/ ]. |
|
5637 |
"/ ]. |
|
5638 |
"/ |
|
5639 |
"/ instVars := OrderedCollection new. |
|
5640 |
"/ "/ instvar definition? |
|
5641 |
"/ parser tokenType == $| ifTrue:[ |
|
5642 |
"/ parser nextToken. |
|
5643 |
"/ [ parser tokenType == $| ] whileFalse:[ |
|
5644 |
"/ parser tokenType == #Identifier ifFalse:[ |
|
5645 |
"/ parser parseError:'identifier expected (in instvar list)'. |
|
5646 |
"/ ]. |
|
5647 |
"/ instVars add:parser token. |
|
5648 |
"/ parser nextToken. |
|
5649 |
"/ ]. |
|
5650 |
"/ parser nextToken. |
|
5651 |
"/ ]. |
|
5652 |
"/ |
|
5653 |
"/ self addChange:(ClassDefinitionChange new |
|
5654 |
"/ className:newClassName; |
|
5655 |
"/ superClassName:superClassName; |
|
5656 |
"/ instanceVariableString:(instVars asStringWith:' '); |
|
5657 |
"/ category:(classCategory ? 'GNU classes'); |
|
5658 |
"/ yourself). |
|
5659 |
"/ |
|
5660 |
"/ classComment notNil ifTrue:[ |
|
5661 |
"/ self addChange:(ClassCommentChange new |
|
5662 |
"/ className:newClassName; |
|
5663 |
"/ comment:classComment; |
|
5664 |
"/ yourself) |
|
5665 |
"/ ]. |
|
5666 |
"/ |
|
5667 |
"/ "/ methods |
|
5668 |
"/ [ parser tokenType == $] ] whileFalse:[ |
|
5669 |
"/ "/ must be |
|
5670 |
"/ "/ ( NewClassName | NewClassName "class" ) methodSpec |
|
5671 |
"/ "/ or |
|
5672 |
"/ "/ methodSpec |
|
5673 |
"/ methodClassName := newClassName. |
|
5674 |
"/ |
|
5675 |
"/ (parser tokenType == #Identifier |
|
5676 |
"/ and:[ parser token = newClassName ]) ifTrue:[ |
|
5677 |
"/ parser nextToken. |
|
5678 |
"/ (parser tokenType == #Identifier |
|
5679 |
"/ and:[ parser token = 'class' ]) ifTrue:[ |
|
5680 |
"/ parser nextToken. |
|
5681 |
"/ methodClassName := methodClassName,' class'. |
|
5682 |
"/ ]. |
|
5683 |
"/ "/ expect >> |
|
5684 |
"/ (parser tokenType == #BinaryOperator |
|
5685 |
"/ and:[parser token = '>>']) ifFalse:[ |
|
5686 |
"/ parser parseError:('">>" expected'). |
|
5687 |
"/ ]. |
|
5688 |
"/ parser nextToken. |
|
5689 |
"/ ]. |
|
5690 |
"/ |
|
5691 |
"/ methodSpecStartPos := parser tokenPosition. |
|
5692 |
"/ parser parseMethodSpec. |
|
5693 |
"/ methodSpecEndPos := parser tokenPosition-1. |
|
5694 |
"/ methodSpecSource := inputStream collection copyFrom:methodSpecStartPos to:methodSpecEndPos. |
|
5695 |
"/ |
|
5696 |
"/ parser tokenType == $[ ifFalse:[ |
|
5697 |
"/ parser parseError:'"[" expected (method definition)' |
|
5698 |
"/ ]. |
|
5699 |
"/ parser nextToken. |
|
5700 |
"/ |
|
5701 |
"/ methodStartPos := parser tokenPosition. |
|
5702 |
"/ parser parseMethodBody. |
|
5703 |
"/ methodEndPos := parser tokenPosition-1. |
|
5704 |
"/ methodSource := inputStream collection copyFrom:methodStartPos to:methodEndPos. |
|
5705 |
"/ |
|
5706 |
"/ parser tokenType == $] ifFalse:[ |
|
5707 |
"/ parser parseError:'"]" expected (method definition)' |
|
5708 |
"/ ]. |
|
5709 |
"/ parser nextToken. |
|
5710 |
"/ |
|
5711 |
"/ self addChange:(MethodDefinitionChange |
|
5712 |
"/ className:methodClassName |
|
5713 |
"/ selector:parser selector |
|
5714 |
"/ source:(methodSpecSource,Character cr,methodSource) |
|
5715 |
"/ category:'* uncategorized GNU *') |
|
5716 |
"/ ]. |
|
5717 |
"/ |
|
5718 |
"/"<<END |
|
5719 |
"/ |
|
5720 |
"/ ChangeSet fromGNUSmalltalkStream:' |
|
5721 |
"/Object subclass: Polynomial [ |
|
5722 |
"/ <category: ''Math''> |
|
5723 |
"/ |coeffs| |
|
5724 |
"/ Polynomial class >> new [ ^ super basicNew init ] |
|
5725 |
"/ init [ coeffs := OrderedCollection new. ^ self ] |
|
5726 |
"/ Polynomial class >> newWithCoefficients: coefficients [ |
|
5727 |
"/ |r| |
|
5728 |
"/ r := super basicNew. |
|
5729 |
"/ ^ r initWithCoefficients: coefficients |
|
5730 |
"/ ] |
|
5731 |
"/ initWithCoefficients: coefficients [ |
|
5732 |
"/ coeffs := coefficients asOrderedCollection. |
|
5733 |
"/ ^ self |
|
5734 |
"/ ] |
|
5735 |
"/ / denominator [ |n q| |
|
5736 |
"/ n := self deepCopy. |
|
5737 |
"/ self >= denominator |
|
5738 |
"/ ifTrue: [ |
|
5739 |
"/ q := Polynomial new. |
|
5740 |
"/ [ n >= denominator ] |
|
5741 |
"/ whileTrue: [ |piv| |
|
5742 |
"/ piv := (n coeff: 0) / (denominator coeff: 0). |
|
5743 |
"/ q addCoefficient: piv. |
|
5744 |
"/ n := n - (denominator * piv). |
|
5745 |
"/ n clean |
|
5746 |
"/ ]. |
|
5747 |
"/ ^ { q . (n degree) > 0 ifTrue: [ n ] ifFalse: [ n addCoefficient: 0. n ] } |
|
5748 |
"/ ] |
|
5749 |
"/ ifFalse: [ |
|
5750 |
"/ ^ { Polynomial newWithCoefficients: #( 0 ) . self deepCopy } |
|
5751 |
"/ ] |
|
5752 |
"/ ] |
|
5753 |
"/ * constant [ |r| r := self deepCopy. |
|
5754 |
"/ 1 to: (coeffs size) do: [ :i | |
|
5755 |
"/ r at: i put: ((r at: i) * constant) |
|
5756 |
"/ ]. |
|
5757 |
"/ ^ r |
|
5758 |
"/ ] |
|
5759 |
"/ at: index [ ^ coeffs at: index ] |
|
5760 |
"/ at: index put: obj [ ^ coeffs at: index put: obj ] |
|
5761 |
"/ >= anotherPoly [ |
|
5762 |
"/ ^ (self degree) >= (anotherPoly degree) |
|
5763 |
"/ ] |
|
5764 |
"/ degree [ ^ coeffs size ] |
|
5765 |
"/ - anotherPoly [ "This is not a real subtraction between Polynomial: it is an |
|
5766 |
"/ internal method ..." |
|
5767 |
"/ |a| |
|
5768 |
"/ a := self deepCopy. |
|
5769 |
"/ 1 to: ( (coeffs size) min: (anotherPoly degree) ) do: [ :i | |
|
5770 |
"/ a at: i put: ( (a at: i) - (anotherPoly at: i) ) |
|
5771 |
"/ ]. |
|
5772 |
"/ ^ a |
|
5773 |
"/ ] |
|
5774 |
"/ coeff: index [ ^ coeffs at: (index + 1) ] |
|
5775 |
"/ addCoefficient: coeff [ coeffs add: coeff ] |
|
5776 |
"/ clean [ |
|
5777 |
"/ [ (coeffs size) > 0 |
|
5778 |
"/ ifTrue: [ (coeffs at: 1) = 0 ] ifFalse: [ false ] ] |
|
5779 |
"/ whileTrue: [ coeffs removeFirst ]. |
|
5780 |
"/ ] |
|
5781 |
"/ display [ |
|
5782 |
"/ 1 to: (coeffs size) do: [ :i | |
|
5783 |
"/ (coeffs at: i) display. |
|
5784 |
"/ i < (coeffs size) |
|
5785 |
"/ ifTrue: [ (''x^%1 + '' % {(coeffs size) - i} ) display ] |
|
5786 |
"/ ] |
|
5787 |
"/ ] |
|
5788 |
"/ displayNl [ self display. Character nl display ] |
|
5789 |
"/].' readStream |
|
5790 |
"/ |
|
5791 |
"/END>>" |
|
5792 |
"/ |
|
5793 |
"/ "Created: / 10-02-2019 / 16:21:15 / Claus Gittinger" |
|
5794 |
"/ |
|
5795 |
||
5796 |
"Created: / 26-05-2019 / 01:24:29 / Claus Gittinger" |
|
5797 |
! |
|
5798 |
||
5799 |
readClassFile |
|
5800 |
parser nextToken. "/ skip over 'Class' |
|
5801 |
parser token == ${ ifFalse:[ |
|
5802 |
parser parseError:'"{" expected after Class keyword' |
|
5803 |
]. |
|
5804 |
self readClassDefinition:#class. |
|
5805 |
self assert:(parser atEnd). |
|
5806 |
||
5807 |
"Created: / 25-05-2019 / 22:58:09 / Claus Gittinger" |
|
5808 |
"Modified: / 26-05-2019 / 01:23:35 / Claus Gittinger" |
|
5809 |
! |
|
5810 |
||
5811 |
readClassOrExtensionFile |
|
5812 |
parser := Parser new. |
|
5813 |
||
5814 |
parser source:inputStream. |
|
5815 |
parser nextToken. |
|
5816 |
||
5817 |
"/ file starts with one of: |
|
5818 |
"/ Class { ... } |
|
5819 |
"/ Extension |
|
5820 |
parser token = 'Class' ifTrue:[ |
|
5821 |
self readClassFile. |
|
5822 |
^ self. |
|
5823 |
]. |
|
5824 |
parser token = 'Extension' ifTrue:[ |
|
5825 |
self readExtensionFile. |
|
5826 |
^ self. |
|
5827 |
]. |
|
5828 |
parser token = 'Package' ifTrue:[ |
|
5829 |
self readPackageFile. |
|
5830 |
^ self. |
|
5831 |
]. |
|
5832 |
parser token = 'Trait' ifTrue:[ |
|
5833 |
self readTraitFile. |
|
5834 |
^ self. |
|
5835 |
]. |
|
5836 |
self halt. |
|
5837 |
||
5838 |
"Created: / 25-05-2019 / 23:17:40 / Claus Gittinger" |
|
5839 |
"Modified: / 26-05-2019 / 01:24:50 / Claus Gittinger" |
|
5840 |
! |
|
5841 |
||
5842 |
readExtensionFile |
|
5843 |
|keyw className| |
|
5844 |
||
5845 |
parser nextToken. "/ skip over 'Extension' |
|
5846 |
parser expectToken:${. |
|
5847 |
parser tokenType == #Symbol ifFalse:[ |
|
5848 |
parser parseError:'"#name" expected after "Extension {"' |
|
5849 |
]. |
|
5850 |
keyw := parser token. |
|
5851 |
parser nextToken. "/ skip over keyword |
|
5852 |
parser expectToken:$:. |
|
5853 |
keyw == #name ifTrue:[ |
|
5854 |
parser tokenType == #Symbol ifFalse:[ |
|
5855 |
parser parseError:'classname expected after "#name :"' |
|
5856 |
]. |
|
5857 |
className := parser token. |
|
5858 |
parser nextToken. "/ skip over class name |
|
5859 |
] ifFalse:[ |
|
5860 |
self halt |
|
5861 |
]. |
|
5862 |
parser expectToken:$}. |
|
5863 |
||
5864 |
self readMethods:#class. |
|
5865 |
||
5866 |
"Created: / 25-05-2019 / 23:16:52 / Claus Gittinger" |
|
5867 |
"Modified: / 26-05-2019 / 01:29:47 / Claus Gittinger" |
|
5868 |
! |
|
5869 |
||
5870 |
readMethod:what |
|
5871 |
|keyw methodClassName category originalSource methodSource methodSourceStream s change| |
|
5872 |
||
5873 |
parser token == ${ ifTrue:[ |
|
5874 |
parser nextToken. "/ skip over '{' |
|
5875 |
(parser tokenType == #Symbol) ifFalse:[ |
|
5876 |
parser parseError:'keyword symbol expected after " {"' |
|
5877 |
]. |
|
5878 |
keyw := parser token. |
|
5879 |
||
5880 |
parser nextToken. "/ skip over keyword |
|
5881 |
parser expectToken:$:. |
|
5882 |
keyw == #category ifTrue:[ |
|
5883 |
parser tokenType == #Symbol ifFalse:[ |
|
5884 |
parser parseError:'classname expected after "#name :"' |
|
5885 |
]. |
|
5886 |
category := parser token. |
|
5887 |
parser nextToken. "/ skip over category name |
|
5888 |
] ifFalse:[ |
|
5889 |
self halt |
|
5890 |
]. |
|
5891 |
||
5892 |
parser expectToken:$}. |
|
5893 |
]. |
|
5894 |
||
5895 |
parser tokenType == #Identifier ifFalse:[ |
|
5896 |
parser parseError:'method class name expected' |
|
5897 |
]. |
|
5898 |
methodClassName := parser token. |
|
5899 |
parser nextToken. |
|
5900 |
||
5901 |
parser token = 'class' ifTrue:[ |
|
5902 |
self assert:(what == #class). |
|
5903 |
methodClassName := methodClassName,' class'. |
|
5904 |
parser nextToken. |
|
5905 |
] ifFalse:[ |
|
5906 |
parser token = 'classSide' ifTrue:[ |
|
5907 |
self assert:(what == #trait). |
|
5908 |
methodClassName := methodClassName,' class'. |
|
5909 |
parser nextToken. |
|
5910 |
]. |
|
5911 |
]. |
|
5912 |
||
5913 |
parser token = '>>' ifFalse:[ |
|
5914 |
parser parseError:'">>" expected after class name' |
|
5915 |
]. |
|
5916 |
||
5917 |
originalSource := parser sourceStream. |
|
5918 |
methodSourceStream := WriteStream on:(String new:20). |
|
5919 |
s := CollectingReadStream |
|
5920 |
on:originalSource |
|
4480 | 5921 |
collecting:[:each | methodSourceStream nextPut:each. each]. |
4428 | 5922 |
|
5923 |
parser setSource:s. |
|
5924 |
parser nextToken. |
|
5925 |
parser parseMethodSpec. |
|
5926 |
||
5927 |
"/ skip the last character in the collected source... |
|
5928 |
methodSourceStream skip:-1. |
|
5929 |
||
5930 |
parser token == $[ ifFalse:[ |
|
5931 |
parser parseError:'"[" expected after method spec' |
|
5932 |
]. |
|
5933 |
parser nextToken. |
|
5934 |
||
5935 |
parser parseMethodBody. |
|
5936 |
parser setSource:originalSource. |
|
5937 |
||
5938 |
"/ skip the last character in the collected source... |
|
5939 |
methodSourceStream skip:-1. |
|
5940 |
parser token == $] ifFalse:[ |
|
5941 |
parser parseError:'"]" expected after method' |
|
5942 |
]. |
|
5943 |
parser nextToken. |
|
5944 |
||
5945 |
methodSource := methodSourceStream contents. |
|
5946 |
||
5947 |
methodSource := methodSource withoutLeadingSeparators. |
|
5948 |
||
5949 |
change := MethodDefinitionChange |
|
5950 |
className:methodClassName |
|
5951 |
selector:parser selector |
|
5952 |
source:methodSource |
|
5953 |
category:category. |
|
5954 |
self addChange:change |
|
5955 |
||
5956 |
"Created: / 26-05-2019 / 01:29:00 / Claus Gittinger" |
|
5957 |
! |
|
5958 |
||
5959 |
readMethods:what |
|
5960 |
[ |
|
5961 |
self readMethod:what. |
|
5962 |
] doUntil:[ parser sourceStream atEnd ]. |
|
5963 |
||
5964 |
"Created: / 26-05-2019 / 01:29:11 / Claus Gittinger" |
|
5965 |
! |
|
5966 |
||
5967 |
readPackageFile |
|
5968 |
|keyw packageName| |
|
5969 |
||
5970 |
parser nextToken. "/ skip over 'Package' |
|
5971 |
parser expectToken:${. |
|
5972 |
||
5973 |
parser tokenType == #Symbol ifFalse:[ |
|
5974 |
parser parseError:'"#name" expected after "Extension {"' |
|
5975 |
]. |
|
5976 |
keyw := parser token. |
|
5977 |
parser nextToken. "/ skip over keyword |
|
5978 |
parser expectToken:$:. |
|
5979 |
||
5980 |
keyw == #name ifTrue:[ |
|
5981 |
parser tokenType == #Symbol ifFalse:[ |
|
5982 |
parser parseError:'classname expected after "#name :"' |
|
5983 |
]. |
|
5984 |
packageName := parser token. |
|
5985 |
parser nextToken. "/ skip over class name |
|
5986 |
] ifFalse:[ |
|
5987 |
self halt |
|
5988 |
]. |
|
5989 |
parser expectToken:$}. |
|
5990 |
||
5991 |
"Created: / 26-05-2019 / 00:18:30 / Claus Gittinger" |
|
5992 |
! |
|
5993 |
||
5994 |
readPools |
|
5995 |
"'pools' ':' '[' has been read. |
|
5996 |
read the pools list" |
|
5997 |
||
5998 |
^ self readStringList |
|
5999 |
||
6000 |
" |
|
6001 |
ChangeSet fromGithubPharoSmalltalkStream: |
|
6002 |
'/Users/cg/Downloads/smalltalk/PharoJS-master/Pharo/PharoJsCoreLibraries/PjStack.class.st' |
|
6003 |
asFilename readStream |
|
6004 |
" |
|
6005 |
||
6006 |
"Created: / 25-05-2019 / 23:11:52 / Claus Gittinger" |
|
6007 |
"Modified: / 26-05-2019 / 01:16:38 / Claus Gittinger" |
|
6008 |
! |
|
6009 |
||
6010 |
readStringList |
|
6011 |
"'[' has been read. |
|
6012 |
read a list of strings" |
|
6013 |
||
6014 |
|strings| |
|
6015 |
||
6016 |
self assert:(parser tokenType == $[). |
|
6017 |
||
6018 |
parser nextToken. "/ skip over initial "[" |
|
6019 |
||
6020 |
strings := OrderedCollection new. |
|
6021 |
||
6022 |
[parser token == $] ] whileFalse:[ |
|
6023 |
|keyw| |
|
6024 |
||
6025 |
parser tokenType == #String ifFalse:[ |
|
6026 |
parser parseError:'string expected' |
|
6027 |
]. |
|
6028 |
strings add:parser token. |
|
6029 |
parser nextToken. |
|
6030 |
parser token = ',' ifTrue:[ |
|
6031 |
parser nextToken. |
|
6032 |
]. |
|
6033 |
]. |
|
6034 |
parser nextToken. |
|
6035 |
^ strings |
|
6036 |
||
6037 |
" |
|
6038 |
ChangeSet fromGithubPharoSmalltalkStream: |
|
6039 |
'/Users/cg/Downloads/smalltalk/PharoJS-master/Pharo/PharoJsCoreLibraries/PjStack.class.st' |
|
6040 |
asFilename readStream |
|
6041 |
" |
|
6042 |
||
6043 |
"Created: / 26-05-2019 / 01:16:27 / Claus Gittinger" |
|
6044 |
! |
|
6045 |
||
6046 |
readTraitFile |
|
6047 |
parser nextToken. "/ skip over 'Class' |
|
6048 |
parser token == ${ ifFalse:[ |
|
6049 |
parser parseError:'"{" expected after Class keyword' |
|
6050 |
]. |
|
6051 |
self readClassDefinition:#trait. |
|
6052 |
self assert:(parser atEnd). |
|
6053 |
||
6054 |
"Created: / 26-05-2019 / 01:23:19 / Claus Gittinger" |
|
6055 |
! ! |
|
6056 |
||
6057 |
!ChangeSet::GithubPharoSmalltalkFileReader methodsFor:'reading'! |
|
6058 |
||
6059 |
changesFromStream:aStream for:changeSetArg do:changeActionArg |
|
6060 |
inputStream := aStream. |
|
6061 |
changeSet := changeSetArg. |
|
6062 |
changeAction := changeActionArg. |
|
6063 |
||
6064 |
self readClassOrExtensionFile. |
|
6065 |
^ changeSet |
|
6066 |
||
6067 |
"Created: / 10-02-2019 / 16:20:21 / Claus Gittinger" |
|
6068 |
"Modified: / 25-05-2019 / 23:17:46 / Claus Gittinger" |
|
6069 |
! ! |
|
6070 |
||
3576 | 6071 |
!ChangeSet::InvalidChangeChunkError class methodsFor:'queries'! |
6072 |
||
6073 |
mayProceed |
|
6074 |
^ true |
|
6075 |
! ! |
|
6076 |
||
1176 | 6077 |
!ChangeSet::SIFChangeFileReader methodsFor:'reading-private'! |
6078 |
||
6079 |
handleAnnotation |
|
6080 |
|key value lastChange change| |
|
6081 |
||
6082 |
key := (arguments at:1) evaluate. |
|
6083 |
value := (arguments at:2) evaluate. |
|
6084 |
||
1422 | 6085 |
key = 'Prerequisite' ifTrue:[ |
6086 |
"/ change := SIFPrerequisiteChange new prerequisiteFileName:value. |
|
6087 |
"/ self addChange:change. |
|
3839 | 6088 |
^ true |
1422 | 6089 |
]. |
6090 |
||
1176 | 6091 |
lastChange := changeSet last. |
6092 |
||
6093 |
key = 'package' ifTrue:[ |
|
3839 | 6094 |
change := ClassCategoryChange new className:(lastChange className) category:value. |
6095 |
self addChange:change. |
|
6096 |
^ true |
|
1176 | 6097 |
]. |
6098 |
key = 'category' ifTrue:[ |
|
6099 |
"/ change := MethodCategoryChange new className:(lastChange className) selector:(lastChange selector) category:value. |
|
6100 |
"/ self addChange:change. |
|
3839 | 6101 |
lastChange category:value. |
6102 |
^ true |
|
1176 | 6103 |
]. |
6104 |
key = 'stamp' ifTrue:[ |
|
3839 | 6105 |
"/ lastChange timeStamp:value. |
6106 |
^ true |
|
1176 | 6107 |
]. |
6108 |
^ false |
|
6109 |
! |
|
6110 |
||
6111 |
handleClassDefinitionChange |
|
6112 |
|nameSpace change| |
|
6113 |
||
6114 |
(self checkReceiverIsGlobalNamed:#Class) ifFalse:[ |
|
4325 | 6115 |
self proceedableError:'unexpected receiver in classDefinition message'. |
6116 |
^ false. |
|
1313 | 6117 |
]. |
1176 | 6118 |
className := (arguments at:1) evaluate. |
6119 |
||
6120 |
nameSpace := Class nameSpaceQuerySignal query. |
|
6121 |
nameSpace ~~ Smalltalk ifTrue:[ |
|
4325 | 6122 |
className := nameSpace name , '::' , className |
1176 | 6123 |
]. |
6124 |
||
6125 |
change := ClassDefinitionChange new. |
|
6126 |
change className:className; source:(parseTree printString). |
|
6127 |
||
6128 |
change package:(Class packageQuerySignal query). |
|
6129 |
self addChange:change. |
|
6130 |
^ true |
|
4325 | 6131 |
|
6132 |
"Modified: / 24-05-2018 / 14:54:45 / Claus Gittinger" |
|
1176 | 6133 |
! |
6134 |
||
6135 |
handleMethodChange:isMeta |
|
1188 | 6136 |
|categoryName methodSource change parser | |
1176 | 6137 |
|
6138 |
className := self receiversClassName. |
|
6139 |
isMeta ifTrue:[ |
|
3839 | 6140 |
className := className , ' class' |
1176 | 6141 |
]. |
6142 |
||
6143 |
categoryName := 'uncategorized'. |
|
6144 |
||
6145 |
inputStream skipSeparators. |
|
6146 |
lineNumber := inputStream lineNumber. |
|
3376 | 6147 |
position := inputStream position + 1. |
1176 | 6148 |
|
6149 |
methodSource := inputStream nextChunk. |
|
6150 |
||
6151 |
parser := Parser |
|
3839 | 6152 |
parseMethodArgAndVarSpecification:methodSource |
6153 |
in:nil |
|
6154 |
ignoreErrors:true |
|
6155 |
ignoreWarnings:true |
|
6156 |
parseBody:false. |
|
1176 | 6157 |
|
6158 |
parser isNil ifTrue:[ |
|
3839 | 6159 |
"/ something wierd ... |
6160 |
methodSelector := '????'. |
|
1176 | 6161 |
] ifFalse:[ |
3839 | 6162 |
methodSelector := parser selector. |
1176 | 6163 |
]. |
6164 |
||
3648 | 6165 |
change := MethodDefinitionChange new. |
3839 | 6166 |
change |
6167 |
className:className |
|
6168 |
selector:methodSelector |
|
6169 |
source:methodSource |
|
6170 |
category:categoryName |
|
6171 |
privacy:nil. |
|
1176 | 6172 |
|
6173 |
self addChange:change. |
|
6174 |
^ true |
|
6175 |
! |
|
6176 |
||
6177 |
processChange |
|
6178 |
"given a parse-tree (from parsing some changes source/chunk), |
|
6179 |
create changes and evaluate changeAction on each. |
|
6180 |
The block is invoked with the change and a lineNumberOrNil as |
|
3839 | 6181 |
arg; the lineNumber is only valid, if the underlying stream |
1176 | 6182 |
provides line-numbers; otherwise, nil is passed." |
6183 |
||
6184 |
(selector == #'interchangeVersion:') ifTrue:[ |
|
3839 | 6185 |
^ true |
1176 | 6186 |
]. |
6187 |
selector == #named:superclass:indexedInstanceVariables:instanceVariableNames:classVariableNames:sharedPools:classInstanceVariableNames: ifTrue:[ |
|
3839 | 6188 |
^ self handleClassDefinitionChange. |
1176 | 6189 |
]. |
6190 |
(selector == #'key:value:') ifTrue:[ |
|
3839 | 6191 |
(self checkReceiverIsGlobalNamed:'Annotation') ifTrue:[ |
6192 |
^ self handleAnnotation. |
|
6193 |
] |
|
1176 | 6194 |
]. |
6195 |
selector == #'method' ifTrue:[ |
|
3839 | 6196 |
^ self handleMethodChange:false. |
1176 | 6197 |
]. |
6198 |
selector == #'classMethod' ifTrue:[ |
|
3839 | 6199 |
^ self handleMethodChange:true. |
1176 | 6200 |
]. |
6201 |
||
6202 |
selector == #'initializer' ifTrue:[ |
|
3839 | 6203 |
^ true |
1176 | 6204 |
]. |
6205 |
selector == #'initialize' ifTrue:[ |
|
3839 | 6206 |
^ true |
1176 | 6207 |
]. |
6208 |
||
6209 |
^ false |
|
6210 |
||
6211 |
"Created: / 16.2.1998 / 13:42:40 / cg" |
|
6212 |
"Modified: / 15.12.1999 / 00:29:06 / cg" |
|
6213 |
! ! |
|
6214 |
||
625
06f4ed35832b
added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
378
diff
changeset
|
6215 |
!ChangeSet class methodsFor:'documentation'! |
100 | 6216 |
|
2868 | 6217 |
version |
3904 | 6218 |
^ '$Header$' |
2923 | 6219 |
! |
6220 |
||
6221 |
version_CVS |
|
3904 | 6222 |
^ '$Header$' |
3246 | 6223 |
! |
6224 |
||
6225 |
version_HG |
|
6226 |
||
3269 | 6227 |
^ '$Changeset: <not expanded> $' |
2868 | 6228 |
! |
6229 |
||
2881 | 6230 |
version_SVN |
3904 | 6231 |
^ '$Id$' |
100 | 6232 |
! ! |
3844 | 6233 |