--- a/AbstractSourceCodeManager.st Wed Sep 15 15:31:12 1999 +0200
+++ b/AbstractSourceCodeManager.st Wed Sep 15 15:31:45 1999 +0200
@@ -328,7 +328,10 @@
checkMethodPackagesOf:aClass
"check if aClass contains methods from another package;
ask if these should be checked in with the class.
- Raises abortSignal if checkIn is to be suppressed."
+ Raises abortSignal if checkIn is to be suppressed.
+ returns:
+ #base - only check in methods from the classes package
+ #all - check in all"
|checkInClassPackageOnly clsPackage otherPackages msg|
@@ -350,28 +353,32 @@
otherPackages add:mthdPackage.
]
].
- otherPackages notEmpty ifTrue:[
- otherPackages size == 1 ifTrue:[
- msg := 'The class contains methods for the ''%1'' package.\\Change those to belong to the ''%3'' package ?'
- ] ifFalse:[
- msg := 'The class contains methods for %2 other packages.\\Change those to belong to the ''%3'' package ?'
+ otherPackages isEmpty ifTrue:[
+ ^ #all
+ ].
+
+ otherPackages size == 1 ifTrue:[
+ msg := 'The class contains methods for the ''%1'' package.\\Change those to belong to the ''%3'' package ?'
+ ] ifFalse:[
+ msg := 'The class contains methods for %2 other packages.\\Change those to belong to the ''%3'' package ?'
+ ].
+
+ (self confirm:(msg bindWith:(otherPackages first asText allBold) with:(otherPackages size) with:clsPackage asText allBold) withCRs) ifTrue:[
+ "/ change all method's packageID to the classes packageId
+ aClass methodDictionary keysAndValuesDo:[:sel :mthd |
+ mthd package:clsPackage
].
- (self confirm:(msg bindWith:(otherPackages first asText allBold) with:(otherPackages size) with:clsPackage asText allBold) withCRs) ifTrue:[
- aClass methodDictionary keysAndValuesDo:[:sel :mthd |
- mthd package:clsPackage
- ].
- aClass class methodDictionary keysAndValuesDo:[:sel :mthd |
- mthd package:clsPackage
- ].
- ] ifFalse:[
- (self confirm:'Ignore those methods in the classes container ?') ifTrue:[
- checkInClassPackageOnly := true
- ] ifFalse:[
- AbortSignal raise
- ]
- ]
+ aClass class methodDictionary keysAndValuesDo:[:sel :mthd |
+ mthd package:clsPackage
+ ].
+ ^ #all
].
- ^ true
+
+ (self confirm:'Ignore those methods in the classes container\\(i.e. checkin basePackage methods only) ?') ifTrue:[
+ ^ #base
+ ].
+
+ AbortSignal raise
!
@@ -771,7 +778,12 @@
"checkin of a class into the source repository.
Return true if ok, false if not."
- |tempDir tempFile ok|
+ |tempDir tempFile ok packageMode filter|
+
+ packageMode := self checkMethodPackagesOf:aClass.
+ packageMode == #base ifTrue:[
+ filter := [:mthd | mthd package = aClass package].
+ ].
tempDir := (Filename newTemporaryIn:nil) makeDirectory; yourself.
ok := false.
@@ -793,7 +805,12 @@
aStream close.
^ false
] do:[
- aClass fileOutOn:aStream withTimeStamp:false.
+ aClass
+ fileOutOn:aStream
+ withTimeStamp:false
+ withInitialize:true
+ withDefinition:true
+ methodFilter:filter
].
aStream close.
@@ -1182,7 +1199,7 @@
^ nil
"
- SourceCodeManager revisionInfoFromString:'$Revision: 1.103 $'
+ SourceCodeManager revisionInfoFromString:'$Revision: 1.104 $'
SourceCodeManager revisionInfoFromString:(SourceCodeManager version)
"
@@ -1518,6 +1535,6 @@
!AbstractSourceCodeManager class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.103 1999-08-18 15:15:05 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.104 1999-09-15 13:31:45 cg Exp $'
! !
AbstractSourceCodeManager initialize!