commentary; faster #newestRevisionOf
authorClaus Gittinger <cg@exept.de>
Fri, 10 Jan 1997 14:21:33 +0100
changeset 534 73fc19a1169e
parent 533 53a982919a5e
child 535 9e77c32bba75
commentary; faster #newestRevisionOf
AbstrSCMgr.st
AbstractSourceCodeManager.st
--- a/AbstrSCMgr.st	Fri Jan 10 14:20:13 1997 +0100
+++ b/AbstrSCMgr.st	Fri Jan 10 14:21:33 1997 +0100
@@ -486,7 +486,11 @@
     "/
     "/ the filename I'd expect from its name ...
     "/
-    classFileNameBase := Smalltalk fileNameForClass:aClass.
+    aClass owningClass notNil ifTrue:[
+        classFileNameBase := Smalltalk fileNameForClass:aClass topOwningClass
+    ] ifFalse:[
+        classFileNameBase := Smalltalk fileNameForClass:aClass.
+    ].
 
     (newInfo includesKey:#fileName) ifFalse:[
         newInfo at:#fileName put:(classFileNameBase , '.st')
@@ -513,6 +517,7 @@
 
     "/ check ..
     revInfo notNil ifTrue:[
+        
         actualSourceFileName := revInfo at:#fileName ifAbsent:nil.
         actualSourceFileName notNil ifTrue:[
             expectedFileName := classFileNameBase , '.st'.
@@ -531,7 +536,7 @@
     ^ newInfo
 
     "Created: 25.11.1995 / 12:40:19 / cg"
-    "Modified: 11.11.1996 / 15:47:24 / cg"
+    "Modified: 10.1.1997 / 13:45:59 / cg"
 !
 
 streamForClass:cls fileName:classFileName revision:revision directory:packageDir module:moduleDir cache:cacheIt
@@ -809,7 +814,14 @@
 
     |log|
 
-    log := self revisionLogInFile:classFileName directory:packageDir module:moduleDir.
+    log := self
+            revisionLogOf:nil 
+            fromRevision:0 
+            toRevision:0 
+            fileName:classFileName 
+            directory:packageDir 
+            module:moduleDir.
+
     log isNil ifTrue:[^ nil].
     ^ log at:#newestRevision ifAbsent:nil
 
@@ -817,7 +829,7 @@
      SourceCodeManager newestRevisionInFile:'Array.st' directory:'libbasic' module:'stx'       
     "
 
-    "Modified: 11.9.1996 / 18:53:50 / cg"
+    "Modified: 10.1.1997 / 13:31:42 / cg"
 !
 
 newestRevisionOf:aClass
@@ -826,7 +838,7 @@
 
     |log|
 
-    log := self revisionLogOf:aClass.
+    log := self revisionLogOf:aClass fromRevision:0 toRevision:0.
     log isNil ifTrue:[^ nil].
     ^ log at:#newestRevision ifAbsent:nil
 
@@ -835,7 +847,7 @@
      SourceCodeManager newestRevisionOf:Connection 
     "
 
-    "Modified: 10.4.1996 / 23:14:24 / cg"
+    "Modified: 10.1.1997 / 13:30:36 / cg"
 !
 
 removeContainerFor:aClass inModule:moduleName directory:dirName container:fileName
@@ -861,15 +873,6 @@
             #numberOfRevisions  -> the number of revisions in the container
             #revisions          -> collection of per-revision info (see below)
 
-            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, all logEntries are extracted.
-             -If both are 0 (not nil), no logEntries are extracted (i.e. only the header).
-
             per revision info consists of one record per revision:
 
               #revision              -> the revision string
@@ -879,7 +882,8 @@
               #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)
+            (i.e. the last entry is for the initial revision; 
+                  the first for the most recent one)
         "
 
     ^ self
@@ -895,7 +899,7 @@
         revisionLogInFile:'Array.st' directory:'libbasic' module:'stx'
     "
 
-    "Modified: 11.9.1996 / 18:53:14 / cg"
+    "Modified: 10.1.1997 / 13:29:06 / cg"
 !
 
 revisionLogOf:aClass
@@ -940,36 +944,34 @@
 
      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)
+            #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:
+         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)
+            #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).
+            rev1 specifies 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.
 
-	    per revision info consists of one record per revision:
+            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
+              #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)
-	"
+            revisions are ordered newest first 
+            (i.e. the last entry is for the initial revision; 
+                  the first for the most recent one)
+        "
 
     ^ self revisionLogOf:aClass fromRevision:rev1 toRevision:nil
 
@@ -978,7 +980,7 @@
     "
 
     "Created: 6.11.1995 / 18:56:00 / cg"
-    "Modified: 7.12.1995 / 11:51:15 / cg"
+    "Modified: 10.1.1997 / 13:29:50 / cg"
 !
 
 revisionLogOf:aClass fromRevision:rev1 toRevision:rev2
@@ -1016,7 +1018,8 @@
               #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)
+            (i.e. the last entry is for the initial revision; 
+                  the first for the most recent one)
         "
 
     |sourceInfo packageDir moduleDir classFileName info|
@@ -1052,7 +1055,7 @@
     "
 
     "Created: 6.11.1995 / 18:56:00 / cg"
-    "Modified: 6.2.1996 / 17:29:05 / cg"
+    "Modified: 10.1.1997 / 13:30:00 / cg"
 !
 
 revisionLogOf:cls fromRevision:rev1 toRevision:rev2 fileName:classFileName directory:packageDir module:moduleDir 
@@ -1179,6 +1182,6 @@
 !AbstractSourceCodeManager class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic3/Attic/AbstrSCMgr.st,v 1.68 1996-11-11 15:05:05 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/Attic/AbstrSCMgr.st,v 1.69 1997-01-10 13:21:33 cg Exp $'
 ! !
 AbstractSourceCodeManager initialize!
--- a/AbstractSourceCodeManager.st	Fri Jan 10 14:20:13 1997 +0100
+++ b/AbstractSourceCodeManager.st	Fri Jan 10 14:21:33 1997 +0100
@@ -486,7 +486,11 @@
     "/
     "/ the filename I'd expect from its name ...
     "/
-    classFileNameBase := Smalltalk fileNameForClass:aClass.
+    aClass owningClass notNil ifTrue:[
+        classFileNameBase := Smalltalk fileNameForClass:aClass topOwningClass
+    ] ifFalse:[
+        classFileNameBase := Smalltalk fileNameForClass:aClass.
+    ].
 
     (newInfo includesKey:#fileName) ifFalse:[
         newInfo at:#fileName put:(classFileNameBase , '.st')
@@ -513,6 +517,7 @@
 
     "/ check ..
     revInfo notNil ifTrue:[
+        
         actualSourceFileName := revInfo at:#fileName ifAbsent:nil.
         actualSourceFileName notNil ifTrue:[
             expectedFileName := classFileNameBase , '.st'.
@@ -531,7 +536,7 @@
     ^ newInfo
 
     "Created: 25.11.1995 / 12:40:19 / cg"
-    "Modified: 11.11.1996 / 15:47:24 / cg"
+    "Modified: 10.1.1997 / 13:45:59 / cg"
 !
 
 streamForClass:cls fileName:classFileName revision:revision directory:packageDir module:moduleDir cache:cacheIt
@@ -809,7 +814,14 @@
 
     |log|
 
-    log := self revisionLogInFile:classFileName directory:packageDir module:moduleDir.
+    log := self
+            revisionLogOf:nil 
+            fromRevision:0 
+            toRevision:0 
+            fileName:classFileName 
+            directory:packageDir 
+            module:moduleDir.
+
     log isNil ifTrue:[^ nil].
     ^ log at:#newestRevision ifAbsent:nil
 
@@ -817,7 +829,7 @@
      SourceCodeManager newestRevisionInFile:'Array.st' directory:'libbasic' module:'stx'       
     "
 
-    "Modified: 11.9.1996 / 18:53:50 / cg"
+    "Modified: 10.1.1997 / 13:31:42 / cg"
 !
 
 newestRevisionOf:aClass
@@ -826,7 +838,7 @@
 
     |log|
 
-    log := self revisionLogOf:aClass.
+    log := self revisionLogOf:aClass fromRevision:0 toRevision:0.
     log isNil ifTrue:[^ nil].
     ^ log at:#newestRevision ifAbsent:nil
 
@@ -835,7 +847,7 @@
      SourceCodeManager newestRevisionOf:Connection 
     "
 
-    "Modified: 10.4.1996 / 23:14:24 / cg"
+    "Modified: 10.1.1997 / 13:30:36 / cg"
 !
 
 removeContainerFor:aClass inModule:moduleName directory:dirName container:fileName
@@ -861,15 +873,6 @@
             #numberOfRevisions  -> the number of revisions in the container
             #revisions          -> collection of per-revision info (see below)
 
-            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, all logEntries are extracted.
-             -If both are 0 (not nil), no logEntries are extracted (i.e. only the header).
-
             per revision info consists of one record per revision:
 
               #revision              -> the revision string
@@ -879,7 +882,8 @@
               #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)
+            (i.e. the last entry is for the initial revision; 
+                  the first for the most recent one)
         "
 
     ^ self
@@ -895,7 +899,7 @@
         revisionLogInFile:'Array.st' directory:'libbasic' module:'stx'
     "
 
-    "Modified: 11.9.1996 / 18:53:14 / cg"
+    "Modified: 10.1.1997 / 13:29:06 / cg"
 !
 
 revisionLogOf:aClass
@@ -940,36 +944,34 @@
 
      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)
+            #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:
+         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)
+            #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).
+            rev1 specifies 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.
 
-	    per revision info consists of one record per revision:
+            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
+              #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)
-	"
+            revisions are ordered newest first 
+            (i.e. the last entry is for the initial revision; 
+                  the first for the most recent one)
+        "
 
     ^ self revisionLogOf:aClass fromRevision:rev1 toRevision:nil
 
@@ -978,7 +980,7 @@
     "
 
     "Created: 6.11.1995 / 18:56:00 / cg"
-    "Modified: 7.12.1995 / 11:51:15 / cg"
+    "Modified: 10.1.1997 / 13:29:50 / cg"
 !
 
 revisionLogOf:aClass fromRevision:rev1 toRevision:rev2
@@ -1016,7 +1018,8 @@
               #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)
+            (i.e. the last entry is for the initial revision; 
+                  the first for the most recent one)
         "
 
     |sourceInfo packageDir moduleDir classFileName info|
@@ -1052,7 +1055,7 @@
     "
 
     "Created: 6.11.1995 / 18:56:00 / cg"
-    "Modified: 6.2.1996 / 17:29:05 / cg"
+    "Modified: 10.1.1997 / 13:30:00 / cg"
 !
 
 revisionLogOf:cls fromRevision:rev1 toRevision:rev2 fileName:classFileName directory:packageDir module:moduleDir 
@@ -1179,6 +1182,6 @@
 !AbstractSourceCodeManager class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.68 1996-11-11 15:05:05 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.69 1997-01-10 13:21:33 cg Exp $'
 ! !
 AbstractSourceCodeManager initialize!