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