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