class: SourceCodeManagerUtilitiesForContainerBasedManagers
changed:
#checkinClasses:withInfo:withCheck:usingManager:
#checkinPackage:classes:extensions:buildSupport:askForMethodsInOtherPackages:
when checking in quick (changed only), care for new classes
which are not in the changeset, but have not yet been checked in
--- a/SourceCodeManagerUtilitiesForContainerBasedManagers.st Sat Mar 30 02:54:34 2013 +0100
+++ b/SourceCodeManagerUtilitiesForContainerBasedManagers.st Sat Mar 30 02:55:58 2013 +0100
@@ -342,7 +342,9 @@
allClasses := classes.
checkinInfoOrString quickCheckIn ifTrue:[
- classes := classes select:[:aClass | aClass hasUnsavedChanges].
+ "/ not only the one's in the changeSet;
+ "/ also those which have not been checked in before.
+ classes := classes select:[:each | each hasUnsavedChanges or:[ (each revisionOfManager:aManagerOrNil) isNil ]].
classes isEmpty ifTrue:[ Dialog information:'no changes to checkin (quickCheckIn)' ]
].
@@ -491,20 +493,19 @@
!
checkinPackage:packageToCheckIn classes:doClasses extensions:doExtensions buildSupport:doBuild askForMethodsInOtherPackages:askForMethodsInOtherPackages
- |mgr classes classesToCheckIn methodsToCheckIn
+ |mgr classesToCheckIn methodsToCheckIn
methodsInOtherPackages looseMethods otherPackages
- msg classesInChangeSet checkinInfo originalCheckinInfo classesToTag|
+ msg classesInChangeSet newClasses checkinInfo originalCheckinInfo classesToTag|
mgr := self sourceCodeManagerFor: packageToCheckIn.
- classes := Smalltalk allClasses.
classesToCheckIn := IdentitySet new.
methodsToCheckIn := IdentitySet new.
methodsInOtherPackages := IdentitySet new.
looseMethods := IdentitySet new.
- "/ classes ...
- classes do:[:aClass |
+ "/ collect classes and individual methods...
+ Smalltalk allClassesDo:[:aClass |
|owner classPackage|
(owner := aClass owningClass) notNil ifTrue:[
@@ -515,6 +516,20 @@
(classPackage = packageToCheckIn) ifTrue:[
classesToCheckIn add:aClass.
].
+
+ doExtensions ifTrue:[
+ aClass isMeta ifFalse:[
+ "/ ... whose class is not in the chechIn-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
@@ -522,21 +537,6 @@
"/ replaced by: O(n) algorithm
classesInChangeSet := ChangeSet current selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:classesToCheckIn.
- "/ individual methods ...
- classes do:[:aClass |
- aClass isMeta ifFalse:[
- "/ ... whose class is not in the chechIn-set
- (classesToCheckIn includes:aClass) ifFalse:[
- aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
- "/ methods in this project ...
- (mthd package = packageToCheckIn) ifTrue:[
- methodsToCheckIn add:mthd
- ]
- ]
- ].
- ].
- ].
-
doExtensions ifTrue:[
methodsToCheckIn notEmpty ifTrue:[
doClasses ifTrue:[
@@ -597,11 +597,13 @@
checkinInfo isNil ifTrue:[
checkinInfo := self
- getCheckinInfoFor:('%1 classes (%4 changed) and %2 extensions for project "%3"'
- bindWith:classesToCheckIn size
- with:methodsToCheckIn size
- with:packageToCheckIn allBold
- with:classesInChangeSet size)
+ 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)
initialAnswer:nil
withQuickOption:(classesToCheckIn size > 0)
withValidateConsistencyOption:true.
@@ -621,7 +623,13 @@
checkinInfo isStable:false.
checkinInfo tag:nil.
].
- classesToCheckIn := classesInChangeSet.
+ "/ not only the one's in the changeSet;
+ "/ also those which have not been checked in before.
+ newClasses := classesToCheckIn select:[:class | (class revisionOfManager:mgr) isNil ].
+ classesToCheckIn := Set new
+ addAll:classesInChangeSet;
+ addAll:newClasses;
+ yourself.
].
"/ check if any of the classes contains methods for other packages ...
@@ -723,10 +731,10 @@
!SourceCodeManagerUtilitiesForContainerBasedManagers class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilitiesForContainerBasedManagers.st,v 1.6 2013-03-27 16:38:54 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilitiesForContainerBasedManagers.st,v 1.7 2013-03-30 01:55:58 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilitiesForContainerBasedManagers.st,v 1.6 2013-03-27 16:38:54 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilitiesForContainerBasedManagers.st,v 1.7 2013-03-30 01:55:58 cg Exp $'
! !