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