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