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