AbstractSourceCodeManager.st
changeset 935 f5a8e98c8730
parent 928 3fd94a72c76d
child 943 0c58257cb139
--- a/AbstractSourceCodeManager.st	Thu Jul 13 17:48:58 2000 +0200
+++ b/AbstractSourceCodeManager.st	Thu Jul 13 17:50:03 2000 +0200
@@ -1222,7 +1222,7 @@
     ^ nil
 
     "
-     SourceCodeManager revisionInfoFromString:'$Revision: 1.118 $'
+     SourceCodeManager revisionInfoFromString:'$Revision: 1.119 $'
      SourceCodeManager revisionInfoFromString:(SourceCodeManager version)
     "
 
@@ -1397,6 +1397,78 @@
     "Modified: 10.1.1997 / 13:30:00 / cg"
 !
 
+revisionLogOf:aClass numberOfRevisions:numRevisions
+    "return info about the repository container and
+     (part of) the revisionlog (numRevisions newest revisions) 
+     as a collection of revision entries.
+     Return nil on failure.
+
+     The returned information is a structure (IdentityDictionary)
+     filled with:
+            #container          -> the RCS container file name 
+            #filename           -> the actual source file name
+            #newestRevision     -> the revisionString of the newest revision
+            #numberOfRevisions  -> the number of revisions in the container
+            #revisions          -> collection of per-revision info (see below)
+
+         for some classes, additional info is returned:
+
+            #renamed            -> true if the class has been renamed or copied
+                                   and the sourceInfo is from the previous one
+            #expectedFileName   -> the filename we would expect (i.e. for the new class)
+
+            rev1 / rev2 specify from which revisions a logEntry is wanted:
+              If rev1 is nil, the first revision is the initial revision
+              otherwise, the log starts with that revision.
+              If rev2 is nil, the last revision is the newest revision
+              otherwise, the log ends with that revision.
+              If both are nil, no logEntries are extracted (i.e. only the header).
+
+            per revision info consists of one record per revision:
+
+              #revision              -> the revision string
+              #author                -> who checked that revision into the repository
+              #date                  -> when was it checked in
+              #state                 -> the RCS state
+              #numberOfChangedLines  -> the number of changed line w.r.t the previous
+              #logMessage            -> the checkIn log message
+
+            revisions are ordered newest first 
+            (i.e. the last entry is for the initial revision; 
+                  the first for the most recent one)
+        "
+
+    |sourceInfo packageDir moduleDir classFileName info|
+
+    sourceInfo := self sourceInfoOfClass:aClass.
+    sourceInfo isNil ifTrue:[^ nil].
+
+    packageDir := self packageFromSourceInfo:sourceInfo.
+    moduleDir := self moduleFromSourceInfo:sourceInfo.  "/ use the modules name as CVS module
+    classFileName := self containerFromSourceInfo:sourceInfo.
+
+    info := self 
+        revisionLogOf:aClass
+        numberOfRevisions:numRevisions
+        fileName:classFileName
+        directory:packageDir 
+        module:moduleDir.
+
+    info notNil ifTrue:[
+"/        (sourceInfo includesKey:#renamed) ifTrue:[
+"/            info at:#renamed put:(sourceInfo at:#renamed)
+"/        ].
+        (sourceInfo includesKey:#expectedFileName) ifTrue:[
+            info at:#expectedFileName put:(sourceInfo at:#expectedFileName)
+        ]
+    ].
+    ^ info
+
+    "
+     SourceCodeManager revisionLogOf:Array numberOfRevisions:10 
+    "
+!
+
 revisionLogOfContainer:classFileName directory:packageDir module:moduleDir
     "return info about the repository container and
      (part of) the revisionlog as a collection of revision entries.
@@ -1726,6 +1798,6 @@
 !AbstractSourceCodeManager class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.118 2000-05-12 11:55:44 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.119 2000-07-13 15:50:03 cg Exp $'
 ! !
 AbstractSourceCodeManager initialize!