--- a/VersionDiffBrowser.st Tue Feb 26 12:02:54 2002 +0100
+++ b/VersionDiffBrowser.st Tue Feb 26 13:59:06 2002 +0100
@@ -1593,37 +1593,45 @@
!
changeSetForClass:aClass andRevision:aVersion
-"return a ChangeSet for the class aClass and version aVersion.
-The version from the class source stream is checked out from the repositiory
-into a source stream. Then the change set is generated from the source stream.
+ "return a ChangeSet for the class aClass and version aVersion.
+ The version from the class source stream is checked out from the repositiory
+ into a source stream. Then the change set is generated from the source stream.
-<return: ChangeSet|nil>
-"
+ <return: ChangeSet|nil>
+ "
+
|theSourceCodeManager theSourceStream theChangeSet|
theSourceCodeManager := aClass sourceCodeManager.
- [theSourceStream := theSourceCodeManager getSourceStreamFor:aClass revision:aVersion.
- theSourceStream notNil
- ifTrue:[theChangeSet:=ChangeSet fromStream:theSourceStream]]
- valueNowOrOnUnwindDo:
- [theSourceStream notNil ifTrue:[theSourceStream close]].
+ [
+ theSourceStream := theSourceCodeManager getSourceStreamFor:aClass revision:aVersion.
+ theSourceStream notNil
+ ifTrue:[theChangeSet:=ChangeSet fromStream:theSourceStream]
+ ] ensure:[
+ theSourceStream notNil ifTrue:[theSourceStream close]
+ ].
^theChangeSet
!
changeSetForClass:aClass andSource:aSource
-"return a ChangeSet for the class aClass and source aSource.
-The source is converted to a stream and then the change set is generated
-from the source stream.
+ "return a ChangeSet for the class aClass and source aSource.
+ The source is converted to a stream and then the change set is generated
+ from the source stream.
-<return: ChangeSet|nil>
-"
+ <return: ChangeSet|nil>
+ "
|theChangeSet theSourceStream|
- [(theSourceStream := aSource readStream) notNil
- ifTrue:[theChangeSet:=ChangeSet fromStream:(theSourceStream := aSource readStream)]]
- valueNowOrOnUnwindDo:
- [theSourceStream notNil
- ifTrue:[theSourceStream close]].
+ [
+ (theSourceStream := aSource readStream) notNil
+ ifTrue:[
+ theChangeSet:=ChangeSet fromStream:(theSourceStream := aSource readStream)
+ ]
+ ] ensure:[
+ theSourceStream notNil ifTrue:[
+ theSourceStream close
+ ]
+ ].
^theChangeSet
!
@@ -1906,5 +1914,5 @@
!VersionDiffBrowser class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/VersionDiffBrowser.st,v 1.49 2001-10-26 10:30:07 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/VersionDiffBrowser.st,v 1.50 2002-02-26 12:59:06 cg Exp $'
! !