better error message if source access is not possible (in compare)
authorClaus Gittinger <cg@exept.de>
Thu, 07 Dec 2000 14:51:09 +0100
changeset 2886 f95c04333771
parent 2885 7f4a298ca5ae
child 2887 a06e66626fbb
better error message if source access is not possible (in compare) removed some halts
NewSystemBrowser.st
Tools__NewSystemBrowser.st
--- a/NewSystemBrowser.st	Thu Dec 07 14:49:44 2000 +0100
+++ b/NewSystemBrowser.st	Thu Dec 07 14:51:09 2000 +0100
@@ -15011,7 +15011,7 @@
      aStream comparedSource currentSource v rev revString thisRevString mgr
      nm msg rev2 newestRev
      containerModule containerPackage containerFile rslt
-     lastModule lastPackage pkg|
+     lastModule lastPackage pkg info mod|
 
     currentClass := self theSingleSelectedClass.
     currentClass isLoaded ifFalse:[
@@ -15094,7 +15094,7 @@
                 msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'.
                 "/ aStream := mgr getMostRecentSourceStreamForClassNamed:nm.
                 aStream := mgr getSourceStreamFor:currentClass revision:newestRev.
-                revString := '(newest: ' , (newestRev ? '???') , ')'.
+                revString := 'newest'.
             ] ifFalse:[
                 msg := 'extracting previous %1'.
                 aStream := mgr getSourceStreamFor:currentClass revision:rev.
@@ -15108,7 +15108,14 @@
         self busyLabel:msg with:nm.
 
         aStream isNil ifTrue:[
-            self warn:'could not extract source from repository (for rev ' , (rev ? 'newest') , ')'.
+            info := mgr sourceInfoOfClass:currentClass.
+            info notNil ifTrue:[
+                mod := info at:#module ifAbsent:'??'.
+            ].
+        
+            self warn:(resources 
+                         string:'Could not extract source from repository (for module: ''%1'' , revision: ''%2'')'
+                         with:mod with:revString).
             ^ self
         ].
         aStream class readErrorSignal handle:[:ex |
@@ -15212,7 +15219,7 @@
      CAVEAT: that is almost the same code as found in SystemBrowser;
              move to SourceCodeManagerUtilities"
 
-    |codeView aStream info info2 s rv mgr fn msg|
+    |codeView aStream info info2 s rv mgr fn msg module|
 
     aStream := WriteStream on:(String new:200).
 
@@ -15231,6 +15238,8 @@
         ].
 
         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.'.
@@ -15256,8 +15265,14 @@
             aStream nextPutLine:'  Container ....... : ' , (info at:#repositoryPathName ifAbsent:'?').
             aStream cr.
 
-            (mgr := aClass sourceCodeManager) notNil ifTrue:[
+            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:[
@@ -30827,7 +30842,8 @@
                 ].
                 ^ self
             ].
-            self halt.
+            "/ everything else is ignored    
+            "/ self halt.
         ].
         ^ self
     ].
@@ -32574,8 +32590,8 @@
                 ].
                 ^ self
             ].
-
-            self halt.
+            "/ everything else is ignored
+            "/ self halt.
         ].
         ^ self
     ].
@@ -45602,6 +45618,6 @@
 !NewSystemBrowser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Attic/NewSystemBrowser.st,v 1.11 2000-12-06 14:27:05 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Attic/NewSystemBrowser.st,v 1.12 2000-12-07 13:51:09 cg Exp $'
 ! !
 NewSystemBrowser initialize!
--- a/Tools__NewSystemBrowser.st	Thu Dec 07 14:49:44 2000 +0100
+++ b/Tools__NewSystemBrowser.st	Thu Dec 07 14:51:09 2000 +0100
@@ -15011,7 +15011,7 @@
      aStream comparedSource currentSource v rev revString thisRevString mgr
      nm msg rev2 newestRev
      containerModule containerPackage containerFile rslt
-     lastModule lastPackage pkg|
+     lastModule lastPackage pkg info mod|
 
     currentClass := self theSingleSelectedClass.
     currentClass isLoaded ifFalse:[
@@ -15094,7 +15094,7 @@
                 msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'.
                 "/ aStream := mgr getMostRecentSourceStreamForClassNamed:nm.
                 aStream := mgr getSourceStreamFor:currentClass revision:newestRev.
-                revString := '(newest: ' , (newestRev ? '???') , ')'.
+                revString := 'newest'.
             ] ifFalse:[
                 msg := 'extracting previous %1'.
                 aStream := mgr getSourceStreamFor:currentClass revision:rev.
@@ -15108,7 +15108,14 @@
         self busyLabel:msg with:nm.
 
         aStream isNil ifTrue:[
-            self warn:'could not extract source from repository (for rev ' , (rev ? 'newest') , ')'.
+            info := mgr sourceInfoOfClass:currentClass.
+            info notNil ifTrue:[
+                mod := info at:#module ifAbsent:'??'.
+            ].
+        
+            self warn:(resources 
+                         string:'Could not extract source from repository (for module: ''%1'' , revision: ''%2'')'
+                         with:mod with:revString).
             ^ self
         ].
         aStream class readErrorSignal handle:[:ex |
@@ -15212,7 +15219,7 @@
      CAVEAT: that is almost the same code as found in SystemBrowser;
              move to SourceCodeManagerUtilities"
 
-    |codeView aStream info info2 s rv mgr fn msg|
+    |codeView aStream info info2 s rv mgr fn msg module|
 
     aStream := WriteStream on:(String new:200).
 
@@ -15231,6 +15238,8 @@
         ].
 
         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.'.
@@ -15256,8 +15265,14 @@
             aStream nextPutLine:'  Container ....... : ' , (info at:#repositoryPathName ifAbsent:'?').
             aStream cr.
 
-            (mgr := aClass sourceCodeManager) notNil ifTrue:[
+            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:[
@@ -30827,7 +30842,8 @@
                 ].
                 ^ self
             ].
-            self halt.
+            "/ everything else is ignored    
+            "/ self halt.
         ].
         ^ self
     ].
@@ -32574,8 +32590,8 @@
                 ].
                 ^ self
             ].
-
-            self halt.
+            "/ everything else is ignored
+            "/ self halt.
         ].
         ^ self
     ].
@@ -45602,6 +45618,6 @@
 !NewSystemBrowser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.11 2000-12-06 14:27:05 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.12 2000-12-07 13:51:09 cg Exp $'
 ! !
 NewSystemBrowser initialize!