class: CVSSourceCodeManager
added: #getSourceStreamFor:revision:
do not cache symbolic versions (because the tag may move)
--- 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 $'
! !