--- a/SourceCodeManagerUtilities.st Wed Aug 16 17:46:27 2006 +0200
+++ b/SourceCodeManagerUtilities.st Thu Aug 17 09:49:44 2006 +0200
@@ -1373,7 +1373,7 @@
| className
oldModule oldPackage oldFileName
- module package fileName nameSpace nameSpacePrefix
+ module directory fileName nameSpace nameSpacePrefix
info project nm mgr creatingNew msg
answer doCheckinWithoutAsking forceCheckIn resources rslt note
requiredPackage|
@@ -1386,25 +1386,31 @@
className := aClass name.
- "/
- "/ defaults, if nothing at all is known
- "/
- (module := LastModule) isNil ifTrue:[
- module := (OperatingSystem getLoginName).
- ].
- (package := LastPackage) isNil ifTrue:[
- package := 'private'.
+ aClass isProjectDefinition ifTrue:[
+ "/ no way - their package is already known and fix.
+ module := aClass module.
+ directory := aClass moduleDirectory.
+ ] ifFalse:[
+ "/
+ "/ defaults, if nothing at all is known
+ "/
+ (module := LastModule) isNil ifTrue:[
+ module := (OperatingSystem getLoginName).
+ ].
+ (directory := LastPackage) isNil ifTrue:[
+ directory := 'private'.
+ ].
].
"/
"/ try to extract some useful defaults from the current project
"/
(Project notNil and:[(project := Project current) notNil]) ifTrue:[
- package isNil ifTrue:[
+ directory isNil ifTrue:[
(nm := project repositoryDirectory) isNil ifTrue:[
nm := project name
].
- package := nm.
+ directory := nm.
].
module isNil ifTrue:[
(nm := project repositoryModule) notNil ifTrue:[
@@ -1461,7 +1467,7 @@
OperatingSystem isMSDOSlike ifTrue:[
module replaceAll:$\ with:$/.
- package replaceAll:$\ with:$/.
+ directory replaceAll:$\ with:$/.
].
"/
@@ -1469,7 +1475,7 @@
"/
doCheckinWithoutAsking := false.
(mgr checkForExistingContainerInModule:module
- package:package
+ package:directory
container:fileName) ifTrue:[
answer := Dialog confirmWithCancel:(resources
string:'About to change the source container.
@@ -1481,14 +1487,14 @@
Do you want to change it or check right into that container ?'
with:className
with:module
- with:package
+ with:directory
with:fileName)
labels:(resources array:#('Cancel' 'Check in' 'Change')).
answer isNil ifTrue:[AbortSignal raise].
answer ifTrue:[
doCheckinWithoutAsking := false.
oldModule := module.
- oldPackage := package.
+ oldPackage := directory.
oldFileName := fileName
] ifFalse:[
doCheckinWithoutAsking := true.
@@ -1501,7 +1507,7 @@
"/ open a dialog for this
"/
(mgr checkForExistingContainerInModule:module
- package:package
+ package:directory
container:fileName) ifFalse:[
note := 'Notice: class seems to have no container yet.'.
creatingNew := true.
@@ -1511,7 +1517,7 @@
rslt := self
askForContainer:boxText title:title note:note
- initialModule:module initialPackage:package initialFileName:fileName
+ initialModule:module initialPackage:directory initialFileName:fileName
forNewContainer:true.
rslt isNil ifTrue:[
@@ -1519,7 +1525,7 @@
].
module := rslt at:#module.
- package := rslt at:#package.
+ directory := rslt at:#package.
fileName := rslt at:#fileName.
].
@@ -1533,7 +1539,7 @@
"/ we require the packageID to be <module>:<container-dir>
"/ check for this ...
- requiredPackage := ((module ? '') , ':' , (package ? '')) asSymbol.
+ requiredPackage := ((module ? '') , ':' , (directory ? '')) asSymbol.
requiredPackage ~= aClass package ifTrue:[
"/ doCheckinWithoutAsking ifFalse:[
"/ (self confirm:'Change the classes packageID to: ''', requiredPackage , ''' ?')
@@ -1565,7 +1571,7 @@
answer ifTrue:[
aClass updateVersionMethodFor:(mgr initialRevisionStringFor:aClass
inModule:module
- package:package
+ package:directory
container:fileName).
].
].
@@ -1574,16 +1580,16 @@
ifFalse:[^ false].
LastModule := module.
- (self checkForExistingModule:module package:package using:mgr allowCreate:(createDirs or:[creatingNew]))
+ (self checkForExistingModule:module package:directory using:mgr allowCreate:(createDirs or:[creatingNew]))
ifFalse:[^ false].
- LastPackage := package.
+ LastPackage := directory.
"/
"/ check for the container itself
"/
- (mgr checkForExistingContainerInModule:module package:package container:fileName) ifTrue:[
+ (mgr checkForExistingContainerInModule:module package:directory container:fileName) ifTrue:[
creatingNew ifTrue:[
- self warn:(resources string:'Container for %1 already exists in %2/%3.' with:fileName with:module with:package) withCRs.
+ self warn:(resources string:'Container for %1 already exists in %2/%3.' with:fileName with:module with:directory) withCRs.
].
"/ (oldModule notNil
@@ -1602,7 +1608,7 @@
%2 / %3 / %4 ?'
with:className
with:module
- with:package
+ with:directory
with:fileName) withCRs
noLabel:'Cancel')
ifFalse:[
@@ -1622,7 +1628,7 @@
(mgr
checkinClass:aClass
fileName:fileName
- directory:package
+ directory:directory
module:module
logMessage:msg)
ifFalse:[
@@ -1641,7 +1647,7 @@
(mgr
checkinClass:aClass
fileName:fileName
- directory:package
+ directory:directory
module:module
logMessage:msg
force:true)
@@ -1655,7 +1661,7 @@
(createContainer or:[creatingNew]) ifFalse:[
(Dialog
confirm:(resources string:'No container exists for %1 in %2/%3\\create ?'
- with:fileName with:module with:package) withCRs
+ with:fileName with:module with:directory) withCRs
noLabel:'Cancel') ifFalse:[
^ false
]
@@ -1665,12 +1671,14 @@
(mgr
createContainerFor:aClass
inModule:module
- package:package
+ package:directory
container:fileName) ifFalse:[
self warn:(resources string:'Failed to create container.').
^ false.
].
^ true
+
+ "Modified: / 17-08-2006 / 08:57:09 / cg"
!
removeSourceContainerForClass:aClass
@@ -2490,5 +2498,5 @@
!SourceCodeManagerUtilities class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.126 2006-08-10 17:17:30 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.127 2006-08-17 07:49:44 cg Exp $'
! !