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