--- a/SourceCodeManagerUtilitiesForContainerBasedManagers.st Wed Dec 18 19:03:56 2019 +0100
+++ b/SourceCodeManagerUtilitiesForContainerBasedManagers.st Wed Dec 18 19:03:59 2019 +0100
@@ -38,15 +38,7 @@
!SourceCodeManagerUtilitiesForContainerBasedManagers methodsFor:'utilities-cvs'!
-checkinBuildSupportFilesForPackage:packageID withInfo:checkinInfo
- ^ self checkinBuildSupportFilesForPackage:packageID withInfo:checkinInfo onBranch:nil
-
- "Created: / 09-08-2006 / 18:59:42 / fm"
- "Modified: / 12-10-2011 / 11:36:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 05-12-2017 / 20:31:34 / cg"
-!
-
-checkinBuildSupportFilesForPackage:packageID withInfo:checkinInfo onBranch:branchNameOrNil
+checkinBuildSupportFilesForPackage:packageID winRCOnly:winRCOnly withInfo:checkinInfo onBranch:branchNameOrNil
|anyFailure module directory mgr defClass checkedInFiles|
mgr := self sourceCodeManagerFor: packageID.
@@ -61,98 +53,104 @@
module := packageID asPackageId module.
directory := packageID asPackageId directory.
- self activityNotification:(resources string:'Checking in build-support files...').
+ self activityNotification:(resources string:(winRCOnly ifTrue:['Checking in winRC files...'] ifFalse:['Checking in build-support files...'])).
(mgr checkForExistingModule:module directory:directory) ifFalse:[
mgr createModule:module directory:directory
].
+ defClass
+ forEachFileNameForWhich:[:fn |
+ winRCOnly not
+ or:[ fn asFilename hasSuffix:'rc' ]
+ ]
+ withGeneratedContentsDo:[:fileName :fileContents |
+ |realFileName realDirectory|
- defClass forEachFileNameAndGeneratedContentsDo:[:fileName :fileContents |
- |realFileName realDirectory|
+ "/ care for subdirectories
+ (fileName includes:$/) ifTrue:[
+ realDirectory := (directory asFilename construct:(fileName asFilename directoryName)) name.
+ realFileName := fileName asFilename baseName.
+ ] ifFalse:[
+ realDirectory := directory.
+ realFileName := fileName.
+ ].
+ realDirectory := realDirectory replaceAll:$\ with:$/.
+
+ self activityNotification:(resources string:'Checking in %1...' with:realFileName).
+
+ UserInformation
+ handle:[:ex | Transcript showCR:ex description ]
+ do:[
+ (mgr isContainerBased
+ and:[(mgr checkForExistingContainer:realFileName inModule:module directory:realDirectory) not]
+ ) ifTrue:[
+ "/ a new file
+ realDirectory ~= directory ifTrue:[
+ (mgr checkForExistingModule:module directory:realDirectory) ifFalse:[
+ mgr createModule:module directory:realDirectory
+ ].
+ ].
+ [:exit |
+ |answer|
- "/ care for subdirectories
- (fileName includes:$/) ifTrue:[
- realDirectory := (directory asFilename construct:(fileName asFilename directoryName)) name.
- realFileName := fileName asFilename baseName.
- ] ifFalse:[
- realDirectory := directory.
- realFileName := fileName.
- ].
- realDirectory := realDirectory replaceAll:$\ with:$/.
+ (mgr
+ createContainerForText:fileContents
+ inModule:module
+ package:realDirectory
+ container:realFileName) ifTrue:[
+ "success"
+ checkedInFiles add:fileName.
+ exit value:nil
+ ].
+
+ answer := Dialog
+ confirmWithRaiseAbortOnCancel:(resources
+ stringWithCRs:'Cannot create new container: ''%3'' (in %1:%2).\\Retry?'
+ with:module
+ with:realDirectory
+ with:realFileName).
- self activityNotification:(resources string:'Checking in %1...' with:realFileName).
-
- UserInformation
- handle:[:ex | Transcript showCR:ex description ]
- do:[
- (mgr isContainerBased
- and:[(mgr checkForExistingContainer:realFileName inModule:module directory:realDirectory) not]
- ) ifTrue:[
- "/ a new file
- realDirectory ~= directory ifTrue:[
- (mgr checkForExistingModule:module directory:realDirectory) ifFalse:[
- mgr createModule:module directory:realDirectory
+ answer == false ifTrue:[ exit value:nil ].
+ ] loopWithExit.
+ ] ifFalse:[
+ "/ an existing file
+ (mgr
+ checkin:realFileName
+ text:fileContents
+ directory:realDirectory
+ module:module
+ logMessage:checkinInfo logMessage
+ force:false
+ onBranch:branchNameOrNil
+ ) ifTrue:[
+ checkinInfo isStable ifTrue:[
+ self tagPath:(module, '/', realDirectory, '/', realFileName) as:#stable usingManager:mgr.
+ ].
+ checkinInfo tagIt ifTrue:[
+ self tagPath:(module, '/', realDirectory, '/', realFileName) as:checkinInfo tag usingManager:mgr.
+ ].
+ checkedInFiles add:fileName.
+ ] ifFalse:[
+ Transcript showCR:'checkin of %1 failed' with:realFileName.
+ anyFailure := true.
].
].
- [:exit |
- |answer|
-
- (mgr
- createContainerForText:fileContents
- inModule:module
- package:realDirectory
- container:realFileName) ifTrue:[
- "success"
- checkedInFiles add:fileName.
- exit value:nil
- ].
-
- answer := Dialog
- confirmWithRaiseAbortOnCancel:(resources
- stringWithCRs:'Cannot create new container: ''%3'' (in %1:%2).\\Retry?'
- with:module
- with:realDirectory
- with:realFileName).
+ ].
+ ].
- answer == false ifTrue:[ exit value:nil ].
- ] loopWithExit.
- ] ifFalse:[
- "/ an existing file
- (mgr
- checkin:realFileName
- text:fileContents
- directory:realDirectory
- module:module
- logMessage:checkinInfo logMessage
- force:false
- onBranch:branchNameOrNil
- ) ifTrue:[
- checkinInfo isStable ifTrue:[
- self tagPath:(module, '/', realDirectory, '/', realFileName) as:#stable usingManager:mgr.
- ].
- checkinInfo tagIt ifTrue:[
- self tagPath:(module, '/', realDirectory, '/', realFileName) as:checkinInfo tag usingManager:mgr.
- ].
- checkedInFiles add:fileName.
- ] ifFalse:[
- Transcript showCR:'checkin of %1 failed' with:realFileName.
- anyFailure := true.
- ].
- ].
- ].
+ winRCOnly ifFalse:[
+ defClass instAndClassMethodsDo:[:m | m package:defClass package].
+ [
+ self
+ checkinClasses:(Array with:defClass)
+ withInfo:checkinInfo
+ withCheck:false
+ usingManager:nil
+ confirmNewContainer:false.
+ ] ifCurtailed:[
+ self activityNotification:'Checkin of build-support files aborted - see Transcript'.
+ ].
].
- defClass instAndClassMethodsDo:[:m | m package:defClass package].
- [
- self
- checkinClasses:(Array with:defClass)
- withInfo:checkinInfo
- withCheck:false
- usingManager:nil
- confirmNewContainer:false.
- ] ifCurtailed:[
- self activityNotification:'Checkin of build-support files aborted - see Transcript'.
- ].
-
anyFailure ifTrue:[
self warn:'Checkin failed - see Transcript.'.
self activityNotification:'Checkin of build-support files failed - see Transcript.'.
@@ -169,6 +167,21 @@
"Modified: / 15-02-2019 / 09:36:53 / Claus Gittinger"
!
+checkinBuildSupportFilesForPackage:packageID withInfo:checkinInfo
+ ^ self checkinBuildSupportFilesForPackage:packageID withInfo:checkinInfo onBranch:nil
+
+ "Created: / 09-08-2006 / 18:59:42 / fm"
+ "Modified: / 12-10-2011 / 11:36:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 05-12-2017 / 20:31:34 / cg"
+!
+
+checkinBuildSupportFilesForPackage:packageID withInfo:checkinInfo onBranch:branchNameOrNil
+ ^ self
+ checkinBuildSupportFilesForPackage:packageID winRCOnly:false
+ withInfo:checkinInfo onBranch:branchNameOrNil
+
+!
+
checkinExtensionMethods:aCollectionOfMethods forPackage:aPackageID withInfo:aLogInfoOrStringOrNil
"checkin a projects extensions into the source repository.
If the argument, aLogInfoOrStringOrNil isNil, ask interactively for log-message."
@@ -269,7 +282,7 @@
"Created: / 05-12-2017 / 20:12:50 / cg"
!
-checkinPackage:packageToCheckIn classes:doClasses extensions:doExtensions buildSupport:doBuildSupportFiles askForMethodsInOtherPackages:askForMethodsInOtherPackages onBranch:branchNameOrNil
+checkinPackage:packageToCheckIn classes:doClasses extensions:doExtensions buildSupport:doBuildSupportFiles winRCOnly:winRCOnly askForMethodsInOtherPackages:askForMethodsInOtherPackages onBranch:branchNameOrNil
|mgr classesToCheckIn extensionMethodsToCheckIn methodsInPrjDef
methodsInOtherPackages looseMethods otherPackages
msg classesInChangeSet newClasses checkinInfo originalCheckinInfo classesToTag
@@ -442,13 +455,15 @@
] ifFalse:[
infoString := '"%3": %1 classes (%4 changed), %2 extensions'.
].
- ] ifFalse:[doClasses ifTrue:[
+ ] ifFalse:[ doClasses ifTrue:[
infoString := '"%3": %1 classes (%4 changed)'.
- ] ifFalse:[doBuildSupportFiles ifTrue:[
+ ] ifFalse:[ doBuildSupportFiles ifTrue:[
infoString := '"%3": build support files'.
+ ] ifFalse:[ winRCOnly ifTrue:[
+ infoString := 'winRC file(s) regenerated'.
] ifFalse:[
infoString := 'I don''t know what I am doing'.
- ]]].
+ ]]]].
infoString := infoString
bindWith:classesToCheckIn size
@@ -598,7 +613,9 @@
].
doBuildSupportFiles ifTrue:[
- self checkinBuildSupportFilesForPackage:packageToCheckIn withInfo:(originalCheckinInfo ? checkinInfo) onBranch:branchNameOrNil.
+ self
+ checkinBuildSupportFilesForPackage:packageToCheckIn winRCOnly:winRCOnly
+ withInfo:(originalCheckinInfo ? checkinInfo) onBranch:branchNameOrNil.
].
"Created: / 05-12-2017 / 20:03:19 / cg"