AbstractSourceCodeManager.st
changeset 545 198957db4e32
parent 537 240d5b2ab16c
child 549 8b4035c43732
--- a/AbstractSourceCodeManager.st	Tue Jan 14 20:47:22 1997 +0100
+++ b/AbstractSourceCodeManager.st	Tue Jan 14 21:25:01 1997 +0100
@@ -191,6 +191,121 @@
     "Modified: 12.9.1996 / 02:25:19 / cg"
 ! !
 
+!AbstractSourceCodeManager class methodsFor:'basic access'!
+
+checkinClass:aClass fileName:classFileName directory:packageDir module:moduleDir source:sourceFile logMessage:logMessage force:force
+    "checkin of a class into the source repository.
+     Return true if ok, false if not."
+
+    ^ self subclassResponsibility.
+
+    "Created: 14.2.1997 / 21:17:33 / cg"
+    "Modified: 14.2.1997 / 21:18:48 / cg"
+!
+
+streamForClass:aClass fileName:classFileName revision:revision directory:packageDir module:moduleDir cache:doCache
+    "extract a classes source code and return an open readStream on it.
+     A revision of nil selects the current (in image) revision.
+     The classes source code is extracted using the revision and the sourceCodeInfo,
+     which itself is extracted from the classes packageString."
+
+    ^ self subclassResponsibility
+
+    "Modified: 14.2.1997 / 21:18:35 / cg"
+! !
+
+!AbstractSourceCodeManager class methodsFor:'basic administration'!
+
+checkForExistingContainerInModule:moduleName package:dirName container:fileName
+    "check for a container to be present"
+
+    ^ self subclassResponsibility.
+
+    "Created: 9.12.1995 / 19:02:23 / cg"
+    "Modified: 14.2.1997 / 21:18:56 / cg"
+!
+
+checkForExistingModule:moduleName
+    "check for a module directory to be present"
+
+    ^ self subclassResponsibility.
+
+    "Created: 9.12.1995 / 19:02:23 / cg"
+    "Modified: 14.2.1997 / 21:19:01 / cg"
+!
+
+checkForExistingModule:moduleDir package:packageDir
+    "check for a package directory to be present"
+
+    ^ self subclassResponsibility.
+
+    "Created: 9.12.1995 / 19:02:23 / cg"
+    "Modified: 14.2.1997 / 21:19:06 / cg"
+!
+
+createContainerFor:aClass inModule:moduleName directory:dirName container:fileName
+    "create a new container & check into it an initial version of aClass"
+
+    ^ self subclassResponsibility.
+
+    "Created: 9.12.1995 / 19:02:47 / cg"
+    "Modified: 14.2.1997 / 21:19:11 / cg"
+!
+
+createModule:moduleName
+    "create a new module directory"
+
+    ^ self subclassResponsibility.
+
+    "Created: 9.12.1995 / 19:02:23 / cg"
+    "Modified: 14.2.1997 / 21:19:16 / cg"
+!
+
+createModule:module package:package
+    "create a new package directory"
+
+    ^ self subclassResponsibility.
+
+    "Created: 9.12.1995 / 19:02:23 / cg"
+    "Modified: 14.2.1997 / 21:19:21 / cg"
+!
+
+initialRevisionStringFor:aClass inModule:moduleDir package:packageDir container:fileName
+    "return a string usable as initial revision string"
+
+    ^ self subclassResponsibility
+
+    "Created: 14.2.1997 / 21:01:41 / cg"
+!
+
+removeContainerFor:aClass inModule:moduleName directory:dirName container:fileName
+    "remove a container"
+
+    ^ self subclassResponsibility.
+
+    "Created: 11.9.1996 / 13:18:33 / cg"
+    "Modified: 14.2.1997 / 21:19:28 / cg"
+!
+
+revisionLogOf:cls fromRevision:rev1 toRevision:rev2 fileName:classFileName directory:packageDir module:moduleDir 
+    "actually do return a revisionLog. The main worker method.
+     This must be implemented by a concrete source-code manager"
+
+    ^ self subclassResponsibility.
+
+    "Created: 15.11.1995 / 18:12:51 / cg"
+    "Modified: 14.2.1997 / 21:14:01 / cg"
+!
+
+writeHistoryLogSince:timeGoal filterSTSources:filter filterUser:userFilter to:aStream
+    "send a full historyLog to some stream.
+     Must be implemented by a concrete subclass."
+
+    ^ self subclassResponsibility
+
+    "Modified: 14.2.1997 / 21:13:51 / cg"
+! !
+
 !AbstractSourceCodeManager class methodsFor:'private'!
 
 containerFromSourceInfo:info
@@ -537,16 +652,6 @@
 
     "Created: 25.11.1995 / 12:40:19 / cg"
     "Modified: 10.1.1997 / 15:14:18 / cg"
-!
-
-streamForClass:cls fileName:classFileName revision:revision directory:packageDir module:moduleDir cache:cacheIt
-    "return a stream for reading a classes specific versions sourceCode"
-
-    self subclassResponsibility.
-    ^ nil
-
-    "Created: 4.11.1995 / 19:09:12 / cg"
-    "Modified: 12.9.1996 / 02:33:50 / cg"
 ! !
 
 !AbstractSourceCodeManager class methodsFor:'source code access'!
