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