allow loadAll-files to be filedInFromRepository
authorClaus Gittinger <cg@exept.de>
Fri, 23 Apr 1999 19:27:12 +0200
changeset 2120 70fa37e15767
parent 2119 86d590e39c19
child 2121 fe97314cb259
allow loadAll-files to be filedInFromRepository
BrowserView.st
BrwsrView.st
--- a/BrowserView.st	Fri Apr 23 17:46:09 1999 +0200
+++ b/BrowserView.st	Fri Apr 23 19:27:12 1999 +0200
@@ -1989,36 +1989,70 @@
             package := packageSelection value.
             list := containerSelection value.
 
+            packageID := module , ':' , package.
+
             dialog window withWaitCursorDo:[
                 list do:[:container |
-                    aStream := SourceCodeManager 
-                            streamForClass:nil 
-                            fileName:container 
-                            revision:#newest
-                            directory:package
-                            module:module
-                            cache:false.
-
-                    self activityNotification:'loading ' , container.
-
-                    aStream isNil ifTrue:[
-                        self warn:'could not load ' , container , ' from repository'.
+                    "/
+                    "/ special: if its a 'loadAll' file,
+                    "/ or a project-file, extract all from the repository
+                    "/ and perform some special load action.
+                    "/
+                    ((container = 'loadAll') 
+                    or:[container asLowercase asFilename hasSuffix:'prj']) ifTrue:[
+                        SourceCodeManager
+                            checkoutModule:module 
+                            package:package 
+                            andDo:[:tempDir |
+                                |oldPath wasLazy|
+
+                                self activityNotification:'loading ' , container , ' ...'.
+                                (container = 'loadAll') ifTrue:[
+                                    [
+                                        Class withoutUpdatingChangesDo:[
+                                            oldPath := Smalltalk systemPath.
+                                            Smalltalk systemPath:(oldPath copy addFirst:tempDir pathName; yourself).
+                                            wasLazy := Compiler compileLazy:false.
+                                            Class packageQuerySignal answer:packageID do:[
+                                                (tempDir construct:container) fileIn.
+                                            ]
+                                        ].
+                                    ] valueNowOrOnUnwindDo:[
+                                        Compiler compileLazy:wasLazy.
+                                        Smalltalk systemPath:oldPath.
+                                    ]
+                                ] ifFalse:[
+                                    self halt:'unimplemented: project-loading'.
+                                ]
+                            ]
                     ] ifFalse:[
-                        self busyLabel:'loading from %1' with:(module , '/' , package , '/' , container).
-
-                        Class withoutUpdatingChangesDo:[
-                            [
-                                packageID := module , ':' , package.
-
-                                Class packageQuerySignal answer:packageID do:[
-                                    aStream fileIn.
-                                ]
-                            ] valueNowOrOnUnwindDo:[
-                                aStream close.
-                                self normalLabel.
-                                Smalltalk changed.
+                        aStream := SourceCodeManager 
+                                streamForClass:nil 
+                                fileName:container 
+                                revision:#newest
+                                directory:package
+                                module:module
+                                cache:false.
+
+                        self activityNotification:'loading ' , container , ' ...'.
+
+                        aStream isNil ifTrue:[
+                            self warn:'could not load ' , container , ' from repository'.
+                        ] ifFalse:[
+                            self busyLabel:'loading from %1' with:(module , '/' , package , '/' , container).
+
+                            Class withoutUpdatingChangesDo:[
+                                [
+                                    Class packageQuerySignal answer:packageID do:[
+                                        aStream fileIn.
+                                    ]
+                                ] valueNowOrOnUnwindDo:[
+                                    aStream close.
+                                    self normalLabel.
+                                    Smalltalk changed.
+                                ].
                             ].
-                        ].
+                        ]
                     ]
                 ].
                 self activityNotification:nil
@@ -2048,13 +2082,23 @@
                  list := SourceCodeManager 
                             getExistingContainersInModule:(moduleSelection value)
                             package:(packageSelection value).
-                 list := list select:[:nm | |lcName|
+
+                 list := list select:[:nm | |lcName f|
                                             lcName := nm asLowercase.
-                                            (lcName asFilename hasSuffix:'st')
-                                            or:[lcName = 'loadall']
+                                            ((f := lcName asFilename) hasSuffix:'st')
+                                            or:[false "/ (f hasSuffix:'prj')
+                                            or:[lcName = 'loadall']]
                                      ].
                  fileNameList := list.
-                 list := list collect:[:nm | nm asFilename withoutSuffix name].
+                 list := list collect:[:nm | |lcName f|
+
+                                             lcName := nm asLowercase.
+                                             ((f := lcName asFilename) hasSuffix:'st') ifTrue:[
+                                                nm asFilename withoutSuffix name
+                                             ] ifFalse:[
+                                                nm
+                                             ]
+                                      ].
                  containerList value:list.
 "/
 "/ do not auto-select the first item
@@ -13452,6 +13496,6 @@
 !BrowserView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.494 1999-04-23 15:46:09 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.495 1999-04-23 17:27:12 cg Exp $'
 ! !
 BrowserView initialize!
--- a/BrwsrView.st	Fri Apr 23 17:46:09 1999 +0200
+++ b/BrwsrView.st	Fri Apr 23 19:27:12 1999 +0200
@@ -1989,36 +1989,70 @@
             package := packageSelection value.
             list := containerSelection value.
 
+            packageID := module , ':' , package.
+
             dialog window withWaitCursorDo:[
                 list do:[:container |
-                    aStream := SourceCodeManager 
-                            streamForClass:nil 
-                            fileName:container 
-                            revision:#newest
-                            directory:package
-                            module:module
-                            cache:false.
-
-                    self activityNotification:'loading ' , container.
-
-                    aStream isNil ifTrue:[
-                        self warn:'could not load ' , container , ' from repository'.
+                    "/
+                    "/ special: if its a 'loadAll' file,
+                    "/ or a project-file, extract all from the repository
+                    "/ and perform some special load action.
+                    "/
+                    ((container = 'loadAll') 
+                    or:[container asLowercase asFilename hasSuffix:'prj']) ifTrue:[
+                        SourceCodeManager
+                            checkoutModule:module 
+                            package:package 
+                            andDo:[:tempDir |
+                                |oldPath wasLazy|
+
+                                self activityNotification:'loading ' , container , ' ...'.
+                                (container = 'loadAll') ifTrue:[
+                                    [
+                                        Class withoutUpdatingChangesDo:[
+                                            oldPath := Smalltalk systemPath.
+                                            Smalltalk systemPath:(oldPath copy addFirst:tempDir pathName; yourself).
+                                            wasLazy := Compiler compileLazy:false.
+                                            Class packageQuerySignal answer:packageID do:[
+                                                (tempDir construct:container) fileIn.
+                                            ]
+                                        ].
+                                    ] valueNowOrOnUnwindDo:[
+                                        Compiler compileLazy:wasLazy.
+                                        Smalltalk systemPath:oldPath.
+                                    ]
+                                ] ifFalse:[
+                                    self halt:'unimplemented: project-loading'.
+                                ]
+                            ]
                     ] ifFalse:[
-                        self busyLabel:'loading from %1' with:(module , '/' , package , '/' , container).
-
-                        Class withoutUpdatingChangesDo:[
-                            [
-                                packageID := module , ':' , package.
-
-                                Class packageQuerySignal answer:packageID do:[
-                                    aStream fileIn.
-                                ]
-                            ] valueNowOrOnUnwindDo:[
-                                aStream close.
-                                self normalLabel.
-                                Smalltalk changed.
+                        aStream := SourceCodeManager 
+                                streamForClass:nil 
+                                fileName:container 
+                                revision:#newest
+                                directory:package
+                                module:module
+                                cache:false.
+
+                        self activityNotification:'loading ' , container , ' ...'.
+
+                        aStream isNil ifTrue:[
+                            self warn:'could not load ' , container , ' from repository'.
+                        ] ifFalse:[
+                            self busyLabel:'loading from %1' with:(module , '/' , package , '/' , container).
+
+                            Class withoutUpdatingChangesDo:[
+                                [
+                                    Class packageQuerySignal answer:packageID do:[
+                                        aStream fileIn.
+                                    ]
+                                ] valueNowOrOnUnwindDo:[
+                                    aStream close.
+                                    self normalLabel.
+                                    Smalltalk changed.
+                                ].
                             ].
-                        ].
+                        ]
                     ]
                 ].
                 self activityNotification:nil
@@ -2048,13 +2082,23 @@
                  list := SourceCodeManager 
                             getExistingContainersInModule:(moduleSelection value)
                             package:(packageSelection value).
-                 list := list select:[:nm | |lcName|
+
+                 list := list select:[:nm | |lcName f|
                                             lcName := nm asLowercase.
-                                            (lcName asFilename hasSuffix:'st')
-                                            or:[lcName = 'loadall']
+                                            ((f := lcName asFilename) hasSuffix:'st')
+                                            or:[false "/ (f hasSuffix:'prj')
+                                            or:[lcName = 'loadall']]
                                      ].
                  fileNameList := list.
-                 list := list collect:[:nm | nm asFilename withoutSuffix name].
+                 list := list collect:[:nm | |lcName f|
+
+                                             lcName := nm asLowercase.
+                                             ((f := lcName asFilename) hasSuffix:'st') ifTrue:[
+                                                nm asFilename withoutSuffix name
+                                             ] ifFalse:[
+                                                nm
+                                             ]
+                                      ].
                  containerList value:list.
 "/
 "/ do not auto-select the first item
@@ -13452,6 +13496,6 @@
 !BrowserView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Attic/BrwsrView.st,v 1.494 1999-04-23 15:46:09 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Attic/BrwsrView.st,v 1.495 1999-04-23 17:27:12 cg Exp $'
 ! !
 BrowserView initialize!