--- a/SourceCodeManagerUtilitiesForContainerBasedManagers.st Thu Aug 01 10:23:03 2013 +0100
+++ b/SourceCodeManagerUtilitiesForContainerBasedManagers.st Thu Aug 08 11:07:27 2013 +0100
@@ -36,7 +36,9 @@
!SourceCodeManagerUtilitiesForContainerBasedManagers methodsFor:'utilities-cvs'!
-checkinBuildSupportFilesForPackage:packageID
+
+
+checkinBuildSupportFilesForPackage:packageID withInfo:checkinInfo
|anyFailure module directory mgr defClass |
mgr := self sourceCodeManagerFor: packageID.
@@ -74,9 +76,8 @@
handle:[:ex | Transcript showCR:ex description ]
do:[
(mgr isContainerBased
- and:[
- (mgr checkForExistingContainer:realFileName inModule:module directory:realDirectory) not
- ]) ifTrue:[
+ and:[(mgr checkForExistingContainer:realFileName inModule:module directory:realDirectory) not]
+ ) ifTrue:[
realDirectory ~= directory ifTrue:[
(mgr checkForExistingModule:module directory:realDirectory) ifFalse:[
mgr createModule:module directory:realDirectory
@@ -105,12 +106,19 @@
text:fileContents
directory:realDirectory
module:module
- logMessage:'automatically generated by browser'
- force:false)
- ifFalse:[
- Transcript showCR:'checkin of ' , realFileName , ' failed'.
- anyFailure := true.
- ].
+ logMessage:checkinInfo logMessage
+ force:false
+ ) 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.
+ ].
+ ] ifFalse:[
+ Transcript showCR:'checkin of ' , realFileName , ' failed'.
+ anyFailure := true.
+ ].
].
].
].
@@ -119,7 +127,7 @@
self
checkinClasses:(Array with:defClass)
- withInfo:'automatic checkIn'
+ withInfo:checkinInfo
withCheck:false.
@@ -247,13 +255,14 @@
checkinState := mgr checkinClass:aClass logMessage:logMessage
] on:SourceCodeManagerError do:[:ex|
cause := ex description.
- ex proceed.
+ "/ ex proceed.
].
checkinState ifFalse:[
Transcript showCR:'checkin of ''' , aClass name , ''' failed - ', cause.
self warn:(resources stringWithCRs:'Checkin of "%1" failed\\' with:aClass name allBold),cause.
- ^ false.
+ AbortOperationRequest raise.
+ "/ ^ false.
].
checkinInfo notNil ifTrue:[
checkinInfo isStable ifTrue:[
@@ -508,43 +517,46 @@
mgr := self sourceCodeManagerFor: packageToCheckIn.
classesToCheckIn := IdentitySet new.
+ classesInChangeSet := IdentitySet new.
methodsToCheckIn := IdentitySet new.
methodsInOtherPackages := IdentitySet new.
looseMethods := IdentitySet new.
"/ collect classes and individual methods...
- Smalltalk allClassesDo:[:aClass |
- |owner classPackage|
+ (doClasses or:[doExtensions]) ifTrue:[
+ Smalltalk allClassesDo:[:aClass |
+ |owner classPackage|
- (owner := aClass owningClass) notNil ifTrue:[
- classPackage := aClass topOwningClass package
- ] ifFalse:[
- classPackage := aClass package
- ].
- (classPackage = packageToCheckIn) ifTrue:[
- classesToCheckIn add:aClass.
- ].
+ (owner := aClass owningClass) notNil ifTrue:[
+ classPackage := aClass topOwningClass package
+ ] ifFalse:[
+ classPackage := aClass package
+ ].
+ (classPackage = packageToCheckIn) ifTrue:[
+ classesToCheckIn add:aClass.
+ ].
- doExtensions ifTrue:[
- aClass isMeta ifFalse:[
- "/ ... whose class is not in the checkIn-set
- (classesToCheckIn includes:aClass) ifFalse:[
- aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
- "/ methods in this project ...
- (mthd package = packageToCheckIn) ifTrue:[
- methodsToCheckIn add:mthd
+ doExtensions ifTrue:[
+ aClass isMeta ifFalse:[
+ "/ ... whose class is not in the checkIn-set
+ (classesToCheckIn includes:aClass) ifFalse:[
+ aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
+ "/ methods in this project ...
+ (mthd package = packageToCheckIn) ifTrue:[
+ methodsToCheckIn add:mthd
+ ]
]
- ]
+ ].
].
].
].
+
+ "/ cg: O(n^2) algorithm
+ "/ classesInChangeSet := classesToCheckIn select:[:cls | cls hasUnsavedChanges].
+ "/ replaced by: O(n) algorithm
+ classesInChangeSet := ChangeSet current selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:classesToCheckIn.
].
- "/ cg: O(n^2) algorithm
- "/ classesInChangeSet := classesToCheckIn select:[:cls | cls hasUnsavedChanges].
- "/ replaced by: O(n) algorithm
- classesInChangeSet := ChangeSet current selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:classesToCheckIn.
-
doExtensions ifTrue:[
methodsToCheckIn notEmpty ifTrue:[
doClasses ifTrue:[
@@ -630,14 +642,26 @@
].
checkinInfo isNil ifTrue:[
+ |infoString|
+
+ doExtensions ifTrue:[
+ infoString := '%1 classes (%4 changed) and %2 extensions for project "%3"'.
+ ] ifFalse:[doClasses ifTrue:[
+ infoString := '%1 classes (%4 changed) for project "%3"'.
+ ] ifFalse:[doBuild ifTrue:[
+ infoString := 'Build support files for project "%3"'.
+ ] ifFalse:[
+ infoString := 'I don''t know what I am doing'.
+ ]]].
+
+ infoString := infoString
+ bindWith:classesToCheckIn size
+ with:methodsToCheckIn size
+ with:packageToCheckIn allBold
+ with:classesInChangeSet size.
+
checkinInfo := self
- getCheckinInfoFor:((doExtensions
- ifTrue:['%1 classes (%4 changed) and %2 extensions for project "%3"']
- ifFalse:['%1 classes (%4 changed) for project "%3"'])
- bindWith:classesToCheckIn size
- with:methodsToCheckIn size
- with:packageToCheckIn allBold
- with:classesInChangeSet size)
+ getCheckinInfoFor:infoString
initialAnswer:nil
withQuickOption:(classesToCheckIn size > 0)
withValidateConsistencyOption:true.
@@ -653,7 +677,7 @@
(checkinInfo isStable or:[checkinInfo tagIt]) ifTrue:[
classesToTag := classesToCheckIn.
originalCheckinInfo := checkinInfo.
- checkinInfo := checkinInfo copy.
+ checkinInfo := checkinInfo deepCopy.
checkinInfo isStable:false.
checkinInfo tag:nil.
].
@@ -755,7 +779,7 @@
].
doBuild ifTrue:[
- self checkinBuildSupportFilesForPackage:packageToCheckIn
+ self checkinBuildSupportFilesForPackage:packageToCheckIn withInfo:(originalCheckinInfo ? checkinInfo).
].
"Created: / 13-10-2011 / 11:15:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -765,11 +789,11 @@
!SourceCodeManagerUtilitiesForContainerBasedManagers class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilitiesForContainerBasedManagers.st,v 1.15 2013-06-09 14:31:45 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilitiesForContainerBasedManagers.st,v 1.17 2013-08-06 11:29:32 stefan Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilitiesForContainerBasedManagers.st,v 1.15 2013-06-09 14:31:45 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilitiesForContainerBasedManagers.st,v 1.17 2013-08-06 11:29:32 stefan Exp $'
!
version_HG