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