class: CVSSourceCodeManager
authorClaus Gittinger <cg@exept.de>
Thu, 07 May 2015 13:06:26 +0200
changeset 3866 854cddf9b998
parent 3865 b76ba0a9cf83
child 3867 73f23fa5d192
child 3868 9a006429e942
class: CVSSourceCodeManager added: #getSourceStreamFor:revision: do not cache symbolic versions (because the tag may move)
CVSSourceCodeManager.st
--- a/CVSSourceCodeManager.st	Thu May 07 13:04:58 2015 +0200
+++ b/CVSSourceCodeManager.st	Thu May 07 13:06:26 2015 +0200
@@ -1528,7 +1528,7 @@
     rightPart := rightPart copyFrom:idx+1.
 
     "/ originalVersionString:
-    "/      '$Header: /cvs/stx/stx/libbasic3/CVSSourceCodeManager.st,v 1.506 2015-04-22 17:36:24 stefan Exp $'
+    "/      '$Header: /cvs/stx/stx/libbasic3/CVSSourceCodeManager.st,v 1.507 2015-05-07 11:06:26 cg Exp $'
     "/ leftPart:
     "/      '$Header: /cvs/stx/stx/goodies/refactoryBrowser/lint/RBLiteralArrayContainsCommaRule.st,v'
     "/ dateAndTimePart:
@@ -2883,6 +2883,19 @@
     "Modified: / 06-03-2012 / 11:57:52 / cg"
 !
 
+getSourceStreamFor:aClass revision:aRevisionStringOrNil
+    "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."
+
+    |cacheIt|
+
+    "/ never cache symbolic versions
+    cacheIt := (aRevisionStringOrNil isNil or:[ aRevisionStringOrNil first isDigit ]).
+    ^ self getSourceStreamFor:aClass revision:aRevisionStringOrNil cache:cacheIt
+!
+
 streamForClass:cls fileName:fileName revision:revision directory:packageDir module:moduleDir cache:cacheItArg
     "extract a source file and return an open readStream on it,
      or nil if the extract failed. If revision is nil or (#newest), take
@@ -5615,11 +5628,11 @@
 !CVSSourceCodeManager class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic3/CVSSourceCodeManager.st,v 1.506 2015-04-22 17:36:24 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/CVSSourceCodeManager.st,v 1.507 2015-05-07 11:06:26 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic3/CVSSourceCodeManager.st,v 1.506 2015-04-22 17:36:24 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/CVSSourceCodeManager.st,v 1.507 2015-05-07 11:06:26 cg Exp $'
 ! !