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