author | Claus Gittinger <cg@exept.de> |
Mon, 03 Jun 2013 12:32:31 +0200 | |
changeset 878 | 57dcb488ff87 |
parent 839 | 73bbd675ef17 |
child 883 | 3b1947942911 |
permissions | -rw-r--r-- |
429 | 1 |
"{ Package: 'stx:goodies/monticello' }"! |
2 |
||
3 |
!Annotation class methodsFor:'instance creation'! |
|
395 | 4 |
|
5 |
mctimestamp: aString |
|
6 |
||
7 |
^MCTimestampAnnotation new timestamp: aString |
|
8 |
||
9 |
"Created: / 14-09-2010 / 15:35:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10 |
! ! |
|
11 |
||
429 | 12 |
!Behavior methodsFor:'*monticello-squeakCompatibility'! |
395 | 13 |
|
14 |
includesLocalSelector:aSymbol |
|
15 |
^ self localSelectors includes:aSymbol |
|
16 |
||
17 |
"Created: / 26-08-2009 / 11:50:00 / Jaroslav Havlin <havlij6@fel.cvut.cz>" |
|
18 |
! ! |
|
19 |
||
429 | 20 |
!Behavior methodsFor:'*monticello-squeakCompatibility'! |
395 | 21 |
|
22 |
localSelectors |
|
23 |
^ self methodDictionary collect:[:x | x selector asSymbol ] |
|
24 |
||
25 |
"Created: / 26-08-2009 / 11:53:47 / Jaroslav Havlin <havlij6@fel.cvut.cz>" |
|
26 |
! ! |
|
27 |
||
429 | 28 |
!Behavior methodsFor:'*monticello-squeakCompatibility'! |
395 | 29 |
|
30 |
traitCompositionString |
|
31 |
^ '{}' |
|
32 |
||
33 |
"Created: / 26-08-2009 / 12:43:23 / Jaroslav Havlin <havlij6@fel.cvut.cz>" |
|
34 |
! ! |
|
35 |
||
429 | 36 |
!Behavior methodsFor:'*monticello-squeakCompatibility'! |
150 | 37 |
|
38 |
typeOfClass |
|
395 | 39 |
"Answer a symbol uniquely describing the type of the receiver" |
40 |
"self instSpec = CompiledMethod instSpec ifTrue:[^#compiledMethod]." "Very special!!" |
|
41 |
self isBytes ifTrue:[^#bytes]. |
|
42 |
(self isWords and:[self isPointers not]) ifTrue:[^#words]. |
|
43 |
self isWeakPointers ifTrue:[^#weak]. |
|
44 |
self isVariable ifTrue:[^#variable]. |
|
45 |
^#normal. |
|
46 |
||
47 |
"Created: / 26-08-2009 / 12:45:50 / Jaroslav Havlin <havlij6@fel.cvut.cz>" |
|
48 |
! ! |
|
49 |
||
429 | 50 |
!Change methodsFor:'accessing'! |
395 | 51 |
|
52 |
mcDefinition |
|
53 |
||
54 |
^self objectAttributeAt: #mcDefinition |
|
55 |
||
56 |
"Created: / 08-11-2010 / 17:56:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
57 |
! ! |
|
58 |
||
429 | 59 |
!Change methodsFor:'accessing'! |
395 | 60 |
|
61 |
mcDefinition: aMCDefinition |
|
62 |
||
63 |
^self objectAttributeAt: #mcDefinition put: aMCDefinition |
|
64 |
||
65 |
"Created: / 08-11-2010 / 17:56:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
150 | 66 |
! ! |
136 | 67 |
|
436
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
68 |
!CharacterArray methodsFor:'*monticello-squeakCompatibility'! |
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
69 |
|
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
70 |
asStringWithNativeLineEndings |
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
71 |
|
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
72 |
^self copyReplaceAll:Character return with: Character cr |
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
73 |
|
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
74 |
"Created: / 12-09-2010 / 16:00:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
75 |
"Modified: / 13-10-2010 / 17:27:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
76 |
! ! |
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
77 |
|
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
78 |
!CharacterArray methodsFor:'*monticello-squeakCompatibility'! |
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
79 |
|
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
80 |
asStringWithSqueakLineEndings |
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
81 |
|
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
82 |
^self copyReplaceAll:Character cr with: Character return |
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
83 |
|
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
84 |
"Created: / 12-09-2010 / 16:00:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
85 |
"Modified: / 13-10-2010 / 17:28:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
86 |
! ! |
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
87 |
|
429 | 88 |
!Class methodsFor:'*monticello'! |
136 | 89 |
|
90 |
asClassDefinition |
|
395 | 91 |
^ MCClassDefinition |
92 |
name: self name |
|
736
43645227af41
care for nil superclass in Class >> asClassDefinition
Claus Gittinger <cg@exept.de>
parents:
732
diff
changeset
|
93 |
superclassName: (self superclass isNil ifTrue:['nil'] ifFalse:[self superclass name]) |
395 | 94 |
traitComposition: self traitCompositionString |
95 |
classTraitComposition: self class traitCompositionString |
|
96 |
category: self category |
|
97 |
instVarNames: self instVarNames |
|
98 |
classVarNames: self classVarNames |
|
99 |
poolDictionaryNames: self poolDictionaryNames |
|
100 |
classInstVarNames: self class instVarNames |
|
101 |
type: self typeOfClass |
|
102 |
comment: (self organization classComment ? '') asStringWithSqueakLineEndings |
|
103 |
commentStamp: self organization commentStamp |
|
104 |
||
105 |
"Modified: / 12-09-2010 / 17:19:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
136 | 106 |
! ! |
107 |
||
429 | 108 |
!Class methodsFor:'*monticello'! |
136 | 109 |
|
110 |
classDefinitions |
|
111 |
^ Array with: self asClassDefinition |
|
112 |
! ! |
|
113 |
||
429 | 114 |
!Class methodsFor:'*monticello'! |
136 | 115 |
|
116 |
poolDictionaryNames |
|
160 | 117 |
^ self sharedPools "/ collect: [:ea | ea name "self environment keyAtIdentityValue: ea"] |
136 | 118 |
! ! |
119 |
||
429 | 120 |
!ClassDescription methodsFor:'*monticello-squeakCompatibility'! |
395 | 121 |
|
122 |
mcDefinition |
|
123 |
||
124 |
|s| |
|
125 |
||
126 |
s := WriteStream on:(String new). |
|
127 |
self |
|
128 |
basicFileOutDefinitionOn:s |
|
129 |
withNameSpace:false |
|
130 |
withPackage:false. |
|
131 |
s position: s position - 1. |
|
132 |
||
133 |
^ s contents |
|
134 |
||
135 |
"Created: / 11-09-2010 / 18:06:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
136 |
! ! |
|
137 |
||
429 | 138 |
!Object methodsFor:'*monticello'! |
136 | 139 |
|
140 |
isConflict |
|
141 |
^false |
|
142 |
! ! |
|
143 |
||
839
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
144 |
!PackageInfo methodsFor:'testing'! |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
145 |
|
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
146 |
isMCStXPackageInfo |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
147 |
^ false |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
148 |
|
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
149 |
"Created: / 29-05-2013 / 01:08:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
150 |
! ! |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
151 |
|
429 | 152 |
!ProjectDefinition class methodsFor:'code generation'! |
395 | 153 |
|
452
cbc2f85f11f8
fixes for remembering Monticello metadata
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
437
diff
changeset
|
154 |
monticelloAncestry_code |
cbc2f85f11f8
fixes for remembering Monticello metadata
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
437
diff
changeset
|
155 |
|
459
cae7224c4ab3
fixes for remembering Monticello metadata
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
452
diff
changeset
|
156 |
^'#()' |
452
cbc2f85f11f8
fixes for remembering Monticello metadata
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
437
diff
changeset
|
157 |
|
cbc2f85f11f8
fixes for remembering Monticello metadata
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
437
diff
changeset
|
158 |
"Created: / 25-08-2011 / 16:49:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
cbc2f85f11f8
fixes for remembering Monticello metadata
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
437
diff
changeset
|
159 |
! ! |
cbc2f85f11f8
fixes for remembering Monticello metadata
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
437
diff
changeset
|
160 |
|
839
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
161 |
!ProjectDefinition class methodsFor:'accessing - monticello'! |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
162 |
|
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
163 |
monticelloName |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
164 |
"Return name of the package for Monticello. |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
165 |
|
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
166 |
Historically, Monticello package membership is based on |
878 | 167 |
naming conventions. All classes whose category name starts with |
168 |
package name are considerer as belonging to the package, others |
|
169 |
do not. If classes' category does not match this naming convention, |
|
170 |
the package will fail to load back properly. |
|
839
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
171 |
|
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
172 |
Here, infer such prefix. Individual packages may override this method |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
173 |
and return a string to enforce a particular name." |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
174 |
|
878 | 175 |
| cats longest prefix index nm | |
839
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
176 |
|
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
177 |
cats := (self classes collect:[:each | each category ]) asSet. |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
178 |
cats remove:#'* Projects & Packages *'. |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
179 |
cats size == 1 ifTrue:[ |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
180 |
^ cats anElement |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
181 |
]. |
878 | 182 |
cats isEmpty ifTrue:[ |
183 |
^ 'Misc_Changes' |
|
184 |
]. |
|
839
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
185 |
longest := cats inject:cats anElement |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
186 |
into:[:cat :each | |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
187 |
each size > cat size ifTrue:[ |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
188 |
each |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
189 |
] ifFalse:[ cat ] |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
190 |
]. |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
191 |
prefix := ''. |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
192 |
[ |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
193 |
(index := longest indexOf:$- startingAt:prefix size + 2) ~~ 0 |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
194 |
] whileTrue:[ |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
195 |
prefix := longest copyTo:index - 1. |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
196 |
(cats allSatisfy:[:each | each startsWith:prefix ]) ifTrue:[ |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
197 |
nm := prefix. |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
198 |
]. |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
199 |
]. |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
200 |
nm notNil ifTrue:[ |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
201 |
^ nm |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
202 |
]. |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
203 |
self |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
204 |
error:'Cannot infer Monticello package name from class categories. Please define #mcName explicitly' |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
205 |
|
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
206 |
"Created: / 29-05-2013 / 01:36:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
207 |
! ! |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
208 |
|
452
cbc2f85f11f8
fixes for remembering Monticello metadata
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
437
diff
changeset
|
209 |
!ProjectDefinition class methodsFor:'code generation'! |
cbc2f85f11f8
fixes for remembering Monticello metadata
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
437
diff
changeset
|
210 |
|
395 | 211 |
monticelloTimestamps_code |
212 |
||
213 |
| methodsWithTimestamp | |
|
214 |
methodsWithTimestamp := OrderedCollection new. |
|
215 |
||
216 |
self classes do:[:cls| |
|
217 |
cls methodsDo:[:mthd| |
|
218 |
(mthd hasAnnotation: #mctimestamp:) ifTrue:[ |
|
219 |
methodsWithTimestamp add: mthd |
|
220 |
] |
|
221 |
]. |
|
222 |
]. |
|
223 |
self extensionMethods do:[:mthd| |
|
224 |
(mthd hasAnnotation: #mctimestamp:) ifTrue:[ |
|
225 |
methodsWithTimestamp add: mthd |
|
226 |
] |
|
227 |
]. |
|
228 |
||
229 |
^self monticelloTimestamps_codeFor: methodsWithTimestamp |
|
230 |
||
231 |
" |
|
232 |
stx_goodies_mondrian_core monticelloTimestamps_code |
|
233 |
" |
|
234 |
||
235 |
"Created: / 09-11-2010 / 18:23:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
236 |
! ! |
|
237 |
||
429 | 238 |
!ProjectDefinition class methodsFor:'code generation'! |
395 | 239 |
|
240 |
monticelloTimestamps_codeFor: methods |
|
241 |
||
242 |
| code | |
|
243 |
code := String new writeStream. |
|
244 |
code nextPutAll:'monticelloTimestamps |
|
245 |
||
246 |
^#('. |
|
247 |
methods do:[:mthd| |
|
248 |
code |
|
249 |
tab; tab; |
|
250 |
nextPut:$(; |
|
251 |
nextPutAll: mthd mclass fullName; |
|
252 |
space; |
|
253 |
nextPutAll: mthd selector; |
|
254 |
space; |
|
255 |
nextPutAll: (mthd annotationAt: #mctimestamp:) timestamp storeString; |
|
256 |
nextPut:$); |
|
257 |
cr. |
|
258 |
]. |
|
259 |
code nextPutAll:' |
|
260 |
)'. |
|
261 |
||
262 |
^code contents |
|
263 |
||
264 |
" |
|
265 |
stx_goodies_mondrian_core mcTimestamps_code |
|
266 |
" |
|
267 |
||
268 |
"Created: / 09-11-2010 / 18:27:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
269 |
! ! |
|
270 |
||
429 | 271 |
!SequenceableCollection methodsFor:'*monticello-squeakCompatibility'! |
395 | 272 |
|
273 |
copyReplaceAll: oldSubstring with: newSubstring asTokens: ifTokens |
|
274 |
"Answer a copy of the receiver in which all occurrences of |
|
275 |
oldSubstring have been replaced by newSubstring. |
|
276 |
ifTokens (valid for Strings only) specifies that the characters |
|
277 |
surrounding the recplacement must not be alphanumeric. |
|
278 |
Bruce Simth, must be incremented by 1 and not |
|
279 |
newSubstring if ifTokens is true. See example below. " |
|
280 |
||
281 |
| aString startSearch currentIndex endIndex | |
|
282 |
(ifTokens and: [(self isString) not]) |
|
283 |
ifTrue: [(self isKindOf: Text) ifFalse: [ |
|
284 |
self error: 'Token replacement only valid for Strings']]. |
|
285 |
aString := self. |
|
286 |
startSearch := 1. |
|
287 |
[(currentIndex := aString indexOfSubCollection: oldSubstring startingAt: startSearch) |
|
288 |
> 0] |
|
289 |
whileTrue: |
|
290 |
[endIndex := currentIndex + oldSubstring size - 1. |
|
291 |
(ifTokens not |
|
292 |
or: [(currentIndex = 1 |
|
293 |
or: [(aString at: currentIndex-1) isAlphaNumeric not]) |
|
294 |
and: [endIndex = aString size |
|
295 |
or: [(aString at: endIndex+1) isAlphaNumeric not]]]) |
|
296 |
ifTrue: [aString := aString |
|
297 |
copyReplaceFrom: currentIndex |
|
298 |
to: endIndex |
|
299 |
with: newSubstring. |
|
300 |
startSearch := currentIndex + newSubstring size] |
|
301 |
ifFalse: [ |
|
302 |
ifTokens |
|
303 |
ifTrue: [startSearch := currentIndex + 1] |
|
304 |
ifFalse: [startSearch := currentIndex + newSubstring size]]]. |
|
305 |
^ aString |
|
306 |
||
307 |
"Test case: |
|
308 |
'test te string' copyReplaceAll: 'te' with: 'longone' asTokens: true " |
|
309 |
||
310 |
"Created: / 26-08-2009 / 12:40:34 / Jaroslav Havlin <havlij6@fel.cvut.cz>" |
|
311 |
! ! |
|
312 |
||
429 | 313 |
!Stream methodsFor:'*monticello'! |
136 | 314 |
|
315 |
isMessageStream |
|
316 |
^ false |
|
317 |
! ! |
|
318 |
||
429 | 319 |
!String methodsFor:'*monticello'! |
136 | 320 |
|
321 |
extractNumber |
|
322 |
^ ('0', self select: [:ea | ea isDigit]) asNumber |
|
323 |
! ! |
|
324 |
||
429 | 325 |
!String methodsFor:'*monticello-squeakCompatibility'! |
395 | 326 |
|
327 |
withSqueakLineEndings |
|
328 |
"Answer a copy of myself in which all sequences of <CR><LF> or <LF> have been changed to <CR>" |
|
329 |
| newText | |
|
330 |
(self includes: Character lf) ifFalse: [ ^self copy ]. |
|
331 |
newText := self copyReplaceAll: String crlf with: String cr. |
|
332 |
(newText asString includes: Character lf) ifFalse: [ ^newText ]. |
|
333 |
^newText copyReplaceAll: String lf with: String cr asTokens: false. |
|
334 |
||
335 |
"Created: / 26-08-2009 / 11:35:56 / Jaroslav Havlin <havlij6@fel.cvut.cz>" |
|
336 |
! ! |
|
337 |
||
429 | 338 |
!StringCollection methodsFor:'converting'! |
395 | 339 |
|
340 |
asStringWithNativeLineEndings |
|
341 |
||
342 |
^self asString |
|
343 |
||
344 |
"Created: / 12-09-2010 / 15:58:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
345 |
! ! |
|
346 |
||
429 | 347 |
!StringCollection methodsFor:'converting'! |
395 | 348 |
|
349 |
asStringWithSqueakLineEndings |
|
350 |
||
351 |
^ self |
|
352 |
asStringWith:Character return |
|
353 |
from:1 to:(self size) |
|
354 |
compressTabs:false |
|
355 |
final:nil |
|
356 |
||
357 |
"Created: / 12-09-2010 / 15:58:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
358 |
! ! |
|
359 |
||
429 | 360 |
!Symbol methodsFor:'*monticello-squeakCompatibility'! |
395 | 361 |
|
362 |
isDoIt |
|
363 |
^ (self == #DoIt) or:[ self == #DoItIn: ]. |
|
364 |
||
365 |
"Created: / 26-08-2009 / 11:46:44 / Jaroslav Havlin <havlij6@fel.cvut.cz>" |
|
366 |
! ! |
|
367 |
||
429 | 368 |
!Timestamp class methodsFor:'*monticello-instance creation'! |
395 | 369 |
|
370 |
fromMethodTimeStamp: aString |
|
371 |
| stream | |
|
372 |
stream := ReadStream on: aString. |
|
373 |
stream skipSeparators. |
|
374 |
stream skipTo: Character space. |
|
375 |
^self readFrom: stream. |
|
376 |
! ! |
|
377 |
||
429 | 378 |
!Tools::NewSystemBrowser methodsFor:'menu actions-monticello'! |
395 | 379 |
|
380 |
projectMenuMonticelloCommit |
|
736
43645227af41
care for nil superclass in Class >> asClassDefinition
Claus Gittinger <cg@exept.de>
parents:
732
diff
changeset
|
381 |
| packageName package workingCopy | |
395 | 382 |
|
383 |
packageName := self theSingleSelectedProject. |
|
736
43645227af41
care for nil superclass in Class >> asClassDefinition
Claus Gittinger <cg@exept.de>
parents:
732
diff
changeset
|
384 |
packageName isNil ifTrue:[ |
43645227af41
care for nil superclass in Class >> asClassDefinition
Claus Gittinger <cg@exept.de>
parents:
732
diff
changeset
|
385 |
Dialog information:'Please select a single project'. |
43645227af41
care for nil superclass in Class >> asClassDefinition
Claus Gittinger <cg@exept.de>
parents:
732
diff
changeset
|
386 |
^ self. |
43645227af41
care for nil superclass in Class >> asClassDefinition
Claus Gittinger <cg@exept.de>
parents:
732
diff
changeset
|
387 |
]. |
43645227af41
care for nil superclass in Class >> asClassDefinition
Claus Gittinger <cg@exept.de>
parents:
732
diff
changeset
|
388 |
|
786
8c0dffd42eb8
class: Tools::NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
389 |
SourceCodeManagerUtilities basicNew |
8c0dffd42eb8
class: Tools::NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
390 |
validateConsistencyOfPackage:packageName |
8c0dffd42eb8
class: Tools::NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
391 |
doClasses:true |
8c0dffd42eb8
class: Tools::NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
392 |
doExtensions:true. |
8c0dffd42eb8
class: Tools::NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
393 |
|
395 | 394 |
package := MCPackage named: packageName. |
395 |
workingCopy := package workingCopy. |
|
396 |
MCCommitDialog new |
|
397 |
workingCopy: workingCopy; |
|
398 |
open |
|
399 |
||
400 |
"Created: / 14-09-2010 / 22:54:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
401 |
! ! |
|
402 |
||
736
43645227af41
care for nil superclass in Class >> asClassDefinition
Claus Gittinger <cg@exept.de>
parents:
732
diff
changeset
|
403 |
!UndefinedObject methodsFor:'* monticello'! |
150 | 404 |
|
405 |
typeOfClass |
|
406 |
"Necessary to support disjoint class hierarchies." |
|
407 |
||
408 |
^#normal |
|
409 |
! ! |
|
410 |
||
554 | 411 |
!UserPreferences methodsFor:'accessing-scm-monticello'! |
395 | 412 |
|
413 |
mcEnabled |
|
554 | 414 |
"/ needed for MCSettingsApp |
395 | 415 |
|
416 |
^self at: #mcEnabled ifAbsent: [true]. |
|
417 |
||
418 |
"Created: / 16-09-2010 / 09:44:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
419 |
"Modified: / 16-09-2010 / 14:50:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
554 | 420 |
"Modified (comment): / 15-01-2012 / 14:12:53 / cg" |
395 | 421 |
! ! |
422 |
||
554 | 423 |
!UserPreferences methodsFor:'accessing-scm-monticello'! |
395 | 424 |
|
425 |
mcEnabled: aBoolean |
|
554 | 426 |
"/ needed for MCSettingsApp |
395 | 427 |
|
428 |
self at: #mcEnabled put: aBoolean. |
|
429 |
||
430 |
"Created: / 16-09-2010 / 09:44:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
571 | 431 |
"Modified: / 27-08-2012 / 11:54:43 / cg" |
395 | 432 |
! ! |
433 |
||
554 | 434 |
!UserPreferences methodsFor:'accessing-scm-monticello'! |
395 | 435 |
|
436 |
mcRepositories |
|
562
d48401867000
Fixes in preferences reading/storing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
554
diff
changeset
|
437 |
"Returns a list of MCRepository as in LITERAL ARRAY ENCODING" |
395 | 438 |
|
562
d48401867000
Fixes in preferences reading/storing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
554
diff
changeset
|
439 |
^self at: #mcRepositories ifAbsent:[#(Array)]. |
395 | 440 |
|
441 |
" |
|
562
d48401867000
Fixes in preferences reading/storing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
554
diff
changeset
|
442 |
UserPreferences current mcRepositories |
d48401867000
Fixes in preferences reading/storing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
554
diff
changeset
|
443 |
UserPreferences current mcRepositories: #(Array) |
395 | 444 |
" |
445 |
||
446 |
"Created: / 16-09-2010 / 09:47:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
562
d48401867000
Fixes in preferences reading/storing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
554
diff
changeset
|
447 |
"Modified (comment): / 04-04-2012 / 11:08:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
395 | 448 |
! ! |
449 |
||
571 | 450 |
!UserPreferences methodsFor:'accessing-scm-monticello'! |
451 |
||
452 |
mcRepositories: aCollection |
|
453 |
"/ needed for MCSettingsApp |
|
454 |
||
455 |
self at: #mcRepositories put: aCollection. |
|
456 |
||
457 |
"Created: / 27-08-2012 / 11:54:34 / cg" |
|
458 |
! ! |
|
459 |
||
429 | 460 |
!VersionInfo methodsFor:'accessing'! |
395 | 461 |
|
462 |
timeStamp |
|
463 |
||
464 |
^Timestamp |
|
465 |
fromDate: (Date fromString: date) |
|
466 |
andTime: (Time fromString: time) |
|
467 |
||
468 |
"Created: / 09-09-2010 / 15:20:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
469 |
! ! |
|
470 |
||
429 | 471 |
!stx_goodies_monticello class methodsFor:'documentation'! |
182 | 472 |
|
473 |
extensionsVersion_CVS |
|
878 | 474 |
^ '$Header: /cvs/stx/stx/goodies/monticello/extensions.st,v 1.22 2013-06-03 10:32:31 cg Exp $' |
786
8c0dffd42eb8
class: Tools::NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
475 |
! ! |