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