--- a/Class.st Thu Dec 07 16:13:31 1995 +0100
+++ b/Class.st Thu Dec 07 16:15:02 1995 +0100
@@ -12,10 +12,10 @@
ClassDescription subclass:#Class
instanceVariableNames:'classvars comment subclasses classFilename package revision
- history'
+ history'
classVariableNames:'UpdatingChanges LockChangesFile FileOutErrorSignal
- CatchMethodRedefinitions MethodRedefinitionSignal
- UpdateChangeFileQuerySignal'
+ CatchMethodRedefinitions MethodRedefinitionSignal
+ UpdateChangeFileQuerySignal'
poolDictionaries:''
category:'Kernel-Classes'
!
@@ -255,7 +255,7 @@
"return a dictionary filled with revision info.
This extracts the relevant info from aString."
- |words info nm|
+ |words info nm mgr|
info := IdentityDictionary new.
words := aString asCollectionOfWords.
@@ -299,12 +299,13 @@
"/
"/ mhmh - maybe its some other source code system
"/
- SourceCodeManager notNil ifTrue:[
- ^ SourceCodeManager revisionInfoFromString:aString
+ (mgr := Smalltalk at:SourceCodeManager) notNil ifTrue:[
+ ^ mgr revisionInfoFromString:aString
].
^ nil
"Created: 15.11.1995 / 14:58:35 / cg"
+ "Modified: 7.12.1995 / 13:21:40 / cg"
! !
!Class methodsFor:'ST/V subclass creation'!
@@ -936,10 +937,20 @@
^ code
!
+sourceCodeManager
+ "return my source code manager.
+ For now, all classes return the same global manager.
+ But future versions may support mixed reporitories"
+
+ ^ Smalltalk at:#SourceCodeManager
+
+ "Created: 7.12.1995 / 13:16:46 / cg"
+!
+
sourceStream
"return an open stream on my sourcefile, nil if that is not available"
- |source fileName aStream cls|
+ |source fileName aStream cls mgr|
self isMeta ifTrue:[
cls := self soleInstance
@@ -956,7 +967,7 @@
"/ if there is no SourceCodeManager, look in
"/ standard places first
"/
- SourceCodeManager isNil ifTrue:[
+ (mgr := self sourceCodeManager) isNil ifTrue:[
fileName := Smalltalk getSourceFileName:source.
fileName notNil ifTrue:[
aStream := fileName asFilename readStream.
@@ -1002,8 +1013,8 @@
"/ if that one does not know about the source, look in
"/ standard places
- SourceCodeManager notNil ifTrue:[
- aStream := SourceCodeManager sourceStreamFor:cls.
+ mgr notNil ifTrue:[
+ aStream := mgr sourceStreamFor:cls.
aStream isNil ifTrue:[
fileName := Smalltalk getSourceFileName:cls name.
fileName notNil ifTrue:[
@@ -1029,7 +1040,7 @@
"
"Created: 10.11.1995 / 21:05:13 / cg"
- "Modified: 25.11.1995 / 16:55:17 / cg"
+ "Modified: 7.12.1995 / 13:21:16 / cg"
! !
!Class methodsFor:'adding/removing'!
@@ -2873,22 +2884,22 @@
"return a dictionary filled with revision info.
This extracts the relevant info from the revisionString.
The revisionInfo contains all or a subset of:
- #binaryRevision - the revision upon which the binary of this class is based
- #revision - the revision upon which the class is based logically
- (different, if a changed class was checked in, but not yet recompiled)
- #user - the user who checked in the logical revision
- #date - the date when the logical revision was checked in
- #time - the time when the logical revision was checked in
- #fileName - the classes source file name
- #repositoryPath - the classes source container
+ #binaryRevision - the revision upon which the binary of this class is based
+ #revision - the revision upon which the class is based logically
+ (different, if a changed class was checked in, but not yet recompiled)
+ #user - the user who checked in the logical revision
+ #date - the date when the logical revision was checked in
+ #time - the time when the logical revision was checked in
+ #fileName - the classes source file name
+ #repositoryPath - the classes source container
"
|vsnString info|
vsnString := self revisionString.
vsnString notNil ifTrue:[
- info := Class revisionInfoFromString:vsnString.
- info at:#binaryRevision put:revision.
+ info := Class revisionInfoFromString:vsnString.
+ info at:#binaryRevision put:revision.
].
^ info
@@ -3011,7 +3022,7 @@
cls := self.
self isMeta ifFalse:[
- cls := self class
+ cls := self class
].
m := cls compiledMethodAt:#version.
m isNil ifTrue:[^ false].
@@ -3029,17 +3040,18 @@
rightPart := rightPart copyFrom:idx + 1.
newRevision isNil ifTrue:[
- (vsnString endsWith:'mod') ifTrue:[
- "/ alread a modified class
+ (vsnString endsWith:'mod') ifTrue:[
+ "/ alread a modified class
"/ ('already modified: ' , vsnString) printNL.
- ^ false
- ].
- newVsn := vsnString , 'mod'
+ ^ false
+ ].
+ newVsn := vsnString , 'mod'
] ifFalse:[
- newVsn := newRevision
+ newVsn := newRevision
].
m source:'version
- ^ ''' , leftPart , ' ' , newVsn , ' ' , rightPart , ''''.
+ ^ ''' , leftPart , ' ' , newVsn , ' ' , rightPart , '''
+'.
"/ ('updated to :' , newVsn) printNL.
@@ -3047,7 +3059,7 @@
^ true
"Created: 29.10.1995 / 19:25:15 / cg"
- "Modified: 7.12.1995 / 12:29:01 / cg"
+ "Modified: 7.12.1995 / 13:12:21 / cg"
! !
!Class methodsFor:'queries'!
@@ -3386,5 +3398,5 @@
!Class class methodsFor:'documentation'!
version
-^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.96 1995-12-07 11:46:07 cg Exp $'! !
+^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.97 1995-12-07 15:15:02 cg Exp $'! !
Class initialize!