author | Stefan Vogel <sv@exept.de> |
Tue, 06 Aug 2013 13:29:32 +0200 | |
changeset 3367 | dc9d785a4ca7 |
parent 3362 | 0ede9d87d347 |
child 3373 | ef0f9ee70942 |
child 3400 | 97f0b44adc03 |
permissions | -rw-r--r-- |
2848 | 1 |
" |
2 |
COPYRIGHT (c) 2012 eXept Software AG |
|
3 |
All Rights Reserved |
|
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 |
" |
|
12 |
"{ Package: 'stx:libbasic3' }" |
|
13 |
||
14 |
SourceCodeManagerUtilities subclass:#SourceCodeManagerUtilitiesForContainerBasedManagers |
|
15 |
instanceVariableNames:'' |
|
16 |
classVariableNames:'' |
|
17 |
poolDictionaries:'' |
|
18 |
category:'System-SourceCodeManagement' |
|
19 |
! |
|
20 |
||
21 |
!SourceCodeManagerUtilitiesForContainerBasedManagers class methodsFor:'documentation'! |
|
22 |
||
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 2012 eXept Software AG |
|
26 |
All Rights Reserved |
|
27 |
||
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
! ! |
|
36 |
||
37 |
!SourceCodeManagerUtilitiesForContainerBasedManagers methodsFor:'utilities-cvs'! |
|
38 |
||
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
39 |
checkinBuildSupportFilesForPackage:packageID withInfo:checkinInfo |
2848 | 40 |
|anyFailure module directory mgr defClass | |
41 |
||
42 |
mgr := self sourceCodeManagerFor: packageID. |
|
43 |
defClass := ProjectDefinition definitionClassForPackage: packageID. |
|
44 |
||
3141
25cd1cd26450
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3133
diff
changeset
|
45 |
"/ already done elsewhere now |
25cd1cd26450
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3133
diff
changeset
|
46 |
"/ defClass validateDescription. |
2848 | 47 |
|
48 |
anyFailure := false. |
|
49 |
||
50 |
module := packageID asPackageId module. |
|
51 |
directory := packageID asPackageId directory. |
|
52 |
||
53 |
self activityNotification:(resources string:'checking in build-support files...'). |
|
54 |
(mgr checkForExistingModule:module directory:directory) ifFalse:[ |
|
55 |
mgr createModule:module directory:directory |
|
56 |
]. |
|
57 |
||
58 |
defClass forEachFileNameAndGeneratedContentsDo:[:fileName :fileContents | |
|
59 |
|realFileName realDirectory| |
|
60 |
||
61 |
"/ care for subdirectories |
|
62 |
(fileName includes:$/) ifTrue:[ |
|
63 |
realDirectory := (directory asFilename construct:(fileName asFilename directoryName)) name. |
|
64 |
realFileName := fileName asFilename baseName. |
|
65 |
] ifFalse:[ |
|
66 |
realDirectory := directory. |
|
67 |
realFileName := fileName. |
|
68 |
]. |
|
69 |
realDirectory := realDirectory replaceAll:$\ with:$/. |
|
70 |
||
71 |
self activityNotification:(resources string:'checking in %1...' with:realFileName). |
|
72 |
||
73 |
UserInformation |
|
74 |
handle:[:ex | Transcript showCR:ex description ] |
|
75 |
do:[ |
|
76 |
(mgr isContainerBased |
|
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
77 |
and:[(mgr checkForExistingContainer:realFileName inModule:module directory:realDirectory) not] |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
78 |
) ifTrue:[ |
2848 | 79 |
realDirectory ~= directory ifTrue:[ |
80 |
(mgr checkForExistingModule:module directory:realDirectory) ifFalse:[ |
|
81 |
mgr createModule:module directory:realDirectory |
|
82 |
]. |
|
83 |
]. |
|
84 |
(mgr |
|
85 |
createContainerForText:fileContents |
|
86 |
inModule:module |
|
87 |
package:realDirectory |
|
88 |
container:realFileName) |
|
89 |
ifFalse:[ |
|
3262
06320fb6453a
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3250
diff
changeset
|
90 |
(Dialog |
06320fb6453a
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3250
diff
changeset
|
91 |
confirm:(resources |
06320fb6453a
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3250
diff
changeset
|
92 |
stringWithCRs:'Cannot create new container: ''%3'' (in %1:%2).\\Proceed?' |
2848 | 93 |
with:module |
94 |
with:realDirectory |
|
95 |
with:realFileName) |
|
3262
06320fb6453a
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3250
diff
changeset
|
96 |
noLabel:'Cancel') |
06320fb6453a
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3250
diff
changeset
|
97 |
ifFalse:[ |
06320fb6453a
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3250
diff
changeset
|
98 |
AbortOperationRequest raise |
06320fb6453a
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3250
diff
changeset
|
99 |
] |
2848 | 100 |
]. |
101 |
] ifFalse:[ |
|
102 |
(mgr |
|
103 |
checkin:realFileName |
|
104 |
text:fileContents |
|
105 |
directory:realDirectory |
|
106 |
module:module |
|
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
107 |
logMessage:checkinInfo logMessage |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
108 |
force:false |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
109 |
) ifTrue:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
110 |
checkinInfo isStable ifTrue:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
111 |
self tagPath:(module, '/', realDirectory, '/', realFileName) as:#stable usingManager:mgr. |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
112 |
]. |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
113 |
checkinInfo tagIt ifTrue:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
114 |
self tagPath:(module, '/', realDirectory, '/', realFileName) as:checkinInfo tag usingManager:mgr. |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
115 |
]. |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
116 |
] ifFalse:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
117 |
Transcript showCR:'checkin of ' , realFileName , ' failed'. |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
118 |
anyFailure := true. |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
119 |
]. |
2848 | 120 |
]. |
121 |
]. |
|
122 |
]. |
|
123 |
||
124 |
defClass instAndClassMethodsDo:[:m | m package:defClass package]. |
|
125 |
||
126 |
self |
|
127 |
checkinClasses:(Array with:defClass) |
|
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
128 |
withInfo:checkinInfo |
2848 | 129 |
withCheck:false. |
130 |
||
131 |
||
132 |
self activityNotification:nil. |
|
133 |
||
134 |
anyFailure ifTrue:[ |
|
135 |
self warn:'Checkin failed - see Transcript.'. |
|
136 |
self activityNotification:'Checkin of build-support files failed - see Transcript.'. |
|
137 |
] ifFalse:[ |
|
138 |
self activityNotification:'Build-support files checked into the repository.'. |
|
139 |
]. |
|
140 |
||
141 |
"Created: / 09-08-2006 / 18:59:42 / fm" |
|
142 |
"Modified: / 12-10-2011 / 11:36:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
143 |
"Modified: / 25-07-2012 / 14:27:30 / cg" |
|
144 |
"Modified (format): / 25-07-2012 / 22:25:48 / cg" |
|
145 |
! |
|
146 |
||
147 |
checkinClass:aClass |
|
148 |
"check a class into the source repository. |
|
149 |
Asks interactively for a log-message." |
|
150 |
||
151 |
^ self checkinClass:aClass withInfo:nil |
|
152 |
! |
|
153 |
||
154 |
checkinClass:aClass withInfo:aLogInfoOrNil |
|
155 |
"check a class into the source repository. |
|
156 |
If the argument, aLogInfoOrNil isNil, ask interactively for a log-message." |
|
157 |
||
158 |
^ self checkinClass:aClass withInfo:aLogInfoOrNil withCheck:true |
|
159 |
! |
|
160 |
||
161 |
checkinClass:aClass withInfo:aLogInfoOrNil withCheck:doCheckClass |
|
162 |
"check a class into the source repository. |
|
163 |
If the argument, aLogInfoOrNil isNil, ask interactively for log-message. |
|
164 |
If doCheckClass is true, the class is checked for send of halts etc." |
|
165 |
||
166 |
^ self |
|
167 |
checkinClass:aClass |
|
168 |
withInfo:aLogInfoOrNil |
|
169 |
withCheck:doCheckClass |
|
170 |
usingManager:(self sourceCodeManagerFor:aClass) |
|
171 |
||
172 |
"Modified: / 21-12-2011 / 18:19:55 / cg" |
|
173 |
! |
|
174 |
||
175 |
checkinClass:aClass withInfo:aLogInfoOrNil withCheck:doCheckClass usingManager:managerOrNil |
|
176 |
"check a class into the source repository. |
|
177 |
If the argument, aLogInfoOrNil isNil, ask interactively for log-message. |
|
178 |
If doCheckClass is true, the class is checked for send of halts etc." |
|
179 |
||
2946 | 180 |
|logMessage checkinInfo mgr pri| |
2848 | 181 |
|
182 |
aClass isLoaded ifFalse:[ |
|
183 |
self information:(resources string:'Cannot checkin unloaded classes (%1)' with:aClass name). |
|
184 |
^ false. |
|
185 |
]. |
|
186 |
||
187 |
mgr := managerOrNil. |
|
188 |
mgr isNil ifTrue:[ |
|
189 |
mgr := self sourceCodeManagerFor:aClass. |
|
190 |
mgr isNil ifTrue:[ |
|
191 |
^ false |
|
192 |
] |
|
193 |
]. |
|
194 |
||
195 |
self ensureCorrectVersionMethodsInClass:aClass usingManager:mgr. |
|
196 |
mgr supportsCheckinLogMessages ifTrue:[ |
|
197 |
(self |
|
198 |
getLogMessageForClassCheckinTakingDefaultsFromPreviousLogInfo:aLogInfoOrNil |
|
199 |
forClass:aClass |
|
200 |
valuesInto:[:logMessageRet :checkinInfoRet | |
|
201 |
logMessage := logMessageRet. |
|
202 |
checkinInfo := checkinInfoRet. |
|
203 |
] |
|
204 |
) ifFalse:[^ false]. |
|
205 |
]. |
|
206 |
||
207 |
(self classIsNotYetInRepository:aClass withManager:mgr) ifTrue:[ |
|
208 |
(self createSourceContainerForClass:aClass usingManager:mgr) ifFalse:[ |
|
209 |
"/ self warn:'did not create a container for ''' , aClass name , ''''. |
|
210 |
^ false |
|
211 |
]. |
|
212 |
^ true. |
|
213 |
]. |
|
214 |
||
215 |
self activityNotification:(resources string:'checking in %1' with:aClass name). |
|
216 |
pri := Processor activePriority. |
|
217 |
Processor activeProcess withPriority:pri-1 to:pri |
|
218 |
do:[ |
|
219 |
|revision aborted freshCreated| |
|
220 |
||
221 |
freshCreated := false. |
|
222 |
revision := aClass revision. |
|
223 |
revision isNil ifTrue:[ |
|
224 |
mgr isContainerBased ifTrue:[ |
|
225 |
"/ mhmh - check if it has a container. |
|
226 |
(mgr checkForExistingContainerForClass:aClass) ifFalse:[ |
|
227 |
(self createSourceContainerForClass:aClass usingManager:mgr) ifFalse:[ |
|
228 |
self warn:'Did not create/change repository container for ''' , aClass name allBold , ''''. |
|
229 |
^ false. |
|
230 |
]. |
|
231 |
freshCreated := true. |
|
232 |
] |
|
233 |
] |
|
234 |
]. |
|
235 |
||
236 |
doCheckClass value ifTrue:[ |
|
237 |
"/ check if the class contains halts, error-sends etc. |
|
238 |
(self checkAndWarnAboutBadMessagesInClass:aClass checkAgainHolder:doCheckClass) ifFalse:[ |
|
239 |
^ false |
|
240 |
]. |
|
241 |
]. |
|
242 |
||
243 |
freshCreated ifFalse:[ |
|
244 |
aborted := false. |
|
245 |
AbortOperationRequest handle:[:ex | |
|
246 |
aborted := true. |
|
247 |
ex return. |
|
248 |
] do:[ |
|
249 |
|checkinState cause| |
|
250 |
checkinState := false. |
|
251 |
cause := ''. |
|
252 |
[ |
|
253 |
checkinState := mgr checkinClass:aClass logMessage:logMessage |
|
254 |
] on:SourceCodeManagerError do:[:ex| |
|
255 |
cause := ex description. |
|
3362
0ede9d87d347
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3298
diff
changeset
|
256 |
"/ ex proceed. |
2848 | 257 |
]. |
258 |
||
259 |
checkinState ifFalse:[ |
|
260 |
Transcript showCR:'checkin of ''' , aClass name , ''' failed - ', cause. |
|
261 |
self warn:(resources stringWithCRs:'Checkin of "%1" failed\\' with:aClass name allBold),cause. |
|
3362
0ede9d87d347
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3298
diff
changeset
|
262 |
AbortOperationRequest raise. |
0ede9d87d347
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3298
diff
changeset
|
263 |
"/ ^ false. |
2848 | 264 |
]. |
265 |
checkinInfo notNil ifTrue:[ |
|
266 |
checkinInfo isStable ifTrue:[ |
|
267 |
"set stable tag for class that has been checked in" |
|
268 |
self tagClass:aClass as:#stable. |
|
269 |
]. |
|
270 |
checkinInfo tagIt ifTrue:[ |
|
3293
ef3fc480b979
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3262
diff
changeset
|
271 |
"set any additional tags for the class that has been checked in" |
ef3fc480b979
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3262
diff
changeset
|
272 |
(checkinInfo tag asCollectionOfSubstringsSeparatedByAny:',;') do:[:eachTag | |
ef3fc480b979
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3262
diff
changeset
|
273 |
self tagClass:aClass as:eachTag withoutSeparators. |
3297
cfde0f21aecc
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3293
diff
changeset
|
274 |
]. |
2848 | 275 |
]. |
3298
0d1ea2b38777
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3297
diff
changeset
|
276 |
CVSSourceCodeManager recentTag:checkinInfo tag. |
2848 | 277 |
]. |
278 |
]. |
|
279 |
aborted ifTrue:[ |
|
280 |
Transcript showCR:'Checkin of ''' , aClass name , ''' aborted'. |
|
281 |
||
282 |
AbortAllOperationWantedQuery query ifTrue:[ |
|
283 |
(Dialog |
|
284 |
confirm:(resources stringWithCRs:'Checkin of "%1" aborted.\\Cancel all ?' with:aClass name) |
|
285 |
default:false) |
|
286 |
ifTrue:[ |
|
287 |
AbortAllOperationRequest raise. |
|
288 |
] |
|
289 |
]. |
|
290 |
^ false. |
|
291 |
]. |
|
292 |
]. |
|
293 |
]. |
|
294 |
^ true |
|
295 |
||
296 |
"Created: / 21-12-2011 / 18:19:14 / cg" |
|
297 |
! |
|
298 |
||
299 |
checkinClasses:aCollectionOfClass |
|
300 |
"check a collection of classes into the source repository. |
|
301 |
Asks interactively for log-message." |
|
302 |
||
303 |
^ self checkinClasses:aCollectionOfClass withInfo:nil |
|
304 |
! |
|
305 |
||
306 |
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrNil |
|
307 |
"check a bunch of classes into the source repository. |
|
308 |
If the argument, aLogInfoOrNil isNil, ask interactively for log-message." |
|
309 |
||
310 |
^ self |
|
311 |
checkinClasses:aCollectionOfClasses |
|
312 |
withInfo:aLogInfoOrNil |
|
313 |
withCheck:(UserPreferences current at:#checkClassesWhenCheckingIn ifAbsent:true) |
|
314 |
! |
|
315 |
||
316 |
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringNil withCheck:doCheckClasses |
|
317 |
"check a bunch of classes into the source repository. |
|
318 |
If the argument, aLogInfoOrStringNil isNil, ask interactively for log-message." |
|
319 |
||
320 |
self checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringNil withCheck:doCheckClasses usingManager:nil |
|
321 |
||
322 |
"Modified: / 21-12-2011 / 18:24:47 / cg" |
|
323 |
! |
|
324 |
||
325 |
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringNil withCheck:doCheckClasses usingManager:aManagerOrNil |
|
326 |
"check a bunch of classes into the source repository. |
|
327 |
If the argument, aLogInfoOrStringNil isNil, ask interactively for log-message." |
|
328 |
||
2946 | 329 |
|classes allClasses checkinInfoOrString yesOrNoToAll unchangedClasses| |
2848 | 330 |
|
331 |
"/ ignore private classes |
|
332 |
classes := aCollectionOfClasses select:[:aClass | aClass owningClass isNil]. |
|
333 |
classes isEmpty ifTrue:[ |
|
334 |
self information:'Only private classes given - nothing checked in.'. |
|
335 |
^ self |
|
336 |
]. |
|
337 |
classes := classes select:[:aClass | aClass isLoaded]. |
|
338 |
classes isEmpty ifTrue:[ |
|
339 |
self information:'Only unloaded classes given - nothing checked in.'. |
|
340 |
^ self |
|
341 |
]. |
|
342 |
||
343 |
classes size == 1 ifTrue:[ |
|
344 |
^ self checkinClass:classes first withInfo:aLogInfoOrStringNil withCheck:doCheckClasses usingManager:aManagerOrNil. |
|
345 |
]. |
|
346 |
||
347 |
"ask once, for all classes" |
|
348 |
aLogInfoOrStringNil isNil ifTrue:[ |
|
349 |
checkinInfoOrString := self |
|
350 |
getCheckinInfoFor:(resources string:'%1 classes to checkin' with:aCollectionOfClasses size) |
|
351 |
initialAnswer:nil |
|
352 |
withQuickOption:true. |
|
353 |
checkinInfoOrString isNil ifTrue:[^ self]. |
|
354 |
] ifFalse:[ |
|
355 |
checkinInfoOrString := aLogInfoOrStringNil. |
|
356 |
]. |
|
357 |
||
358 |
allClasses := classes. |
|
359 |
checkinInfoOrString quickCheckIn ifTrue:[ |
|
3164
e54571b3021f
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
360 |
"/ not only the one's in the changeSet; |
e54571b3021f
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
361 |
"/ also those which have not been checked in before. |
e54571b3021f
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
362 |
classes := classes select:[:each | each hasUnsavedChanges or:[ (each revisionOfManager:aManagerOrNil) isNil ]]. |
2848 | 363 |
classes isEmpty ifTrue:[ Dialog information:'no changes to checkin (quickCheckIn)' ] |
364 |
]. |
|
365 |
||
366 |
"abortAll is handled, and also asked for here!!" |
|
367 |
AbortAllOperationRequest handleAndAnswerQueryIn:[ |
|
368 |
classes notEmpty ifTrue:[ |
|
369 |
self yesToAllNotification handle:[:ex | |
|
370 |
yesOrNoToAll := ex parameter. |
|
371 |
ex proceed |
|
372 |
] do:[ |
|
373 |
self yesToAllQuery handle:[:ex | |
|
374 |
ex proceedWith:yesOrNoToAll |
|
375 |
] do:[ |
|
376 |
classes do:[:aClass | |
|
377 |
self activityNotification:(resources string:'checking in %1' with:aClass name). |
|
378 |
"/ ca does not want boxes to pop up all over ... |
|
379 |
UserInformation handle:[:ex | |
|
380 |
Transcript showCR:ex description. |
|
381 |
ex proceed. |
|
382 |
] do:[ |
|
383 |
AbortOperationRequest catch:[ |
|
384 |
self |
|
385 |
checkinClass:aClass |
|
386 |
withInfo:checkinInfoOrString |
|
387 |
withCheck:doCheckClasses |
|
388 |
usingManager:aManagerOrNil |
|
389 |
] |
|
390 |
]. |
|
391 |
]. |
|
392 |
] |
|
393 |
]. |
|
394 |
]. |
|
395 |
||
396 |
(checkinInfoOrString isStable or:[checkinInfoOrString tagIt]) |
|
397 |
ifTrue:[ |
|
398 |
"/mhmh - but tag should be set on all (even unchanged ones) |
|
399 |
"/ the other onces have already been tagged |
|
3293
ef3fc480b979
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3262
diff
changeset
|
400 |
unchangedClasses := allClasses reject:[:eachClass | (classes includes:eachClass)]. |
2848 | 401 |
|
402 |
"mhmh - could still have to tag them" |
|
403 |
checkinInfoOrString isStable ifTrue:[ |
|
404 |
unchangedClasses do:[:eachClass | |
|
405 |
self tagClass:eachClass as:#stable. |
|
406 |
]. |
|
407 |
]. |
|
408 |
checkinInfoOrString tagIt ifTrue:[ |
|
409 |
unchangedClasses do:[:eachClass | |
|
410 |
self tagClass:eachClass as:(checkinInfoOrString tag). |
|
411 |
]. |
|
412 |
]. |
|
413 |
]. |
|
414 |
]. |
|
415 |
||
416 |
"Created: / 21-12-2011 / 18:24:25 / cg" |
|
417 |
! |
|
418 |
||
419 |
checkinExtensionMethods:aCollectionOfMethods forPackage:aPackageID withInfo:aLogInfoOrStringOrNil |
|
420 |
"checkin a projects extensions into the source repository. |
|
421 |
If the argument, aLogInfoOrStringOrNil isNil, ask interactively for log-message." |
|
422 |
||
3133 | 423 |
|logMessage checkinInfo mgr pri module directory containerFileName extensionsSource| |
2848 | 424 |
|
425 |
"/ the following is wrong - must ask the projectDefinition !! |
|
426 |
aPackageID asPackageId projectDefinitionClass notNil ifTrue:[ |
|
427 |
mgr := self sourceCodeManagerFor:aPackageID asPackageId projectDefinitionClass. |
|
428 |
] ifFalse:[ |
|
429 |
mgr := self sourceCodeManagerFor:aCollectionOfMethods first mclass. |
|
430 |
]. |
|
431 |
mgr isNil ifTrue:[ ^ false ]. |
|
432 |
||
433 |
module := aPackageID asPackageId module. |
|
434 |
directory := aPackageID asPackageId directory. |
|
435 |
containerFileName := self nameOfExtensionsContainer. |
|
436 |
||
437 |
aLogInfoOrStringOrNil isNil ifTrue:[ |
|
438 |
checkinInfo := self getCheckinInfoFor:containerFileName allBold initialAnswer:nil. |
|
439 |
checkinInfo isNil ifTrue:[^ false]. |
|
440 |
logMessage := checkinInfo logMessage. |
|
441 |
] ifFalse:[ |
|
442 |
aLogInfoOrStringOrNil isString ifTrue:[ |
|
443 |
logMessage := aLogInfoOrStringOrNil |
|
444 |
] ifFalse:[ |
|
445 |
checkinInfo := aLogInfoOrStringOrNil. |
|
446 |
logMessage := checkinInfo logMessage. |
|
447 |
]. |
|
448 |
]. |
|
449 |
||
450 |
(mgr checkForExistingContainer:containerFileName inModule:module directory:directory) ifFalse:[ |
|
451 |
(self checkForExistingModule:module usingManager:mgr allowCreate:true) ifFalse:[^ false]. |
|
452 |
LastModule := module. |
|
453 |
||
454 |
(self checkForExistingModule:module directory:directory usingManager:mgr allowCreate:true) ifFalse:[^ false]. |
|
455 |
LastPackage := directory. |
|
456 |
||
457 |
(self checkForExistingModule:module directory:directory container:containerFileName usingManager:mgr allowCreate:true) ifFalse:[^ false]. |
|
458 |
]. |
|
459 |
||
460 |
self activityNotification:(resources string:'Checking in %1' with:containerFileName). |
|
461 |
pri := Processor activePriority. |
|
462 |
Processor activeProcess |
|
463 |
withPriority:pri-1 to:pri |
|
464 |
do:[ |
|
3133 | 465 |
extensionsSource := self sourceCodeForExtensions:aCollectionOfMethods package:aPackageID forManager:mgr. |
466 |
"Care for non-ASCII/non-ISO-8859 characters in extension methods" |
|
467 |
extensionsSource isWideString ifTrue:[ |
|
468 |
extensionsSource := '"{ Encoding: utf8 }"' , Character cr asString , Character cr asString , extensionsSource. |
|
469 |
extensionsSource := extensionsSource utf8Encoded. |
|
470 |
]. |
|
2848 | 471 |
|
472 |
UserInformation handle:[:ex | |
|
473 |
Transcript showCR:ex description. |
|
474 |
ex proceed. |
|
475 |
] do:[ |
|
476 |
Transcript showCR:('checking in ',containerFileName,' ...'). |
|
477 |
(mgr |
|
478 |
checkin:containerFileName |
|
3133 | 479 |
text:extensionsSource |
2848 | 480 |
directory:directory |
481 |
module:module |
|
482 |
logMessage:logMessage |
|
483 |
force:false) |
|
484 |
ifFalse:[ |
|
485 |
Transcript showCR:'Checkin of ''' , containerFileName , ''' failed'. |
|
486 |
self warn:'Checkin of ''' , containerFileName allBold , ''' failed'. |
|
487 |
^ false. |
|
488 |
]. |
|
489 |
checkinInfo notNil ifTrue:[ |
|
490 |
|path| |
|
491 |
||
492 |
path := (module, '/', directory, '/', containerFileName). |
|
493 |
checkinInfo isStable ifTrue:[ |
|
494 |
"set stable tag for class that has been checked in" |
|
495 |
self tagPath:path as:#stable usingManager:mgr. |
|
496 |
]. |
|
497 |
checkinInfo tagIt ifTrue:[ |
|
498 |
"set an additional tag for class that has been checked in" |
|
499 |
self tagPath:path as:(checkinInfo tag) usingManager:mgr. |
|
500 |
]. |
|
501 |
]. |
|
502 |
mgr postCheckInExtensionsForPackage:aPackageID |
|
503 |
]. |
|
504 |
]. |
|
505 |
^ true |
|
506 |
||
507 |
"Modified: / 25-07-2012 / 18:38:40 / cg" |
|
508 |
! |
|
509 |
||
510 |
checkinPackage:packageToCheckIn classes:doClasses extensions:doExtensions buildSupport:doBuild askForMethodsInOtherPackages:askForMethodsInOtherPackages |
|
3196
d91dbd26f40c
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
511 |
|mgr classesToCheckIn methodsToCheckIn methodsInPrjDef |
2848 | 512 |
methodsInOtherPackages looseMethods otherPackages |
3164
e54571b3021f
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
513 |
msg classesInChangeSet newClasses checkinInfo originalCheckinInfo classesToTag| |
2848 | 514 |
|
515 |
mgr := self sourceCodeManagerFor: packageToCheckIn. |
|
516 |
||
517 |
classesToCheckIn := IdentitySet new. |
|
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
518 |
classesInChangeSet := IdentitySet new. |
2848 | 519 |
methodsToCheckIn := IdentitySet new. |
520 |
methodsInOtherPackages := IdentitySet new. |
|
521 |
looseMethods := IdentitySet new. |
|
522 |
||
3164
e54571b3021f
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
523 |
"/ collect classes and individual methods... |
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
524 |
(doClasses or:[doExtensions]) ifTrue:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
525 |
Smalltalk allClassesDo:[:aClass | |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
526 |
|owner classPackage| |
3141
25cd1cd26450
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3133
diff
changeset
|
527 |
|
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
528 |
(owner := aClass owningClass) notNil ifTrue:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
529 |
classPackage := aClass topOwningClass package |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
530 |
] ifFalse:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
531 |
classPackage := aClass package |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
532 |
]. |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
533 |
(classPackage = packageToCheckIn) ifTrue:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
534 |
classesToCheckIn add:aClass. |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
535 |
]. |
3164
e54571b3021f
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
536 |
|
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
537 |
doExtensions ifTrue:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
538 |
aClass isMeta ifFalse:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
539 |
"/ ... whose class is not in the checkIn-set |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
540 |
(classesToCheckIn includes:aClass) ifFalse:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
541 |
aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
542 |
"/ methods in this project ... |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
543 |
(mthd package = packageToCheckIn) ifTrue:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
544 |
methodsToCheckIn add:mthd |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
545 |
] |
3164
e54571b3021f
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
546 |
] |
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
547 |
]. |
3164
e54571b3021f
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
548 |
]. |
e54571b3021f
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
549 |
]. |
e54571b3021f
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
550 |
]. |
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
551 |
|
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
552 |
"/ cg: O(n^2) algorithm |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
553 |
"/ classesInChangeSet := classesToCheckIn select:[:cls | cls hasUnsavedChanges]. |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
554 |
"/ replaced by: O(n) algorithm |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
555 |
classesInChangeSet := ChangeSet current selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:classesToCheckIn. |
2848 | 556 |
]. |
557 |
||
558 |
doExtensions ifTrue:[ |
|
559 |
methodsToCheckIn notEmpty ifTrue:[ |
|
560 |
doClasses ifTrue:[ |
|
561 |
msg := '%1 classes (%4 changed) '. |
|
562 |
] ifFalse:[ |
|
563 |
msg := ''. |
|
564 |
]. |
|
565 |
doExtensions ifTrue:[ |
|
566 |
doClasses ifTrue:[ |
|
567 |
msg := msg , 'and '. |
|
568 |
]. |
|
569 |
msg := msg , '%2 extensions '. |
|
570 |
]. |
|
571 |
msg := msg , 'of project "%3"'. |
|
572 |
||
573 |
checkinInfo := self |
|
574 |
getCheckinInfoFor:(msg |
|
575 |
bindWith:classesToCheckIn size |
|
576 |
with:methodsToCheckIn size |
|
577 |
with:packageToCheckIn allBold |
|
578 |
with:classesInChangeSet size) |
|
579 |
initialAnswer:nil |
|
3141
25cd1cd26450
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3133
diff
changeset
|
580 |
withQuickOption:(classesToCheckIn size > 0) |
25cd1cd26450
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3133
diff
changeset
|
581 |
withValidateConsistencyOption:true. |
2848 | 582 |
checkinInfo isNil ifTrue:[ |
583 |
^ self. |
|
584 |
]. |
|
3145
e59d8d1ab71a
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3141
diff
changeset
|
585 |
|
e59d8d1ab71a
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3141
diff
changeset
|
586 |
checkinInfo validateConsistency ifTrue:[ |
e59d8d1ab71a
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3141
diff
changeset
|
587 |
self validateConsistencyOfPackage:packageToCheckIn doClasses:doClasses doExtensions:doExtensions. |
3196
d91dbd26f40c
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
588 |
"/ could have changed/recompiled methods... |
d91dbd26f40c
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
589 |
"/ mhmh - should we checkin what is specified in the prj-def, |
d91dbd26f40c
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
590 |
"/ or what is actually present in the image (in case user did not repair)??? |
d91dbd26f40c
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
591 |
|
d91dbd26f40c
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
592 |
methodsInPrjDef := packageToCheckIn asPackageId projectDefinitionClass extensionMethods. |
d91dbd26f40c
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
593 |
methodsInPrjDef := methodsInPrjDef reject:[:m | m isNil]. |
d91dbd26f40c
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
594 |
methodsInPrjDef asSet ~= methodsToCheckIn asSet ifTrue:[ |
d91dbd26f40c
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
595 |
(Dialog |
d91dbd26f40c
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
596 |
confirm:('Set of methods in image is different from what is specified in the project definition.\Check in image methods (%1) or definition methods (%2)?' |
d91dbd26f40c
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
597 |
bindWith: methodsToCheckIn size |
d91dbd26f40c
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
598 |
with: methodsInPrjDef size) |
d91dbd26f40c
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
599 |
yesLabel:'Image Methods' |
d91dbd26f40c
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
600 |
noLabel:'Definition Methods' |
d91dbd26f40c
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
601 |
) ifFalse:[ |
d91dbd26f40c
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
602 |
methodsToCheckIn := methodsInPrjDef. |
d91dbd26f40c
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
603 |
]. |
d91dbd26f40c
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
604 |
]. |
3145
e59d8d1ab71a
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3141
diff
changeset
|
605 |
]. |
e59d8d1ab71a
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3141
diff
changeset
|
606 |
|
3250
fe3f6d8ead83
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3196
diff
changeset
|
607 |
"/ also need the extensionVersion methods in the projectDefinition class, |
fe3f6d8ead83
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3196
diff
changeset
|
608 |
"/ which are kept in the extensions container. (the reason is that we need the proper |
fe3f6d8ead83
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3196
diff
changeset
|
609 |
"/ CVS id for the extensions container, not for the projDefinition container. |
fe3f6d8ead83
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3196
diff
changeset
|
610 |
packageToCheckIn asPackageId projectDefinitionClass theMetaclass selectorsAndMethodsDo:[:sel :mthd | |
fe3f6d8ead83
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3196
diff
changeset
|
611 |
(AbstractSourceCodeManager isExtensionsVersionMethodSelector:sel) ifTrue:[ |
fe3f6d8ead83
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3196
diff
changeset
|
612 |
methodsToCheckIn add:mthd |
fe3f6d8ead83
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3196
diff
changeset
|
613 |
]. |
fe3f6d8ead83
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3196
diff
changeset
|
614 |
]. |
fe3f6d8ead83
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3196
diff
changeset
|
615 |
|
2848 | 616 |
(self |
617 |
checkinExtensionMethods:methodsToCheckIn |
|
618 |
forPackage:packageToCheckIn |
|
619 |
withInfo:checkinInfo) |
|
620 |
ifFalse:[ |
|
621 |
Dialog warn:(resources string:'Could not check in extensions for project %1' with:packageToCheckIn). |
|
622 |
^ self. |
|
623 |
] |
|
624 |
] ifFalse:[ |
|
625 |
"/ there may have been extension-methods previously - if so, remove them |
|
626 |
(mgr |
|
627 |
checkForExistingContainer:'extensions.st' inPackage:packageToCheckIn) |
|
628 |
ifTrue:[ |
|
629 |
"/ self halt. |
|
630 |
(self |
|
631 |
checkinExtensionMethods:#() |
|
632 |
forPackage:packageToCheckIn |
|
633 |
withInfo:'No extensions any more') |
|
634 |
ifFalse:[ |
|
635 |
Dialog warn:(resources string:'Could not check in extensions for project %1' with:packageToCheckIn). |
|
636 |
^ self. |
|
637 |
] |
|
638 |
] |
|
639 |
]. |
|
640 |
]. |
|
641 |
||
642 |
checkinInfo isNil ifTrue:[ |
|
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
643 |
|infoString| |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
644 |
|
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
645 |
doExtensions ifTrue:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
646 |
infoString := '%1 classes (%4 changed) and %2 extensions for project "%3"'. |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
647 |
] ifFalse:[doClasses ifTrue:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
648 |
infoString := '%1 classes (%4 changed) for project "%3"'. |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
649 |
] ifFalse:[doBuild ifTrue:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
650 |
infoString := 'Build support files for project "%3"'. |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
651 |
] ifFalse:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
652 |
infoString := 'I don''t know what I am doing'. |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
653 |
]]]. |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
654 |
|
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
655 |
infoString := infoString |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
656 |
bindWith:classesToCheckIn size |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
657 |
with:methodsToCheckIn size |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
658 |
with:packageToCheckIn allBold |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
659 |
with:classesInChangeSet size. |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
660 |
|
2848 | 661 |
checkinInfo := self |
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
662 |
getCheckinInfoFor:infoString |
2848 | 663 |
initialAnswer:nil |
3141
25cd1cd26450
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3133
diff
changeset
|
664 |
withQuickOption:(classesToCheckIn size > 0) |
25cd1cd26450
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3133
diff
changeset
|
665 |
withValidateConsistencyOption:true. |
2848 | 666 |
checkinInfo isNil ifTrue:[ |
667 |
^ self. |
|
668 |
]. |
|
3145
e59d8d1ab71a
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3141
diff
changeset
|
669 |
checkinInfo validateConsistency ifTrue:[ |
e59d8d1ab71a
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3141
diff
changeset
|
670 |
self validateConsistencyOfPackage:packageToCheckIn doClasses:doClasses doExtensions:doExtensions. |
e59d8d1ab71a
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3141
diff
changeset
|
671 |
]. |
3141
25cd1cd26450
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3133
diff
changeset
|
672 |
]. |
25cd1cd26450
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3133
diff
changeset
|
673 |
|
2848 | 674 |
checkinInfo quickCheckIn ifTrue:[ |
675 |
(checkinInfo isStable or:[checkinInfo tagIt]) ifTrue:[ |
|
676 |
classesToTag := classesToCheckIn. |
|
677 |
originalCheckinInfo := checkinInfo. |
|
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
678 |
checkinInfo := checkinInfo deepCopy. |
2848 | 679 |
checkinInfo isStable:false. |
680 |
checkinInfo tag:nil. |
|
681 |
]. |
|
3164
e54571b3021f
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
682 |
"/ not only the one's in the changeSet; |
e54571b3021f
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
683 |
"/ also those which have not been checked in before. |
e54571b3021f
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
684 |
newClasses := classesToCheckIn select:[:class | (class revisionOfManager:mgr) isNil ]. |
e54571b3021f
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
685 |
classesToCheckIn := Set new |
e54571b3021f
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
686 |
addAll:classesInChangeSet; |
e54571b3021f
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
687 |
addAll:newClasses; |
e54571b3021f
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
688 |
yourself. |
2848 | 689 |
]. |
690 |
||
691 |
"/ check if any of the classes contains methods for other packages ... |
|
692 |
classesToCheckIn do:[:eachClass | |
|
693 |
eachClass instAndClassMethodsDo:[:eachMethod | |
|
694 |
|mPgk| |
|
695 |
||
696 |
mPgk := eachMethod package. |
|
697 |
(mPgk = packageToCheckIn) ifFalse:[ |
|
698 |
mPgk == PackageId noProjectID ifTrue:[ |
|
699 |
looseMethods add:eachMethod |
|
700 |
] ifFalse:[ |
|
701 |
methodsInOtherPackages add:eachMethod |
|
702 |
] |
|
703 |
] |
|
704 |
]. |
|
705 |
]. |
|
706 |
||
707 |
askForMethodsInOtherPackages ifTrue:[ |
|
708 |
methodsInOtherPackages notEmpty ifTrue:[ |
|
709 |
otherPackages := Set new. |
|
710 |
methodsInOtherPackages do:[:eachMethod | otherPackages add:eachMethod package]. |
|
711 |
||
712 |
methodsInOtherPackages size == 1 ifTrue:[ |
|
713 |
msg := 'The ''%4'' method in ''%5'' is contained in the ''%2'' package.'. |
|
714 |
msg := msg , '\\This method will remain in its package.'. |
|
715 |
] ifFalse:[ |
|
716 |
otherPackages size == 1 ifTrue:[ |
|
717 |
msg := 'The %1 methods from the %2 package will remain in its package.' |
|
718 |
] ifFalse:[ |
|
719 |
msg := 'The %1 methods from %3 other packages will remain in their packages.' |
|
720 |
]. |
|
721 |
msg := msg , '\\Hint: if these are meant to belong to this package,'. |
|
722 |
msg := msg , '\move them first, then repeat the checkin operation.'. |
|
723 |
]. |
|
724 |
msg := msg withCRs. |
|
725 |
msg := msg bindWith:methodsInOtherPackages size |
|
726 |
with:otherPackages first allBold |
|
727 |
with:otherPackages size |
|
728 |
with:methodsInOtherPackages first selector allBold |
|
729 |
with:methodsInOtherPackages first mclass name allBold. |
|
730 |
(Dialog confirm:msg noLabel:(resources string:'Cancel')) ifFalse:[^ self]. |
|
731 |
]. |
|
732 |
]. |
|
733 |
||
734 |
doClasses ifTrue:[ |
|
735 |
classesToCheckIn notEmpty ifTrue:[ |
|
736 |
looseMethods notEmpty ifTrue:[ |
|
737 |
looseMethods size == 1 ifTrue:[ |
|
738 |
msg := 'The ''%2'' method in ''%3'' is unassigned (loose).'. |
|
739 |
msg := msg , '\\If you proceed, this method will be moved to the ''%4'' package'. |
|
740 |
msg := msg , '\\Hint: if this is meant to be an extension of another package,'. |
|
741 |
msg := msg , '\cancel and move it to the appropriate package first.'. |
|
742 |
] ifFalse:[ |
|
743 |
msg := 'There are %1 unassigned (loose) methods in classes from this project.'. |
|
744 |
msg := msg , '\\If you proceed, those will be moved to the ''%4'' package ?'. |
|
745 |
msg := msg , '\\Hint: if these are meant to be extensions of another package,'. |
|
746 |
msg := msg , '\cancel and move them to the appropriate package first.'. |
|
747 |
]. |
|
748 |
doClasses ifTrue:[ |
|
749 |
msg := msg , '\\If you answer with "No" here, you will be asked for each class individually.'. |
|
750 |
]. |
|
751 |
msg := msg withCRs. |
|
752 |
msg := msg bindWith:looseMethods size |
|
753 |
with:(looseMethods isEmpty ifTrue:[''] ifFalse:[looseMethods first selector allBold]) |
|
754 |
with:(looseMethods isEmpty ifTrue:[''] ifFalse:[looseMethods first mclass name allBold]) |
|
755 |
with:packageToCheckIn allBold. |
|
756 |
(Dialog confirm:msg noLabel:(resources string:'Cancel')) ifFalse:[^ self]. |
|
757 |
||
758 |
looseMethods do:[:mthd | |
|
759 |
mthd package:packageToCheckIn |
|
760 |
]. |
|
761 |
]. |
|
762 |
self checkinClasses:classesToCheckIn withInfo:checkinInfo. |
|
763 |
]. |
|
764 |
||
765 |
originalCheckinInfo notNil ifTrue:[ |
|
766 |
originalCheckinInfo isStable ifTrue:[ |
|
767 |
classesToTag do:[:eachClass | |
|
768 |
self tagClass:eachClass as:#stable |
|
769 |
]. |
|
770 |
]. |
|
771 |
originalCheckinInfo tagIt ifTrue:[ |
|
772 |
classesToTag do:[:eachClass | |
|
773 |
self tagClass:eachClass as:(originalCheckinInfo tag) |
|
774 |
]. |
|
775 |
]. |
|
776 |
]. |
|
777 |
]. |
|
778 |
||
779 |
doBuild ifTrue:[ |
|
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
780 |
self checkinBuildSupportFilesForPackage:packageToCheckIn withInfo:(originalCheckinInfo ? checkinInfo). |
2848 | 781 |
]. |
782 |
||
783 |
"Created: / 13-10-2011 / 11:15:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2906 | 784 |
"Modified: / 04-09-2012 / 14:05:36 / cg" |
2848 | 785 |
! ! |
786 |
||
787 |
!SourceCodeManagerUtilitiesForContainerBasedManagers class methodsFor:'documentation'! |
|
788 |
||
789 |
version |
|
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
790 |
^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilitiesForContainerBasedManagers.st,v 1.17 2013-08-06 11:29:32 stefan Exp $' |
2848 | 791 |
! |
792 |
||
793 |
version_CVS |
|
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
794 |
^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilitiesForContainerBasedManagers.st,v 1.17 2013-08-06 11:29:32 stefan Exp $' |
2848 | 795 |
! ! |
3133 | 796 |