author | Claus Gittinger <cg@exept.de> |
Wed, 06 Dec 2017 03:32:15 +0100 | |
changeset 4282 | 1f8310c7bb5d |
parent 4277 | 84fb9579f31d |
child 4333 | c6441a31864d |
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 |
||
3772
399ff1b46d41
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3651
diff
changeset
|
14 |
"{ NameSpace: Smalltalk }" |
399ff1b46d41
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3651
diff
changeset
|
15 |
|
2848 | 16 |
SourceCodeManagerUtilities subclass:#SourceCodeManagerUtilitiesForContainerBasedManagers |
17 |
instanceVariableNames:'' |
|
4202 | 18 |
classVariableNames:'' |
2848 | 19 |
poolDictionaries:'' |
20 |
category:'System-SourceCodeManagement' |
|
21 |
! |
|
22 |
||
23 |
!SourceCodeManagerUtilitiesForContainerBasedManagers class methodsFor:'documentation'! |
|
24 |
||
25 |
copyright |
|
26 |
" |
|
27 |
COPYRIGHT (c) 2012 eXept Software AG |
|
28 |
All Rights Reserved |
|
29 |
||
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
! ! |
|
38 |
||
39 |
!SourceCodeManagerUtilitiesForContainerBasedManagers methodsFor:'utilities-cvs'! |
|
40 |
||
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
41 |
checkinBuildSupportFilesForPackage:packageID withInfo:checkinInfo |
4277 | 42 |
^ self checkinBuildSupportFilesForPackage:packageID withInfo:checkinInfo onBranch:nil |
43 |
||
44 |
"Created: / 09-08-2006 / 18:59:42 / fm" |
|
45 |
"Modified: / 12-10-2011 / 11:36:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
46 |
"Modified: / 05-12-2017 / 20:31:34 / cg" |
|
47 |
! |
|
48 |
||
49 |
checkinBuildSupportFilesForPackage:packageID withInfo:checkinInfo onBranch:branchNameOrNil |
|
3573
af8f051e0a8b
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3537
diff
changeset
|
50 |
|anyFailure module directory mgr defClass| |
2848 | 51 |
|
52 |
mgr := self sourceCodeManagerFor: packageID. |
|
53 |
defClass := ProjectDefinition definitionClassForPackage: packageID. |
|
54 |
||
3141
25cd1cd26450
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3133
diff
changeset
|
55 |
"/ already done elsewhere now |
25cd1cd26450
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3133
diff
changeset
|
56 |
"/ defClass validateDescription. |
2848 | 57 |
|
58 |
anyFailure := false. |
|
59 |
||
60 |
module := packageID asPackageId module. |
|
61 |
directory := packageID asPackageId directory. |
|
62 |
||
3819
7bf4e32e3685
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3772
diff
changeset
|
63 |
self activityNotification:(resources string:'Checking in build-support files...'). |
2848 | 64 |
(mgr checkForExistingModule:module directory:directory) ifFalse:[ |
65 |
mgr createModule:module directory:directory |
|
66 |
]. |
|
67 |
||
68 |
defClass forEachFileNameAndGeneratedContentsDo:[:fileName :fileContents | |
|
69 |
|realFileName realDirectory| |
|
70 |
||
71 |
"/ care for subdirectories |
|
72 |
(fileName includes:$/) ifTrue:[ |
|
73 |
realDirectory := (directory asFilename construct:(fileName asFilename directoryName)) name. |
|
74 |
realFileName := fileName asFilename baseName. |
|
75 |
] ifFalse:[ |
|
76 |
realDirectory := directory. |
|
77 |
realFileName := fileName. |
|
78 |
]. |
|
79 |
realDirectory := realDirectory replaceAll:$\ with:$/. |
|
80 |
||
3819
7bf4e32e3685
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3772
diff
changeset
|
81 |
self activityNotification:(resources string:'Checking in %1...' with:realFileName). |
2848 | 82 |
|
83 |
UserInformation |
|
84 |
handle:[:ex | Transcript showCR:ex description ] |
|
85 |
do:[ |
|
86 |
(mgr isContainerBased |
|
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
87 |
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
|
88 |
) ifTrue:[ |
4282 | 89 |
"/ a new file |
2848 | 90 |
realDirectory ~= directory ifTrue:[ |
91 |
(mgr checkForExistingModule:module directory:realDirectory) ifFalse:[ |
|
92 |
mgr createModule:module directory:realDirectory |
|
93 |
]. |
|
94 |
]. |
|
3573
af8f051e0a8b
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3537
diff
changeset
|
95 |
[:exit | |
af8f051e0a8b
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3537
diff
changeset
|
96 |
|answer| |
af8f051e0a8b
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3537
diff
changeset
|
97 |
|
af8f051e0a8b
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3537
diff
changeset
|
98 |
(mgr |
af8f051e0a8b
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3537
diff
changeset
|
99 |
createContainerForText:fileContents |
af8f051e0a8b
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3537
diff
changeset
|
100 |
inModule:module |
af8f051e0a8b
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3537
diff
changeset
|
101 |
package:realDirectory |
af8f051e0a8b
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3537
diff
changeset
|
102 |
container:realFileName) ifTrue:[ exit value:nil ]. |
af8f051e0a8b
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3537
diff
changeset
|
103 |
|
af8f051e0a8b
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3537
diff
changeset
|
104 |
answer := Dialog |
af8f051e0a8b
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3537
diff
changeset
|
105 |
confirmWithCancel:(resources |
af8f051e0a8b
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3537
diff
changeset
|
106 |
stringWithCRs:'Cannot create new container: ''%3'' (in %1:%2).\\Retry?' |
af8f051e0a8b
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3537
diff
changeset
|
107 |
with:module |
af8f051e0a8b
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3537
diff
changeset
|
108 |
with:realDirectory |
af8f051e0a8b
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3537
diff
changeset
|
109 |
with:realFileName). |
af8f051e0a8b
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3537
diff
changeset
|
110 |
|
af8f051e0a8b
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3537
diff
changeset
|
111 |
answer == nil ifTrue:[ |
af8f051e0a8b
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3537
diff
changeset
|
112 |
AbortOperationRequest raise |
af8f051e0a8b
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3537
diff
changeset
|
113 |
]. |
af8f051e0a8b
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3537
diff
changeset
|
114 |
answer == false ifTrue:[ exit value:nil ]. |
af8f051e0a8b
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3537
diff
changeset
|
115 |
] loopWithExit. |
2848 | 116 |
] ifFalse:[ |
4282 | 117 |
"/ an existing file |
2848 | 118 |
(mgr |
119 |
checkin:realFileName |
|
120 |
text:fileContents |
|
121 |
directory:realDirectory |
|
122 |
module:module |
|
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
123 |
logMessage:checkinInfo logMessage |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
124 |
force:false |
4282 | 125 |
onBranch:branchNameOrNil |
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
126 |
) ifTrue:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
127 |
checkinInfo isStable ifTrue:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
128 |
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
|
129 |
]. |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
130 |
checkinInfo tagIt ifTrue:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
131 |
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
|
132 |
]. |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
133 |
] ifFalse:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
134 |
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
|
135 |
anyFailure := true. |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
136 |
]. |
2848 | 137 |
]. |
138 |
]. |
|
139 |
]. |
|
140 |
||
141 |
defClass instAndClassMethodsDo:[:m | m package:defClass package]. |
|
3991 | 142 |
[ |
143 |
self |
|
144 |
checkinClasses:(Array with:defClass) |
|
145 |
withInfo:checkinInfo |
|
146 |
withCheck:false |
|
147 |
usingManager:nil |
|
148 |
confirmNewContainer:false. |
|
149 |
] ifCurtailed:[ |
|
150 |
self activityNotification:'Checkin of build-support files aborted - see Transcript'. |
|
151 |
]. |
|
152 |
||
2848 | 153 |
anyFailure ifTrue:[ |
154 |
self warn:'Checkin failed - see Transcript.'. |
|
155 |
self activityNotification:'Checkin of build-support files failed - see Transcript.'. |
|
156 |
] ifFalse:[ |
|
157 |
self activityNotification:'Build-support files checked into the repository.'. |
|
158 |
]. |
|
159 |
||
4277 | 160 |
"Created: / 05-12-2017 / 20:31:18 / cg" |
4282 | 161 |
"Modified: / 05-12-2017 / 23:32:16 / cg" |
2848 | 162 |
! |
163 |
||
164 |
checkinExtensionMethods:aCollectionOfMethods forPackage:aPackageID withInfo:aLogInfoOrStringOrNil |
|
165 |
"checkin a projects extensions into the source repository. |
|
166 |
If the argument, aLogInfoOrStringOrNil isNil, ask interactively for log-message." |
|
167 |
||
4277 | 168 |
^ self checkinExtensionMethods:aCollectionOfMethods forPackage:aPackageID withInfo:aLogInfoOrStringOrNil onBranch:nil |
169 |
||
170 |
"Modified: / 05-12-2017 / 20:13:21 / cg" |
|
171 |
! |
|
172 |
||
173 |
checkinExtensionMethods:aCollectionOfMethods forPackage:aPackageID withInfo:aLogInfoOrStringOrNil onBranch:branchNameOrNil |
|
174 |
"checkin a projects extensions into the source repository. |
|
175 |
If the argument, aLogInfoOrStringOrNil isNil, ask interactively for log-message." |
|
176 |
||
3133 | 177 |
|logMessage checkinInfo mgr pri module directory containerFileName extensionsSource| |
2848 | 178 |
|
179 |
"/ the following is wrong - must ask the projectDefinition !! |
|
180 |
aPackageID asPackageId projectDefinitionClass notNil ifTrue:[ |
|
181 |
mgr := self sourceCodeManagerFor:aPackageID asPackageId projectDefinitionClass. |
|
182 |
] ifFalse:[ |
|
183 |
mgr := self sourceCodeManagerFor:aCollectionOfMethods first mclass. |
|
184 |
]. |
|
185 |
mgr isNil ifTrue:[ ^ false ]. |
|
186 |
||
187 |
module := aPackageID asPackageId module. |
|
188 |
directory := aPackageID asPackageId directory. |
|
189 |
containerFileName := self nameOfExtensionsContainer. |
|
190 |
||
191 |
aLogInfoOrStringOrNil isNil ifTrue:[ |
|
192 |
checkinInfo := self getCheckinInfoFor:containerFileName allBold initialAnswer:nil. |
|
193 |
checkinInfo isNil ifTrue:[^ false]. |
|
194 |
logMessage := checkinInfo logMessage. |
|
195 |
] ifFalse:[ |
|
196 |
aLogInfoOrStringOrNil isString ifTrue:[ |
|
197 |
logMessage := aLogInfoOrStringOrNil |
|
198 |
] ifFalse:[ |
|
199 |
checkinInfo := aLogInfoOrStringOrNil. |
|
200 |
logMessage := checkinInfo logMessage. |
|
201 |
]. |
|
202 |
]. |
|
203 |
||
204 |
(mgr checkForExistingContainer:containerFileName inModule:module directory:directory) ifFalse:[ |
|
205 |
(self checkForExistingModule:module usingManager:mgr allowCreate:true) ifFalse:[^ false]. |
|
206 |
LastModule := module. |
|
207 |
||
208 |
(self checkForExistingModule:module directory:directory usingManager:mgr allowCreate:true) ifFalse:[^ false]. |
|
209 |
LastPackage := directory. |
|
210 |
||
211 |
(self checkForExistingModule:module directory:directory container:containerFileName usingManager:mgr allowCreate:true) ifFalse:[^ false]. |
|
212 |
]. |
|
213 |
||
214 |
self activityNotification:(resources string:'Checking in %1' with:containerFileName). |
|
215 |
pri := Processor activePriority. |
|
216 |
Processor activeProcess |
|
217 |
withPriority:pri-1 to:pri |
|
218 |
do:[ |
|
3133 | 219 |
extensionsSource := self sourceCodeForExtensions:aCollectionOfMethods package:aPackageID forManager:mgr. |
220 |
"Care for non-ASCII/non-ISO-8859 characters in extension methods" |
|
221 |
extensionsSource isWideString ifTrue:[ |
|
222 |
extensionsSource := '"{ Encoding: utf8 }"' , Character cr asString , Character cr asString , extensionsSource. |
|
223 |
extensionsSource := extensionsSource utf8Encoded. |
|
224 |
]. |
|
2848 | 225 |
|
226 |
UserInformation handle:[:ex | |
|
227 |
Transcript showCR:ex description. |
|
228 |
ex proceed. |
|
229 |
] do:[ |
|
230 |
Transcript showCR:('checking in ',containerFileName,' ...'). |
|
231 |
(mgr |
|
232 |
checkin:containerFileName |
|
3133 | 233 |
text:extensionsSource |
2848 | 234 |
directory:directory |
235 |
module:module |
|
236 |
logMessage:logMessage |
|
237 |
force:false) |
|
238 |
ifFalse:[ |
|
239 |
Transcript showCR:'Checkin of ''' , containerFileName , ''' failed'. |
|
240 |
self warn:'Checkin of ''' , containerFileName allBold , ''' failed'. |
|
241 |
^ false. |
|
242 |
]. |
|
243 |
checkinInfo notNil ifTrue:[ |
|
244 |
|path| |
|
245 |
||
246 |
path := (module, '/', directory, '/', containerFileName). |
|
247 |
checkinInfo isStable ifTrue:[ |
|
248 |
"set stable tag for class that has been checked in" |
|
249 |
self tagPath:path as:#stable usingManager:mgr. |
|
250 |
]. |
|
251 |
checkinInfo tagIt ifTrue:[ |
|
252 |
"set an additional tag for class that has been checked in" |
|
253 |
self tagPath:path as:(checkinInfo tag) usingManager:mgr. |
|
254 |
]. |
|
255 |
]. |
|
256 |
mgr postCheckInExtensionsForPackage:aPackageID |
|
257 |
]. |
|
258 |
]. |
|
259 |
^ true |
|
260 |
||
4277 | 261 |
"Created: / 05-12-2017 / 20:12:50 / cg" |
2848 | 262 |
! |
263 |
||
4282 | 264 |
checkinPackage:packageToCheckIn classes:doClasses extensions:doExtensions buildSupport:doBuildSupportFiles askForMethodsInOtherPackages:askForMethodsInOtherPackages onBranch:branchNameOrNil |
265 |
|mgr classesToCheckIn extensionMethodsToCheckIn methodsInPrjDef |
|
2848 | 266 |
methodsInOtherPackages looseMethods otherPackages |
3507
ef4dad1a2b32
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3400
diff
changeset
|
267 |
msg classesInChangeSet newClasses checkinInfo originalCheckinInfo classesToTag |
ef4dad1a2b32
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3400
diff
changeset
|
268 |
answer| |
2848 | 269 |
|
270 |
mgr := self sourceCodeManagerFor: packageToCheckIn. |
|
271 |
||
272 |
classesToCheckIn := IdentitySet new. |
|
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
273 |
classesInChangeSet := IdentitySet new. |
4282 | 274 |
extensionMethodsToCheckIn := IdentitySet new. |
2848 | 275 |
methodsInOtherPackages := IdentitySet new. |
276 |
looseMethods := IdentitySet new. |
|
277 |
||
3164
e54571b3021f
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
278 |
"/ 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
|
279 |
(doClasses or:[doExtensions]) ifTrue:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
280 |
Smalltalk allClassesDo:[:aClass | |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
281 |
|owner classPackage| |
3141
25cd1cd26450
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3133
diff
changeset
|
282 |
|
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
283 |
(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
|
284 |
classPackage := aClass topOwningClass package |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
285 |
] ifFalse:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
286 |
classPackage := aClass package |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
287 |
]. |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
288 |
(classPackage = packageToCheckIn) ifTrue:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
289 |
classesToCheckIn add:aClass. |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
290 |
]. |
3164
e54571b3021f
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
291 |
|
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
292 |
doExtensions ifTrue:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
293 |
aClass isMeta ifFalse:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
294 |
"/ ... 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
|
295 |
(classesToCheckIn includes:aClass) ifFalse:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
296 |
aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
297 |
"/ methods in this project ... |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
298 |
(mthd package = packageToCheckIn) ifTrue:[ |
4282 | 299 |
extensionMethodsToCheckIn add:mthd |
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
300 |
] |
3164
e54571b3021f
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
301 |
] |
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
302 |
]. |
3164
e54571b3021f
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
303 |
]. |
e54571b3021f
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
304 |
]. |
e54571b3021f
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
305 |
]. |
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
306 |
|
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
307 |
"/ 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
|
308 |
"/ 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
|
309 |
"/ 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
|
310 |
classesInChangeSet := ChangeSet current selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:classesToCheckIn. |
2848 | 311 |
]. |
312 |
||
313 |
doExtensions ifTrue:[ |
|
4282 | 314 |
extensionMethodsToCheckIn notEmpty ifTrue:[ |
2848 | 315 |
doClasses ifTrue:[ |
316 |
msg := '%1 classes (%4 changed) '. |
|
317 |
] ifFalse:[ |
|
318 |
msg := ''. |
|
319 |
]. |
|
320 |
doExtensions ifTrue:[ |
|
321 |
doClasses ifTrue:[ |
|
322 |
msg := msg , 'and '. |
|
323 |
]. |
|
324 |
msg := msg , '%2 extensions '. |
|
325 |
]. |
|
326 |
msg := msg , 'of project "%3"'. |
|
327 |
||
328 |
checkinInfo := self |
|
329 |
getCheckinInfoFor:(msg |
|
330 |
bindWith:classesToCheckIn size |
|
4282 | 331 |
with:extensionMethodsToCheckIn size |
2848 | 332 |
with:packageToCheckIn allBold |
333 |
with:classesInChangeSet size) |
|
334 |
initialAnswer:nil |
|
3141
25cd1cd26450
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3133
diff
changeset
|
335 |
withQuickOption:(classesToCheckIn size > 0) |
25cd1cd26450
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3133
diff
changeset
|
336 |
withValidateConsistencyOption:true. |
2848 | 337 |
checkinInfo isNil ifTrue:[ |
338 |
^ self. |
|
339 |
]. |
|
3145
e59d8d1ab71a
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3141
diff
changeset
|
340 |
|
e59d8d1ab71a
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3141
diff
changeset
|
341 |
checkinInfo validateConsistency ifTrue:[ |
3772
399ff1b46d41
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3651
diff
changeset
|
342 |
|setInProjectDef setForCheckin onlyInPrjDef onlyForCheckin moreInfo| |
399ff1b46d41
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3651
diff
changeset
|
343 |
|
3145
e59d8d1ab71a
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3141
diff
changeset
|
344 |
self validateConsistencyOfPackage:packageToCheckIn doClasses:doClasses doExtensions:doExtensions. |
3196
d91dbd26f40c
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
345 |
"/ could have changed/recompiled methods... |
d91dbd26f40c
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
346 |
"/ mhmh - should we checkin what is specified in the prj-def, |
d91dbd26f40c
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
347 |
"/ 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
|
348 |
|
d91dbd26f40c
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
349 |
methodsInPrjDef := packageToCheckIn asPackageId projectDefinitionClass extensionMethods. |
d91dbd26f40c
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
350 |
methodsInPrjDef := methodsInPrjDef reject:[:m | m isNil]. |
4282 | 351 |
(setInProjectDef := methodsInPrjDef asSet) ~= (setForCheckin := extensionMethodsToCheckIn asSet) ifTrue:[ |
3772
399ff1b46d41
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3651
diff
changeset
|
352 |
onlyInPrjDef := setInProjectDef copy removeAllFoundIn:setForCheckin. |
399ff1b46d41
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3651
diff
changeset
|
353 |
onlyForCheckin := setForCheckin copy removeAllFoundIn:setInProjectDef. |
399ff1b46d41
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3651
diff
changeset
|
354 |
moreInfo := ''. |
399ff1b46d41
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3651
diff
changeset
|
355 |
onlyInPrjDef notEmpty ifTrue:[ |
399ff1b46d41
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3651
diff
changeset
|
356 |
moreInfo := moreInfo , '\Only in Project: '. |
3830
2e140590a5f3
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3819
diff
changeset
|
357 |
moreInfo := moreInfo , (((onlyInPrjDef asOrderedCollection copyTo:(5 min:onlyInPrjDef size)) |
2e140590a5f3
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3819
diff
changeset
|
358 |
collect:#whoString) asStringWith:', '). |
3772
399ff1b46d41
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3651
diff
changeset
|
359 |
onlyInPrjDef size > 5 ifTrue:[ moreInfo := moreInfo , '...' ]. |
399ff1b46d41
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3651
diff
changeset
|
360 |
]. |
399ff1b46d41
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3651
diff
changeset
|
361 |
onlyForCheckin notEmpty ifTrue:[ |
399ff1b46d41
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3651
diff
changeset
|
362 |
moreInfo := moreInfo , '\Only in Image: '. |
3830
2e140590a5f3
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3819
diff
changeset
|
363 |
moreInfo := moreInfo , (((onlyForCheckin asOrderedCollection copyTo:(5 min:onlyForCheckin size)) |
2e140590a5f3
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3819
diff
changeset
|
364 |
collect:#whoString) asStringWith:', '). |
3772
399ff1b46d41
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3651
diff
changeset
|
365 |
onlyForCheckin size > 5 ifTrue:[ moreInfo := moreInfo , '...' ]. |
399ff1b46d41
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3651
diff
changeset
|
366 |
]. |
399ff1b46d41
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3651
diff
changeset
|
367 |
moreInfo notEmpty ifTrue:[ (moreInfo := moreInfo , '\') withCRs ]. |
399ff1b46d41
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3651
diff
changeset
|
368 |
self halt. |
3507
ef4dad1a2b32
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3400
diff
changeset
|
369 |
answer:= Dialog |
3772
399ff1b46d41
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3651
diff
changeset
|
370 |
confirmWithCancel:('The set of methods in image is different from what is specified in the project definition.\%1\You should probably make sure that all extension methods are all associated to the correct package.\\Check in image methods (%2) or definition methods (%3)?' |
399ff1b46d41
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3651
diff
changeset
|
371 |
bindWith: moreInfo |
4282 | 372 |
with: extensionMethodsToCheckIn size |
3651
d58c178282c0
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3603
diff
changeset
|
373 |
with: methodsInPrjDef size) withCRs |
3507
ef4dad1a2b32
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3400
diff
changeset
|
374 |
labels:#('Image Methods' 'Definition Methods' 'Cancel') |
ef4dad1a2b32
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3400
diff
changeset
|
375 |
values:#(true false nil) |
ef4dad1a2b32
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3400
diff
changeset
|
376 |
default:nil. |
ef4dad1a2b32
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3400
diff
changeset
|
377 |
|
ef4dad1a2b32
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3400
diff
changeset
|
378 |
"/ answer := Dialog |
ef4dad1a2b32
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3400
diff
changeset
|
379 |
"/ 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)?' |
4282 | 380 |
"/ bindWith: extensionMethodsToCheckIn size |
3507
ef4dad1a2b32
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3400
diff
changeset
|
381 |
"/ with: methodsInPrjDef size) |
ef4dad1a2b32
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3400
diff
changeset
|
382 |
"/ yesLabel:'Image Methods' |
ef4dad1a2b32
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3400
diff
changeset
|
383 |
"/ noLabel:'Definition Methods'. |
ef4dad1a2b32
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3400
diff
changeset
|
384 |
answer isNil ifTrue:[AbortOperationRequest raise]. |
ef4dad1a2b32
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3400
diff
changeset
|
385 |
answer ifFalse:[ |
4282 | 386 |
extensionMethodsToCheckIn := methodsInPrjDef. |
3196
d91dbd26f40c
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
387 |
]. |
d91dbd26f40c
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3172
diff
changeset
|
388 |
]. |
3145
e59d8d1ab71a
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3141
diff
changeset
|
389 |
]. |
e59d8d1ab71a
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3141
diff
changeset
|
390 |
|
3250
fe3f6d8ead83
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3196
diff
changeset
|
391 |
"/ also need the extensionVersion methods in the projectDefinition class, |
fe3f6d8ead83
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3196
diff
changeset
|
392 |
"/ 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
|
393 |
"/ CVS id for the extensions container, not for the projDefinition container. |
fe3f6d8ead83
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3196
diff
changeset
|
394 |
packageToCheckIn asPackageId projectDefinitionClass theMetaclass selectorsAndMethodsDo:[:sel :mthd | |
fe3f6d8ead83
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3196
diff
changeset
|
395 |
(AbstractSourceCodeManager isExtensionsVersionMethodSelector:sel) ifTrue:[ |
4282 | 396 |
extensionMethodsToCheckIn add:mthd |
3250
fe3f6d8ead83
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3196
diff
changeset
|
397 |
]. |
fe3f6d8ead83
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3196
diff
changeset
|
398 |
]. |
fe3f6d8ead83
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3196
diff
changeset
|
399 |
|
2848 | 400 |
(self |
4282 | 401 |
checkinExtensionMethods:extensionMethodsToCheckIn |
2848 | 402 |
forPackage:packageToCheckIn |
4277 | 403 |
withInfo:checkinInfo |
404 |
onBranch:branchNameOrNil) |
|
2848 | 405 |
ifFalse:[ |
406 |
Dialog warn:(resources string:'Could not check in extensions for project %1' with:packageToCheckIn). |
|
407 |
^ self. |
|
408 |
] |
|
409 |
] ifFalse:[ |
|
410 |
"/ there may have been extension-methods previously - if so, remove them |
|
411 |
(mgr |
|
412 |
checkForExistingContainer:'extensions.st' inPackage:packageToCheckIn) |
|
413 |
ifTrue:[ |
|
414 |
(self |
|
415 |
checkinExtensionMethods:#() |
|
416 |
forPackage:packageToCheckIn |
|
4277 | 417 |
withInfo:'No extensions any more' |
418 |
onBranch:branchNameOrNil) |
|
2848 | 419 |
ifFalse:[ |
420 |
Dialog warn:(resources string:'Could not check in extensions for project %1' with:packageToCheckIn). |
|
421 |
^ self. |
|
422 |
] |
|
423 |
] |
|
424 |
]. |
|
425 |
]. |
|
426 |
||
427 |
checkinInfo isNil ifTrue:[ |
|
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
428 |
|infoString| |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
429 |
|
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
430 |
doExtensions ifTrue:[ |
4282 | 431 |
extensionMethodsToCheckIn size == 0 ifTrue:[ |
432 |
infoString := '"%3": %1 classes (%4 changed)'. |
|
433 |
] ifFalse:[ |
|
434 |
infoString := '"%3": %1 classes (%4 changed), %2 extensions'. |
|
435 |
]. |
|
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
436 |
] ifFalse:[doClasses ifTrue:[ |
4282 | 437 |
infoString := '"%3": %1 classes (%4 changed)'. |
438 |
] ifFalse:[doBuildSupportFiles ifTrue:[ |
|
439 |
infoString := '"%3": build support files'. |
|
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
440 |
] ifFalse:[ |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
441 |
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
|
442 |
]]]. |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
443 |
|
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
444 |
infoString := infoString |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
445 |
bindWith:classesToCheckIn size |
4282 | 446 |
with:extensionMethodsToCheckIn size |
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
447 |
with:packageToCheckIn allBold |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
448 |
with:classesInChangeSet size. |
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
449 |
|
4271 | 450 |
mgr notNil ifTrue:[ |
451 |
mgr isCVS ifTrue:[ |
|
452 |
|repos| |
|
453 |
||
454 |
repos := mgr repositoryForPackage:packageToCheckIn. |
|
455 |
repos notNil ifTrue:[ |
|
456 |
infoString := infoString,Character cr,('CVS Repository: "%1"' bindWith:repos) |
|
457 |
]. |
|
458 |
]. |
|
459 |
]. |
|
4282 | 460 |
branchNameOrNil notNil ifTrue:[ |
461 |
infoString := infoString,Character cr,('Branch: "%1"' bindWith:branchNameOrNil) |
|
462 |
]. |
|
4271 | 463 |
|
2848 | 464 |
checkinInfo := self |
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
465 |
getCheckinInfoFor:infoString |
2848 | 466 |
initialAnswer:nil |
3141
25cd1cd26450
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3133
diff
changeset
|
467 |
withQuickOption:(classesToCheckIn size > 0) |
25cd1cd26450
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3133
diff
changeset
|
468 |
withValidateConsistencyOption:true. |
2848 | 469 |
checkinInfo isNil ifTrue:[ |
470 |
^ self. |
|
471 |
]. |
|
3145
e59d8d1ab71a
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3141
diff
changeset
|
472 |
checkinInfo validateConsistency ifTrue:[ |
e59d8d1ab71a
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3141
diff
changeset
|
473 |
self validateConsistencyOfPackage:packageToCheckIn doClasses:doClasses doExtensions:doExtensions. |
e59d8d1ab71a
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3141
diff
changeset
|
474 |
]. |
3141
25cd1cd26450
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3133
diff
changeset
|
475 |
]. |
25cd1cd26450
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3133
diff
changeset
|
476 |
|
2848 | 477 |
checkinInfo quickCheckIn ifTrue:[ |
478 |
(checkinInfo isStable or:[checkinInfo tagIt]) ifTrue:[ |
|
479 |
classesToTag := classesToCheckIn. |
|
480 |
originalCheckinInfo := checkinInfo. |
|
3367
dc9d785a4ca7
Open a checkin info dialog for build support files checkin
Stefan Vogel <sv@exept.de>
parents:
3362
diff
changeset
|
481 |
checkinInfo := checkinInfo deepCopy. |
2848 | 482 |
checkinInfo isStable:false. |
483 |
checkinInfo tag:nil. |
|
484 |
]. |
|
3164
e54571b3021f
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
485 |
"/ not only the one's in the changeSet; |
e54571b3021f
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
486 |
"/ also those which have not been checked in before. |
e54571b3021f
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3145
diff
changeset
|
487 |
newClasses := classesToCheckIn select:[:class | (class revisionOfManager:mgr) isNil ]. |
4277 | 488 |
classesToCheckIn := Set new. |
489 |
classesToCheckIn addAll:classesInChangeSet; addAll:newClasses. |
|
2848 | 490 |
]. |
491 |
||
492 |
"/ check if any of the classes contains methods for other packages ... |
|
493 |
classesToCheckIn do:[:eachClass | |
|
494 |
eachClass instAndClassMethodsDo:[:eachMethod | |
|
495 |
|mPgk| |
|
496 |
||
497 |
mPgk := eachMethod package. |
|
498 |
(mPgk = packageToCheckIn) ifFalse:[ |
|
499 |
mPgk == PackageId noProjectID ifTrue:[ |
|
500 |
looseMethods add:eachMethod |
|
501 |
] ifFalse:[ |
|
502 |
methodsInOtherPackages add:eachMethod |
|
503 |
] |
|
504 |
] |
|
505 |
]. |
|
506 |
]. |
|
507 |
||
508 |
askForMethodsInOtherPackages ifTrue:[ |
|
509 |
methodsInOtherPackages notEmpty ifTrue:[ |
|
4004 | 510 |
|package2| |
511 |
||
2848 | 512 |
otherPackages := Set new. |
513 |
methodsInOtherPackages do:[:eachMethod | otherPackages add:eachMethod package]. |
|
514 |
||
515 |
methodsInOtherPackages size == 1 ifTrue:[ |
|
516 |
msg := 'The ''%4'' method in ''%5'' is contained in the ''%2'' package.'. |
|
517 |
msg := msg , '\\This method will remain in its package.'. |
|
518 |
] ifFalse:[ |
|
519 |
otherPackages size == 1 ifTrue:[ |
|
3651
d58c178282c0
class: SourceCodeManagerUtilitiesForContainerBasedManagers
Claus Gittinger <cg@exept.de>
parents:
3603
diff
changeset
|
520 |
msg := 'The %1 methods from the %2 package will remain in their package.' |
2848 | 521 |
] ifFalse:[ |
4004 | 522 |
package2 := otherPackages second allBold. |
523 |
otherPackages size == 2 ifTrue:[ |
|
524 |
msg := 'The %1 methods from %3 other packages (%2, %6) will remain in their packages.'. |
|
525 |
] ifFalse:[ |
|
526 |
msg := 'The %1 methods from %3 other packages (%2, %6...) will remain in their packages.'. |
|
527 |
]. |
|
2848 | 528 |
]. |
4004 | 529 |
msg := msg , '\\Hint: if these are meant to belong to the %7 package,'. |
2848 | 530 |
msg := msg , '\move them first, then repeat the checkin operation.'. |
531 |
]. |
|
532 |
msg := msg withCRs. |
|
533 |
msg := msg bindWith:methodsInOtherPackages size |
|
534 |
with:otherPackages first allBold |
|
535 |
with:otherPackages size |
|
536 |
with:methodsInOtherPackages first selector allBold |
|
4004 | 537 |
with:methodsInOtherPackages first mclass name allBold |
538 |
with:package2 |
|
539 |
with:packageToCheckIn. |
|
4244 | 540 |
(Dialog confirm:msg yesLabel:'OK' noLabel:(resources string:'Cancel')) ifFalse:[^ self]. |
2848 | 541 |
]. |
542 |
]. |
|
543 |
||
544 |
doClasses ifTrue:[ |
|
545 |
classesToCheckIn notEmpty ifTrue:[ |
|
546 |
looseMethods notEmpty ifTrue:[ |
|
547 |
looseMethods size == 1 ifTrue:[ |
|
548 |
msg := 'The ''%2'' method in ''%3'' is unassigned (loose).'. |
|
549 |
msg := msg , '\\If you proceed, this method will be moved to the ''%4'' package'. |
|
550 |
msg := msg , '\\Hint: if this is meant to be an extension of another package,'. |
|
551 |
msg := msg , '\cancel and move it to the appropriate package first.'. |
|
552 |
] ifFalse:[ |
|
553 |
msg := 'There are %1 unassigned (loose) methods in classes from this project.'. |
|
554 |
msg := msg , '\\If you proceed, those will be moved to the ''%4'' package ?'. |
|
555 |
msg := msg , '\\Hint: if these are meant to be extensions of another package,'. |
|
556 |
msg := msg , '\cancel and move them to the appropriate package first.'. |
|
557 |
]. |
|
558 |
doClasses ifTrue:[ |
|
559 |
msg := msg , '\\If you answer with "No" here, you will be asked for each class individually.'. |
|
560 |
]. |
|
561 |
msg := msg withCRs. |
|
562 |
msg := msg bindWith:looseMethods size |
|
563 |
with:(looseMethods isEmpty ifTrue:[''] ifFalse:[looseMethods first selector allBold]) |
|
564 |
with:(looseMethods isEmpty ifTrue:[''] ifFalse:[looseMethods first mclass name allBold]) |
|
565 |
with:packageToCheckIn allBold. |
|
566 |
(Dialog confirm:msg noLabel:(resources string:'Cancel')) ifFalse:[^ self]. |
|
567 |
||
568 |
looseMethods do:[:mthd | |
|
569 |
mthd package:packageToCheckIn |
|
570 |
]. |
|
571 |
]. |
|
4277 | 572 |
self checkinClasses:classesToCheckIn withInfo:checkinInfo onBranch:branchNameOrNil. |
2848 | 573 |
]. |
574 |
||
575 |
originalCheckinInfo notNil ifTrue:[ |
|
576 |
originalCheckinInfo isStable ifTrue:[ |
|
4282 | 577 |
self tagClasses:classesToTag as:#stable. |
578 |
"/ classesToTag do:[:eachClass | |
|
579 |
"/ self tagClass:eachClass as:#stable |
|
580 |
"/ ]. |
|
2848 | 581 |
]. |
582 |
originalCheckinInfo tagIt ifTrue:[ |
|
4282 | 583 |
self tagClasses:classesToTag as:(originalCheckinInfo tag). |
584 |
"/ classesToTag do:[:eachClass | |
|
585 |
"/ self tagClass:eachClass as:(originalCheckinInfo tag) |
|
586 |
"/ ]. |
|
2848 | 587 |
]. |
588 |
]. |
|
589 |
]. |
|
590 |
||
4282 | 591 |
doBuildSupportFiles ifTrue:[ |
4277 | 592 |
self checkinBuildSupportFilesForPackage:packageToCheckIn withInfo:(originalCheckinInfo ? checkinInfo) onBranch:branchNameOrNil. |
2848 | 593 |
]. |
594 |
||
4277 | 595 |
"Created: / 05-12-2017 / 20:03:19 / cg" |
4282 | 596 |
"Modified: / 05-12-2017 / 23:15:52 / cg" |
2848 | 597 |
! ! |
598 |
||
599 |
!SourceCodeManagerUtilitiesForContainerBasedManagers class methodsFor:'documentation'! |
|
600 |
||
601 |
version |
|
3905 | 602 |
^ '$Header$' |
2848 | 603 |
! |
604 |
||
605 |
version_CVS |
|
3905 | 606 |
^ '$Header$' |
2848 | 607 |
! ! |
3133 | 608 |