@@ -748,64 +853,41 @@
 
 !AbstractSourceCodeManager class methodsFor:'source code administration'!
 
-checkForExistingContainerInModule:moduleName package:dirName container:fileName
-    "check for a container to be present"
-
-    self subclassResponsibility.
-    ^ false
+initialRCSRevisionStringFor:aClass in:dir container:fileName
+    "return a string usable as initial revision string"
 
-    "Created: 9.12.1995 / 19:02:23 / cg"
-    "Modified: 12.9.1996 / 02:34:41 / cg"
-!
+    "/ do not make the string below into one string;
+    "/ RCS would expand it into a wrong rev-string
 
-checkForExistingModule:moduleName
-    "check for a module directory to be present"
+    |nm oldRev idx special|
 
-    self subclassResponsibility.
-    ^ false
-
-    "Created: 9.12.1995 / 19:02:23 / cg"
-    "Modified: 12.9.1996 / 02:34:50 / cg"
-!
-
-checkForExistingModule:moduleDir package:packageDir
-    "check for a package directory to be present"
-
-    self subclassResponsibility.
-    ^ false
+    nm := fileName.
+    (nm endsWith:',v') ifTrue:[
+        nm := nm copyWithoutLast:2
+    ].
+    (nm endsWith:'.st') ifFalse:[
+        nm := nm , '.st'
+    ].
 
-    "Created: 9.12.1995 / 19:02:23 / cg"
-    "Modified: 12.9.1996 / 02:34:57 / cg"
-!
-
-createContainerFor:aClass inModule:moduleName directory:dirName container:fileName
-    "create a new container & check into it an initial version of aClass"
-
-    self subclassResponsibility.
-    ^ false
-
-    "Created: 9.12.1995 / 19:02:47 / cg"
-    "Modified: 12.9.1996 / 02:35:17 / cg"
-!
+    oldRev := aClass revisionString.
+    special := ''.
 
-createModule:moduleName
-    "create a new module directory"
-
-    self subclassResponsibility.
-    ^ false
+    oldRev notNil ifTrue:[
+        idx := oldRev lastIndexOf:$[.
+        idx ~~ 0 ifTrue:[
+            idx := oldRev indexOf:$[ startingAt:idx+1.
+            idx ~~ 0 ifTrue:[
+                special := ' ' , (oldRev copyFrom:idx).
+            ]
+        ]
+    ].
 
-    "Created: 9.12.1995 / 19:02:23 / cg"
-    "Modified: 12.9.1996 / 02:35:26 / cg"
-!
 
-createModule:module package:package
-    "create a new package directory"
+    ^ '$' , 'Header: ' , dir , '/' , fileName , ',v $'
+      , special
 
-    self subclassResponsibility.
-    ^ false
-
-    "Created: 9.12.1995 / 19:02:23 / cg"
-    "Modified: 12.9.1996 / 02:35:32 / cg"
+    "Modified: 17.9.1996 / 15:57:15 / cg"
+    "Created: 14.2.1997 / 20:59:28 / cg"
 !
 
 newestRevisionInFile:classFileName directory:packageDir module:moduleDir
@@ -850,16 +932,6 @@
     "Modified: 10.1.1997 / 13:30:36 / cg"
 !
 
-removeContainerFor:aClass inModule:moduleName directory:dirName container:fileName
-    "remove a container"
-
-    self subclassResponsibility.
-    ^ false
-
-    "Created: 11.9.1996 / 13:18:33 / cg"
-    "Modified: 12.9.1996 / 02:35:46 / cg"
-!
-
 revisionLogInFile:classFileName directory:packageDir module:moduleDir
     "return info about the repository container and
      (part of) the revisionlog as a collection of revision entries.
@@ -1058,16 +1130,6 @@
     "Modified: 10.1.1997 / 13:30:00 / cg"
 !
 
-revisionLogOf:cls fromRevision:rev1 toRevision:rev2 fileName:classFileName directory:packageDir module:moduleDir 
-    "actually do return a revisionLog. The main worker method.
-     This must be implemented by a concrete source-code manager"
-
-    self subclassResponsibility.
-
-    "Created: 15.11.1995 / 18:12:51 / cg"
-    "Modified: 12.9.1996 / 02:36:11 / cg"
-!
-
 revisionsOf:aClass
     "return a collection of revisions (as strings) found in the repository.
      The most recent (newest) revision will be the first in the list.
@@ -1155,7 +1217,10 @@
     |log |
 
     log := self revisionLogOf:aClass fromRevision:rev1 toRevision:rev2.
-    log isNil ifTrue:[^ false].
+    log isNil ifTrue:[
+        aStream nextPutAll:'** No revision log available **'.
+        ^ false
+    ].
 
     self writeRevisionLogMessagesFrom:log to:aStream.
     ^ true
@@ -1165,7 +1230,7 @@
     "
 
     "Created: 6.11.1995 / 18:56:00 / cg"
-    "Modified: 25.11.1995 / 17:24:55 / cg"
+    "Modified: 14.2.1997 / 21:11:57 / cg"
 !
 
 writeRevisionLogOf:aClass to:aStream
@@ -1182,6 +1247,6 @@
 !AbstractSourceCodeManager class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.71 1997-01-10 16:29:13 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.72 1997-01-14 20:24:45 cg Exp $'
 ! !
 AbstractSourceCodeManager initialize!