common code (in Browser, NewBrowser) for revisionLogOf
authorClaus Gittinger <cg@exept.de>
Thu, 07 Dec 2000 15:13:50 +0100
changeset 1026 1f193eb5f877
parent 1025 038e9825811f
child 1027 6c93b510b86d
common code (in Browser, NewBrowser) for revisionLogOf
SourceCodeManagerUtilities.st
--- a/SourceCodeManagerUtilities.st	Thu Dec 07 14:17:21 2000 +0100
+++ b/SourceCodeManagerUtilities.st	Thu Dec 07 15:13:50 2000 +0100
@@ -1649,6 +1649,79 @@
     ^ false
 !
 
+repositoryLogOf:aClass onto:aStream
+    |info rv mgr info2 module fn msg s|
+
+    info := aClass revisionInfo.
+
+    rv := aClass binaryRevision.
+    rv notNil ifTrue:[
+        aStream nextPutLine:'**** Loaded classes binary information ****'; cr.
+        aStream nextPutLine:'  Binary based upon : ' , rv.
+        aStream cr.
+    ].
+
+    info notNil ifTrue:[
+        mgr := aClass sourceCodeManager.
+
+        (info includesKey:#revision) ifFalse:[
+            aStream nextPutLine:'WARNING:'; cr.
+            aStream nextPutLine:'  The class seems not to be loaded from the repository.'.
+            aStream nextPutLine:'  Check carefully before checking anything in.'.
+            aStream nextPutLine:'  (i.e. compare with repository for renamed class(es), same-name but unrelated etc.)'.
+            aStream cr.
+        ].
+
+        aStream nextPutLine:'**** Classes source information ****'; cr.
+        s := info at:#repositoryPath ifAbsent:nil.
+        s notNil ifTrue:[
+            aStream nextPutLine:'  Source repository : ' , s
+        ].
+        aStream nextPutLine:'  Filename ........ : ' , (info at:#fileName ifAbsent:'?').
+        aStream nextPutLine:'  Revision ........ : ' , (info at:#revision ifAbsent:'?').
+        aStream nextPutLine:'  Checkin date .... : ' , (info at:#date ifAbsent:'?') , ' ' , (info at:#time ifAbsent:'?').
+        aStream nextPutLine:'  Checkin user .... : ' , (info at:#user ifAbsent:'?').
+
+        (info2 := aClass packageSourceCodeInfo) notNil ifTrue:[
+            aStream nextPutLine:'  Repository: ..... : ' , (info2 at:#module ifAbsent:'?').
+            aStream nextPutLine:'  Directory: ...... : ' , (info2 at:#directory ifAbsent:'?').
+        ].
+        aStream nextPutLine:'  Container ....... : ' , (info at:#repositoryPathName ifAbsent:'?').
+        aStream cr.
+
+        mgr notNil ifTrue:[
+            aStream nextPutLine:'**** Repository information ****'; cr.
+
+            module := info2 at:#module ifAbsent:nil.
+            module notNil ifTrue:[
+                aStream nextPutLine:('  CVS Root ......: ' , 
+                                    ((mgr repositoryNameForModule:module) ifNil:[mgr repositoryName , ' (default)'])).
+            ].
+            mgr writeRevisionLogOf:aClass to:aStream.
+        ]
+    ] ifFalse:[
+        aStream nextPutLine:'No revision info found'.
+        aClass isLoaded ifFalse:[
+            aStream cr; nextPutAll:'This is an autoloaded class - you may see more after its loaded.'
+        ] ifTrue:[
+            fn := aClass classFilename.
+            aClass wasAutoloaded ifTrue:[
+                msg := 'This class was autoloaded.'.
+                fn notNil ifTrue:[
+                    msg := msg , ' (from ''' , fn , ''')'.
+                ].
+            ] ifFalse:[
+                fn notNil ifTrue:[
+                    msg := 'This class was loaded from ''' , fn , '''.'
+                ].
+            ].
+            msg notNil ifTrue:[
+                aStream cr; nextPutAll:msg.
+            ]
+        ]
+    ]
+!
+
 setPackageOfAllMethodsIn:aClass to:aPackage
     "make all methods belong to the classes project"
 
@@ -1677,5 +1750,5 @@
 !SourceCodeManagerUtilities class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.46 2000-12-04 21:32:32 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.47 2000-12-07 14:13:50 cg Exp $'
 ! !