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