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