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