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