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