#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Sun, 07 Jul 2019 23:42:57 +0200
changeset 4453 5e6ad8c5a97e
parent 4452 48908302f213
child 4454 fdd347565a6c
#FEATURE by cg class: AbstractSourceCodeManager class added: #revisionLogOfFile:fromRevision:toRevision: #revisionLogOfFile:fromRevision:toRevision:finishAfter: #revisionLogOfFile:numberOfRevisions: comment/format in: #revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module: #revisionLogOf:numberOfRevisions:fileName:directory:module:
AbstractSourceCodeManager.st
--- a/AbstractSourceCodeManager.st	Sat Jun 29 09:27:02 2019 +0200
+++ b/AbstractSourceCodeManager.st	Sun Jul 07 23:42:57 2019 +0200
@@ -702,7 +702,7 @@
 
 revisionLogOf:clsOrNil 
     fromRevision:rev1OrNil toRevision:rev2OrNil numberOfRevisions:limitOrNil 
-    fileName:classFileName directory:packageDir module:moduleDir 
+    fileName:classFileName directory:packageDirOrNil module:moduleDirOrNil 
 
     "Return info about the repository container and (part of) the revisionlog as a collection 
      of revision entries. Return nil on failure.
@@ -3459,15 +3459,17 @@
     "Modified: / 23-08-2006 / 14:10:52 / cg"
 !
 
-revisionLogOf:clsOrNil numberOfRevisions:numRevisions fileName:classFileName directory:packageDir module:moduleDir
+revisionLogOf:clsOrNil numberOfRevisions:numRevisions fileName:classFileName directory:packageDirOrNil module:moduleDirOrNil
     ^ self 
         revisionLogOf:clsOrNil
         fromRevision:nil
         toRevision:nil
         numberOfRevisions:numRevisions
         fileName:classFileName
-        directory:packageDir
-        module:moduleDir
+        directory:packageDirOrNil
+        module:moduleDirOrNil
+
+    "Modified (format): / 07-07-2019 / 23:17:22 / Claus Gittinger"
 !
 
 revisionLogOfContainer:classFileName directory:packageDir module:moduleDir
@@ -3575,6 +3577,171 @@
     "Created: / 23-08-2006 / 14:14:59 / cg"
 !
 
+revisionLogOfFile:aFilename fromRevision:rev1 toRevision:rev2
+    "return info about the repository container and
+     (part of) the revisionlog as a collection of revision entries.
+     Return nil on failure.
+
+     The returned information is a structure (IdentityDictionary)
+     filled with:
+            #container          -> the container file name (for container-based SCMs)
+            #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
+
+            revisions are ordered newest first 
+            (i.e. the last entry is for the initial revision; 
+                  the first for the most recent one)
+        "
+
+    ^ self
+        revisionLogOfFile:aFilename fromRevision:rev1 toRevision:rev2 
+        finishAfter:nil
+
+    "Created: / 07-07-2019 / 23:27:36 / Claus Gittinger"
+!
+
+revisionLogOfFile:aFilename fromRevision:rev1 toRevision:rev2 finishAfter:maxCountOrNil
+    "return info about the repository container and
+     (part of) the revisionlog as a collection of revision entries.
+     Return nil on failure.
+
+     The returned information is a structure (IdentityDictionary)
+     filled with:
+            #container          -> the container file name (for container-based SCMs)
+            #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
+
+            revisions are ordered newest first 
+            (i.e. the last entry is for the initial revision; 
+                  the first for the most recent one)
+        "
+
+    |info|
+
+    info := self 
+        revisionLogOf:nil
+        fromRevision:rev1 
+        toRevision:rev2
+        numberOfRevisions:maxCountOrNil
+        fileName:aFilename
+        directory:nil 
+        module:nil.
+
+    ^ info
+
+    "
+     SourceCodeManager revisionLogOfFile:'../../libbasic/Array.st' fromRevision:'1.40' toRevision:'1.43' 
+    "
+
+    "Created: / 07-07-2019 / 23:28:38 / Claus Gittinger"
+!
+
+revisionLogOfFile:aFilename 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 container file name (for container-based SCMs)
+            #filename           -> the actual source file name
+            #newestRevision     -> the revisionString of the newest revision
+            #numberOfRevisions  -> the number of revisions in the container (nil for all)
+            #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)
+        "
+
+    |info|
+
+    info := self 
+        revisionLogOf:nil
+        numberOfRevisions:numRevisions
+        fileName:aFilename
+        directory:nil 
+        module:nil.
+
+    ^ info
+
+    "
+     SourceCodeManager revisionLogOfFile:'../../libbasic/Array.st' numberOfRevisions:10 
+     SourceCodeManager revisionLogOfFile:'../../libbasic/Array.st' numberOfRevisions:nil 
+    "
+
+    "Created: / 07-07-2019 / 23:15:44 / Claus Gittinger"
+!
+
 revisionStringFor:aClass inModule:moduleDir directory:packageDir container:fileName revision:revisionString
     "utility function: return a string usable as initial revision string.
      Can be redefined in subclasses"