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