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